Repository: LLNL/Caliper (language: python)

Issue:
[Woptim] shared ci 2023.10.0
### Summary

Update Shared CI, add poodle, update Spack configs accordingly.


Discussion / hints:

Fix patch:
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 28a6b0a8b..1b6c4a51e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -28,8 +28,8 @@
 # We define the following GitLab pipeline variables:
 variables:
 ##### LC GITLAB CONFIGURATION
-# Use the umdev LLNL service user to run CI. This prevents from running
-# pipelines as an actual user.
+# Use an LLNL service user to run CI. This prevents from running pipelines as
+# an actual user.
   LLNL_SERVICE_USER: ""
 # Use the service user workspace. Solves permission issues, stores everything
 # at the same location whoever triggers a pipeline.
@@ -38,8 +38,8 @@ variables:
   GIT_SUBMODULE_STRATEGY: recursive
 
 ##### PROJECT VARIABLES
-# We build the projects in the CI clone directory.
-# Used in script/gitlab/build_and_test.sh script.
+# We build the projects in the CI clone directory (used in
+# script/gitlab/build-and-test.sh script).
 # TODO: add a clean-up mechanism.
   BUILD_ROOT: ${CI_PROJECT_DIR}
 
@@ -48,7 +48,11 @@ variables:
   GITHUB_PROJECT_NAME: "Caliper"
   GITHUB_PROJECT_ORG: "LLNL"
 # Set the build-and-test command.
-  JOB_CMD: "./scripts/gitlab/build-and-test.sh"
+# Nested variables are allowed and useful to customize the job command. We
+# prevent variable expansion so that you can define them at job level.
+  JOB_CMD:
+    value: "./scripts/gitlab/build-and-test.sh"
+    expand: false
 # Override the pattern describing branches that will skip the "draft PR filter
 # test".  Add protected branches here. See default value in
 # preliminary-ignore-draft-pr.yml.
@@ -69,7 +73,7 @@ stages:
     include:
       - local: '.gitlab/custom-jobs-and-variables.yml'
       - project: 'radiuss/radiuss-shared-ci'
-        ref: 'v2023.09.0'
+        ref: 'v2024.04.0'
         file: 'pipelines/${CI_MACHINE}.yml'
       - artifact: '${CI_MACHINE}-jobs.yml'
         job: 'generate-job-lists'
@@ -78,9 +82,11 @@ stages:
       pipeline_variables: true
 
 include:
+  - project: 'lc-templates/id_tokens'
+    file: 'id_tokens.yml'
   # [Optional] checks preliminary to running the actual CI test
   - project: 'radiuss/radiuss-shared-ci'
-    ref: 'v2023.09.0'
+    ref: 'v2024.04.0'
     file: 'utilities/preliminary-ignore-draft-pr.yml'
   # pipelines subscribed by the project
   - local: '.gitlab/subscribed-pipelines.yml'
diff --git a/.gitlab/custom-jobs-and-variables.yml b/.gitlab/custom-jobs-and-variables.yml
index 394cb97a3..c51260550 100644
--- a/.gitlab/custom-jobs-and-variables.yml
+++ b/.gitlab/custom-jobs-and-variables.yml
@@ -14,38 +14,48 @@ variables:
 
 # Ruby
 # Arguments for top level allocation
-  RUBY_SHARED_ALLOC: "--exclusive --partition=pdebug --time=30 --nodes=1"
+  RUBY_SHARED_ALLOC: "--exclusive --reservation=ci --time=5 --nodes=2"
 # Arguments for job level allocation
-  RUBY_JOB_ALLOC: "--overlap --time=20 --nodes=1"
+  RUBY_JOB_ALLOC: "--overlap --reservation=ci --nodes=1"
 # Project specific variants for ruby
-  PROJECT_RUBY_VARIANTS: " +tests"
+  PROJECT_RUBY_VARIANTS: "+tests"
 # Project specific deps for ruby
   PROJECT_RUBY_DEPS: ""
 
+# Poodle
+# Arguments for top level allocation
+  POODLE_SHARED_ALLOC: "--exclusive --partition=pdebug --time=10 --nodes=1"
+# Arguments for job level allocation
+  POODLE_JOB_ALLOC: "--overlap --nodes=1"
+# Project specific variants for poodle
+  PROJECT_POODLE_VARIANTS: "+tests ~papi"
+# Project specific deps for poodle
+  PROJECT_POODLE_DEPS: ""
+
 # Corona
 # Arguments for top level allocation
-  CORONA_SHARED_ALLOC: "--exclusive --time-limit=15m --nodes=1"
+  CORONA_SHARED_ALLOC: "--exclusive --time-limit=8m --nodes=1 -o per-resource.count=2"
 # Arguments for job level allocation
-  CORONA_JOB_ALLOC: "--time-limit=10m --nodes=1 --begin-time=+5s"
+  CORONA_JOB_ALLOC: "--nodes=1 --begin-time=+5s"
 # Project specific variants for corona
-  PROJECT_CORONA_VARIANTS: " +tests"
+  PROJECT_CORONA_VARIANTS: "+tests"
 # Project specific deps for corona
   PROJECT_CORONA_DEPS: ""
 
 # Tioga
 # Arguments for top level allocation
-  TIOGA_SHARED_ALLOC: "--exclusive --time-limit=20m --nodes=1"
+  TIOGA_SHARED_ALLOC: "--queue=pci --exclusive --time-limit=15m --nodes=1 -o per-resource.count=2"
 # Arguments for job level allocation
-  TIOGA_JOB_ALLOC: "--time-limit=10m --nodes=1 --begin-time=+5s"
+  TIOGA_JOB_ALLOC: "--nodes=1 --begin-time=+5s"
 # Project specific variants for tioga
-  PROJECT_TIOGA_VARIANTS: " +tests"
+  PROJECT_TIOGA_VARIANTS: "+tests"
 # Project specific deps for tioga
   PROJECT_TIOGA_DEPS: ""
 
 # Lassen and Butte use a different job scheduler (spectrum lsf) that does not
 # allow pre-allocation the same way slurm does.
 # Arguments for job level allocation
-  LASSEN_JOB_ALLOC: "1 -W 10"
+  LASSEN_JOB_ALLOC: "1 -W 10 -q pci"
 # Project specific variants for lassen
   PROJECT_LASSEN_VARIANTS: " +tests"
 # Project specific deps for lassen
@@ -56,5 +66,6 @@ variables:
 # CI behavior.
 # See Umpire for an example (export junit test reports).
 .custom_job:
-  variables:
-    JOB_TEMPLATE_CANNOT_BE_EMPTY: "True"
+  artifacts:
+    reports:
+      junit: junit.xml
diff --git a/.gitlab/jobs/corona.yml b/.gitlab/jobs/corona.yml
index 09b2484b8..e5cc07ebf 100644
--- a/.gitlab/jobs/corona.yml
+++ b/.gitlab/jobs/corona.yml
@@ -1,10 +1,17 @@
 ##############################################################################
-# Copyright (c) 2022, Lawrence Livermore National Security, LLC and RADIUSS
+# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS
 # project contributors. See the COPYRIGHT file for details.
 #
 # SPDX-License-Identifier: (MIT)
 ##############################################################################
 
+# Override reproducer section to define project specific variables.
+.corona_reproducer_vars:
+  script:
+    - |
+      echo -e "export MODULE_LIST=\"${MODULE_LIST}\""
+      echo -e "export SPEC=\"${SPEC//\"/\\\"}\""
+
 # With GitLab CI, included files cannot be empty.
 variables:
   INCLUDED_FILE_CANNOT_BE_EMPTY: "True"
diff --git a/.gitlab/jobs/lassen.yml b/.gitlab/jobs/lassen.yml
index bebd2daca..a2428f6ee 100644
--- a/.gitlab/jobs/lassen.yml
+++ b/.gitlab/jobs/lassen.yml
@@ -1,15 +1,43 @@
 ##############################################################################
-# Copyright (c) 2022, Lawrence Livermore National Security, LLC and RADIUSS
+# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS
 # project contributors. See the COPYRIGHT file for details.
 #
 # SPDX-License-Identifier: (MIT)
 ##############################################################################
 
+# Override reproducer section to define project specific variables.
+.lassen_reproducer_vars:
+  script:
+    - |
+      echo -e "export MODULE_LIST=\"${MODULE_LIST}\""
+      echo -e "export SPEC=\"${SPEC//\"/\\\"}\""
+
 # With GitLab CI, included files cannot be empty.
 variables:
   INCLUDED_FILE_CANNOT_BE_EMPTY: "True"
 
-## Template for extra jobs defined by the project.
+########################
+# Overridden shared jobs
+########################
+# We duplicate the shared jobs description and add necessary changes for RAJA.
+# We keep ${PROJECT_<MACHINE>_VARIANTS} and ${PROJECT_<MACHINE>_DEPS} So that
+# the comparison with the original job is easier.
+
+# Allow failure due to weird error only with XL on Lassen. Passes in debug mode.
+xl_2022_08_19_gcc_8_3_1_cuda_11_2_0:
+  variables:
+    SPEC: "${PROJECT_LASSEN_VARIANTS} +cuda %xl@=16.1.1.12.gcc.8.3.1 ^cuda@11.2.0+allow-unsupported-compilers ${PROJECT_LASSEN_DEPS}"
+    MODULE_LIST: "cuda/11.2.0"
+  extends: .job_on_lassen
+  allow_failure: true
+
+############
+# Extra jobs
+############
+# We do not recommend using ${PROJECT_<MACHINE>_VARIANTS} and
+# ${PROJECT_<MACHINE>_DEPS} in the extra jobs. There is not reason not to fully
+# describe the spec here.
+
 master:
   variables:
     SPEC: " +tests"
diff --git a/.gitlab/jobs/poodle.yml b/.gitlab/jobs/poodle.yml
new file mode 100644
index 000000000..2295ba251
--- /dev/null
+++ b/.gitlab/jobs/poodle.yml
@@ -0,0 +1,23 @@
+##############################################################################
+# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS
+# project contributors. See the COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (MIT)
+##############################################################################
+
+# Override reproducer section to define project specific variables.
+.poodle_reproducer_vars:
+  script:
+    - |
+      echo -e "export MODULE_LIST=\"${MODULE_LIST}\""
+      echo -e "export SPEC=\"${SPEC//\"/\\\"}\""
+
+# With GitLab CI, included files cannot be empty.
+variables:
+  INCLUDED_FILE_CANNOT_BE_EMPTY: "True"
+
+## Template for extra jobs defined by the project.
+master:
+  variables:
+    SPEC: " +tests ~papi"
+  extends: .job_on_poodle
diff --git a/.gitlab/jobs/ruby.yml b/.gitlab/jobs/ruby.yml
index d3a831cae..e93dc6913 100644
--- a/.gitlab/jobs/ruby.yml
+++ b/.gitlab/jobs/ruby.yml
@@ -1,10 +1,17 @@
 ##############################################################################
-# Copyright (c) 2022, Lawrence Livermore National Security, LLC and RADIUSS
+# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS
 # project contributors. See the COPYRIGHT file for details.
 #
 # SPDX-License-Identifier: (MIT)
 ##############################################################################
 
+# Override reproducer section to define project specific variables.
+.ruby_reproducer_vars:
+  script:
+    - |
+      echo -e "export MODULE_LIST=\"${MODULE_LIST}\""
+      echo -e "export SPEC=\"${SPEC//\"/\\\"}\""
+
 # With GitLab CI, included files cannot be empty.
 variables:
   INCLUDED_FILE_CANNOT_BE_EMPTY: "True"
diff --git a/.gitlab/jobs/tioga.yml b/.gitlab/jobs/tioga.yml
index da0f1e3ad..202f7ce23 100644
--- a/.gitlab/jobs/tioga.yml
+++ b/.gitlab/jobs/tioga.yml
@@ -1,10 +1,17 @@
 ##############################################################################
-# Copyright (c) 2022, Lawrence Livermore National Security, LLC and RADIUSS
+# Copyright (c) 2022-23, Lawrence Livermore National Security, LLC and RADIUSS
 # project contributors. See the COPYRIGHT file for details.
 #
 # SPDX-License-Identifier: (MIT)
 ##############################################################################
 
+# Override reproducer section to define project specific variables.
+.tioga_reproducer_vars:
+  script:
+    - |
+      echo -e "export MODULE_LIST=\"${MODULE_LIST}\""
+      echo -e "export SPEC=\"${SPEC//\"/\\\"}\""
+
 # With GitLab CI, included files cannot be empty.
 variables:
   INCLUDED_FILE_CANNOT_BE_EMPTY: "True"
@@ -18,5 +25,11 @@ variables:
 
 master:
   variables:
-    SPEC: " +tests %cce@15.0.1"
+    SPEC: " +tests %cce@16.0.1"
+  extends: .job_on_tioga
+
+rocmcc_5_7_1_hip:
+  variables:
+    ON_TIOGA: "OFF"
+    SPEC: "${PROJECT_TIOGA_VARIANTS} +rocm amdgpu_target=gfx90a %rocmcc@5.7.1 ^hip@5.7.1 ${PROJECT_TIOGA_DEPS}"
   extends: .job_on_tioga
diff --git a/.gitlab/subscribed-pipelines.yml b/.gitlab/subscribed-pipelines.yml
index 4ee8de72b..d28140163 100644
--- a/.gitlab/subscribed-pipelines.yml
+++ b/.gitlab/subscribed-pipelines.yml
@@ -38,12 +38,14 @@ generate-job-lists:
     LOCAL_JOBS_PATH: ".gitlab/jobs"
   script:
     - cat ${RADIUSS_JOBS_PATH}/ruby.yml ${LOCAL_JOBS_PATH}/ruby.yml > ruby-jobs.yml
+    - cat ${RADIUSS_JOBS_PATH}/poodle.yml ${LOCAL_JOBS_PATH}/poodle.yml > poodle-jobs.yml
     - cat ${RADIUSS_JOBS_PATH}/lassen.yml ${LOCAL_JOBS_PATH}/lassen.yml > lassen-jobs.yml
     - cat ${RADIUSS_JOBS_PATH}/corona.yml ${LOCAL_JOBS_PATH}/corona.yml > corona-jobs.yml
     - cat ${RADIUSS_JOBS_PATH}/tioga.yml ${LOCAL_JOBS_PATH}/tioga.yml > tioga-jobs.yml
   artifacts:
     paths:
       - ruby-jobs.yml
+      - poodle-jobs.yml
       - lassen-jobs.yml
       - corona-jobs.yml
       - tioga-jobs.yml
@@ -60,6 +62,18 @@ ruby-build-and-test:
   needs: [ruby-up-check, generate-job-lists]
   extends: [.build-and-test]
 
+# POODLE
+poodle-up-check:
+  variables:
+    CI_MACHINE: "poodle"
+  extends: [.machine-check]
+
+poodle-build-and-test:
+  variables:
+    CI_MACHINE: "poodle"
+  needs: [poodle-up-check, generate-job-lists]
+  extends: [.build-and-test]
+
 # Quartz it very similar to ruby, let’s deactivate it for now
 ## QUARTZ
 #quartz-up-check:
diff --git a/.uberenv_config.json b/.uberenv_config.json
index cb6b3fcfc..f07a37cb7 100755
--- a/.uberenv_config.json
+++ b/.uberenv_config.json
@@ -4,7 +4,7 @@
     "package_source_dir" : "../..",
     "package_final_phase" : "initconfig",
     "spack_url": "https://github.com/spack/spack.git",
-    "spack_branch": "v0.20.1",
+    "spack_branch": "develop-2024-02-18",
     "spack_activate" : {},
     "spack_configs_path": "scripts/radiuss-spack-configs",
     "spack_packages_path": "scripts/radiuss-spack-configs/packages",
diff --git a/LICENSE b/LICENSE
index 81b88030c..cf0f1470f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2015-2020, Lawrence Livermore National Security, LLC.
+Copyright (c) 2015-2023, Lawrence Livermore National Security, LLC.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff --git a/scripts/radiuss-spack-configs b/scripts/radiuss-spack-configs
index 56c30b4ac..a8d22367e 160000
--- a/scripts/radiuss-spack-configs
+++ b/scripts/radiuss-spack-configs
@@ -1,1 +1,1 @@
-Subproject commit 56c30b4ac50b49240ef4c8ef5441456f02c550f8
+Subproject commit a8d22367e03d4c9c180a11886414430bdf6428a8
diff --git a/scripts/uberenv b/scripts/uberenv
index 0d00dc8e1..cf91883ef 160000
--- a/scripts/uberenv
+++ b/scripts/uberenv
@@ -1,1 +1,1 @@
-Subproject commit 0d00dc8e19a889ba07ae433590b87533c4b5b3da
+Subproject commit cf91883ef0500a808338ad6c8b56647da15fa5f3


Test patch:
diff --git a/scripts/ctest-to-junit.xsl b/scripts/ctest-to-junit.xsl
new file mode 100644
index 000000000..b6a00b9ee
--- /dev/null
+++ b/scripts/ctest-to-junit.xsl
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Originated from https://github.com/rpavlik/jenkins-ctest-plugin
+  MIT License added to top of this file from repo's LICENSE file
+-->
+
+<!--
+Copyright (c) 2010 VersionOne, Inc.
+Copyright (c) 2011, 2014 Ryan Pavlik <abiryan@ryand.net.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="xml" indent="yes" />
+    <xsl:template match="/">
+        <testsuites>
+            <xsl:variable name="buildName" select="//Site/@BuildName"/>
+            <xsl:variable name="numberOfTests" select="count(//Site/Testing/Test)"/>
+            <xsl:variable name="numberOfFailures" select="count(//Site/Testing/Test[@Status!='passed'])" />
+            <testsuite name="CTest"
+                tests="{$numberOfTests}" time="0"
+                failures="{$numberOfFailures}"  errors="0"
+                skipped="0">
+            <xsl:for-each select="//Site/Testing/Test">
+                    <xsl:variable name="testName" select="translate(Name, '-', '_')"/>
+                    <xsl:variable name="duration" select="Results/NamedMeasurement[@name='Execution Time']/Value"/>
+                    <xsl:variable name="status" select="@Status"/>
+                    <xsl:variable name="output" select="Results/Measurement/Value"/>
+                    <xsl:variable name="className" select="translate(Path, '/.', '.')"/>
+                    <testcase classname="projectroot{$className}"
+                        name="{$testName}"
+                        time="{$duration}">
+                        <xsl:if test="@Status!='passed'">
+                            <failure>
+                                <xsl:value-of select="$output" />
+                            </failure>
+                        </xsl:if>
+                        <system-out>
+                            <xsl:value-of select="$output" />
+                        </system-out>
+                    </testcase>
+                </xsl:for-each>
+            </testsuite>
+        </testsuites>
+    </xsl:template>
+</xsl:stylesheet>
diff --git a/scripts/gitlab/build-and-test.sh b/scripts/gitlab/build-and-test.sh
index 333faf597..1e109f00e 100755
--- a/scripts/gitlab/build-and-test.sh
+++ b/scripts/gitlab/build-and-test.sh
@@ -1,19 +1,47 @@
 #!/usr/bin/env bash
 
+# Initialize modules for users not using bash as a default shell
+if test -e /usr/share/lmod/lmod/init/bash
+then
+  . /usr/share/lmod/lmod/init/bash
+fi
+
+###############################################################################
+# Copyright (c) 2016-23, Lawrence Livermore National Security, LLC and Caliper
+# project contributors. See the Caliper/LICENSE file for details.
+#
+# SPDX-License-Identifier: (BSD-3-Clause)
+###############################################################################
+
+set -o errexit
+set -o nounset
+
+option=${1:-""}
 hostname="$(hostname)"
-timestamp="$(date +"%T" | sed 's/://g')"
+truehostname=${hostname//[0-9]/}
 project_dir="$(pwd)"
-hostname="$(hostname)"
+
+hostconfig=${HOST_CONFIG:-""}
 spec=${SPEC:-""}
-option=${1:-""}
-truehostname=${hostname//[0-9]/}
+module_list=${MODULE_LIST:-""}
+job_unique_id=${CI_JOB_ID:-""}
+use_dev_shm=${USE_DEV_SHM:-true}
+
+if [[ -n ${module_list} ]]
+then
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    echo "~~~~~ Modules to load: ${module_list}"
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    module load ${module_list}
+fi
 
 prefix=""
 
 if [[ "${option}" == "--project-build" ]]
 then
+    timestamp="$(date +"%T" | sed 's/://g')"
     prefix=${project_dir}"/CI-builds/${hostname}-${timestamp}"
-elif [[ -d /dev/shm ]]
+elif [[ -d /dev/shm && ${use_dev_shm} == true ]]
 then
     prefix="/dev/shm/${hostname}"
     if [[ -z ${job_unique_id} ]]; then
@@ -23,7 +51,11 @@ then
           job_unique_id=manual_job_$(date +%s)
       done
     fi
+
     prefix="${prefix}-${job_unique_id}"
+else
+    # We set the prefix in the parent directory so that spack dependencies are not installed inside the source tree.
+    prefix="$(pwd)/../spack-and-build-root"
 fi
 
 echo "Creating directory ${prefix}"
@@ -31,26 +63,42 @@ echo "project_dir: ${project_dir}"
 
 mkdir -p ${prefix}
 
-spack_user_cache="${prefix}/spack-user-cache"
-export SPACK_DISABLE_LOCAL_CONFIG=""
-export SPACK_USER_CACHE_PATH="${spack_user_cache}"
-mkdir -p ${spack_user_cache}
+# Dependencies
+if [[ "${option}" != "--build-only" && "${option}" != "--test-only" ]]
+then
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    echo "~~~~~ Building dependencies $(date)"
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
 
-if [[ -z ${spec} ]]
+    if [[ -z ${spec} ]]
     then
         echo "SPEC is undefined, aborting..."
         exit 1
     fi
 
-# generate cmake cache file with uberenv and radiuss spack package
-echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
-echo "~~~~~ Building Dependencies"
-echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
-./scripts/uberenv/uberenv.py --prefix ${prefix} --spec="${spec}"
+    prefix_opt="--prefix=${prefix}"
+
+    # We force Spack to put all generated files (cache and configuration of
+    # all sorts) in a unique location so that there can be no collision
+    # with existing or concurrent Spack.
+    spack_user_cache="${prefix}/spack-user-cache"
+    export SPACK_DISABLE_LOCAL_CONFIG=""
+    export SPACK_USER_CACHE_PATH="${spack_user_cache}"
+    mkdir -p ${spack_user_cache}
+
+    # generate cmake cache file with uberenv and radiuss spack package
+    ./scripts/uberenv/uberenv.py --spec="${spec}" ${prefix_opt}
+
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+    echo "~~~~~ Dependencies built $(date)"
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+fi
 
-# find generated cmake cache
+# find cmake cache file (hostconfig)
 if [[ -z ${hostconfig} ]]
 then
+    # If no host config file was provided, we assume it was generated.
+    # This means we are looking of a unique one in project dir.
     hostconfigs=( $( ls "${project_dir}/"*.cmake ) )
     if [[ ${#hostconfigs[@]} == 1 ]]
     then
@@ -68,22 +116,25 @@ then
         exit 1
     fi
 else
-    hostconfig_path = "${project_dir}/${hostconfig}"
+    # Using provided host-config file.
+    hostconfig_path="${project_dir}/${hostconfig}"
 fi
 
 hostconfig=$(basename ${hostconfig_path})
 echo "Found hostconfig: ${hostconfig}"
 
-# build directory
-build_dir="${prefix}/build_${hostconfig//.cmake/}"
-install_dir="${prefix}/install_${hostconfig//.cmake/}"
-cmake_exe=`grep 'CMake executable' ${hostconfig_path} | cut -d ':' -f 2 | xargs`
+# Build Directory
+# When using /dev/shm, we use prefix for both spack builds and source build, unless BUILD_ROOT was defined
+build_root=${BUILD_ROOT:-"${prefix}"}
 
+build_dir="${build_root}/build_${hostconfig//.cmake/}"
+install_dir="${build_root}/install_${hostconfig//.cmake/}"
+
+cmake_exe=`grep 'CMake executable' ${hostconfig_path} | cut -d ':' -f 2 | xargs`
 
 # Build
 if [[ "${option}" != "--deps-only" && "${option}" != "--test-only" ]]
 then
-    date
     echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
     echo "~~~~~ Prefix: ${prefix}"
     echo "~~~~~ Host-config: ${hostconfig_path}"
@@ -93,11 +144,11 @@ then
     echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
     echo ""
     echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
-    echo "~~~~~ Building Caliper"
+    echo "~~~~~ Building Caliper $(date)"
     echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
 
     # Map CPU core allocations
-    declare -A core_counts=(["lassen"]=40 ["ruby"]=28 ["corona"]=32 ["rzansel"]=48 ["tioga"]=32)
+    declare -A core_counts=(["lassen"]=40 ["ruby"]=28 ["poodle"]=28 ["corona"]=32 ["rzansel"]=48 ["tioga"]=32)
 
     # If building, then delete everything first
     # NOTE: 'cmake --build . -j core_counts' attempts to reduce individual build resources.
@@ -107,12 +158,11 @@ then
     mkdir -p ${build_dir} && cd ${build_dir}
 
     date
-
     if [[ "${truehostname}" == "corona" || "${truehostname}" == "tioga" ]]
     then
         module unload rocm
     fi
-    if [[ "${truehostname}" == "lassen" ]]
+    if [[ "${truehostname}" == "lassen" || "${truehostname}" == "tioga" ]]
     then
         $cmake_exe \
           -C ${hostconfig_path} \
@@ -127,47 +177,55 @@ then
     fi
     if ! $cmake_exe --build . -j ${core_counts[$truehostname]}
     then
-        echo "ERROR: compilation failed, building with verbose output..."
+        echo "[Error]: compilation failed, building with verbose output..."
+        echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
+        echo "~~~~~ Running make VERBOSE=1 $(date)"
+        echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
         $cmake_exe --build . --verbose -j 1
     else
-        make install
+        $cmake_exe --install .
     fi
 
     echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
-    echo "~~~~~ Caliper Built"
+    echo "~~~~~ Caliper Built $(date)"
     echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
-    date
 fi
 
 # Test
 if [[ "${option}" != "--build-only" ]]
 then
-    date
     echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
-    echo "~~~~~ Testing Caliper"
+    echo "~~~~~ Testing Caliper $(date)"
     echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
 
-    echo "Moving to ${build_dir}"
+    if [[ ! -d ${build_dir} ]]
+    then
+        echo "[Error]: Build directory not found : ${build_dir}" && exit 1
+    fi
+
     cd ${build_dir}
 
     date
     ctest --output-on-failure -T test 2>&1 | tee tests_output.txt
     date
 
-
     no_test_str="No tests were found!!!"
     if [[ "$(tail -n 1 tests_output.txt)" == "${no_test_str}" ]]
     then
-        echo "ERROR: No tests were found" && exit 1
+        echo "[Error]: No tests were found" && exit 1
     fi
 
+    echo "Copying Testing xml reports for export"
+    tree Testing
+    xsltproc -o junit.xml ${project_dir}/scripts/ctest-to-junit.xsl Testing/*/Test.xml
+    mv junit.xml ${project_dir}/junit.xml
+
     if grep -q "Errors while running CTest" ./tests_output.txt
     then
-        echo "ERROR: failure(s) while running CTest" && exit 1
+        echo "[Error]: failure(s) while running CTest" && exit 1
     fi
 
     echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
-    echo "~~~~~ Caliper Tests Complete"
+    echo "~~~~~ Caliper Tests Complete $(date)"
     echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
-    date
 fi