From bd6f6a0bb5552a51b8dc4291feb01d880383c352 Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Mon, 19 Jan 2026 18:58:52 +0000 Subject: [PATCH 01/12] Updated the tavg.hpp and tavg.cpp files from Yu-Hsiang's repo --- src/plugins/tavg.cpp | 134 +++++++++++++++++++++++++++++++++++++------ src/plugins/tavg.hpp | 6 +- 2 files changed, 123 insertions(+), 17 deletions(-) diff --git a/src/plugins/tavg.cpp b/src/plugins/tavg.cpp index 00935a124f..65cab8ad93 100644 --- a/src/plugins/tavg.cpp +++ b/src/plugins/tavg.cpp @@ -1,3 +1,5 @@ +//.. NOTE: this modified version has been copied from: +//.. https://github.com/yslan/nekrsExamples/blob/master/tavg/tavg.cpp #include "platform.hpp" #include "tavg.hpp" #include "nekInterfaceAdapter.hpp" @@ -7,6 +9,7 @@ namespace { dlong fieldOffset; +int Nscalar; // avg all std::vector< std::vector> > userFieldList; occa::memory o_AVG; @@ -17,9 +20,11 @@ occa::kernel E3Kernel; occa::kernel E4Kernel; std::unique_ptr fldWriter; +std::unique_ptr fldWriter_avg, fldWriter_rms, fldWriter_rm2; bool buildKernelCalled = false; bool setupCalled = false; +bool avg_all = false; // nek5000's avg_all mode int counter = 0; @@ -178,7 +183,46 @@ void tavg::setup(dlong _fieldOffset, const std::vector< std::vectorNscalar; + + std::vector< std::vector> > tavgFields; + deviceMemory o_u(nrs->o_U.slice(0 * nrs->fieldOffset , nrs->fieldOffset)); + deviceMemory o_v(nrs->o_U.slice(1 * nrs->fieldOffset , nrs->fieldOffset)); + deviceMemory o_w(nrs->o_U.slice(2 * nrs->fieldOffset , nrs->fieldOffset)); + deviceMemory o_p(nrs->o_P.slice(0 * nrs->fieldOffset , nrs->fieldOffset)); + + // E[X] + tavgFields.push_back({o_u}); + tavgFields.push_back({o_v}); + tavgFields.push_back({o_w}); + tavgFields.push_back({o_p}); + for (int is=0; isNscalar; is++) { + deviceMemory o_s(nrs->cds->o_S.slice(nrs->cds->fieldOffsetScan[is], nrs->cds->fieldOffset[is])); + tavgFields.push_back({o_s}); + } + + // E[X^2] + tavgFields.push_back({o_u, o_u}); + tavgFields.push_back({o_v, o_v}); + tavgFields.push_back({o_w, o_w}); + tavgFields.push_back({o_p, o_p}); + for (int is=0; isNscalar; is++) { + deviceMemory o_s(nrs->cds->o_S.slice(nrs->cds->fieldOffsetScan[is], nrs->cds->fieldOffset[is])); + tavgFields.push_back({o_s, o_s}); + } + + // E[X,Y] + tavgFields.push_back({o_u, o_v}); + tavgFields.push_back({o_v, o_w}); + tavgFields.push_back({o_w, o_u}); + + tavg::setup(nrs->fieldOffset, tavgFields); +} + +void tavg::outfld(mesh_t *mesh, bool FP64, bool reset_) { nekrsCheck(!setupCalled || !buildKernelCalled, MPI_COMM_SELF, @@ -188,26 +232,84 @@ void tavg::outfld(mesh_t *mesh) if (userFieldList.size() == 0) return; - const bool outXYZ = mesh && outfldCounter == 0; + const bool outXYZ = mesh && outfldCounter == 0; - fldWriter = iofldFactory::create(); + if (avg_all) { - if (!fldWriter->isInitialized()) { - fldWriter->open(mesh, iofld::mode::write, "tavg"); + auto iofldWrapper = [&](std::unique_ptr &iofld, int &idx, std::string fileName, bool hasScalar) + { + if (!iofld) { + iofld = iofldFactory::create(); + if (platform->comm.mpiRank == 0) { + printf("create a new iofldFactory... %s\n", fileName.c_str()); + } + } - fldWriter->writeAttribute("precision", "64"); - - fldWriter->addVariable("time", atime); - - for(int i = 0; i < userFieldList.size(); i++) { - fldWriter->addVariable("scalar" + scalarDigitStr(i), std::vector{o_AVG.slice(i * fieldOffset, mesh->Nlocal)}); - } - } + if (!iofld->isInitialized()) { + iofld->open(mesh, iofld::mode::write, fileName); + iofld->writeAttribute("precision", (FP64) ? "64" : "32"); + + std::vector o_V; + o_V.push_back(o_AVG.slice((idx+0)*fieldOffset, mesh->Nlocal)); + o_V.push_back(o_AVG.slice((idx+1)*fieldOffset, mesh->Nlocal)); + o_V.push_back(o_AVG.slice((idx+2)*fieldOffset, mesh->Nlocal)); + iofld->addVariable("velocity", o_V); + idx += 3; + + if (hasScalar) { + auto o_p = std::vector{o_AVG.slice((idx+0)*fieldOffset, mesh->Nlocal)}; + iofld->addVariable("pressure", o_p); + idx += 1; + + for (int i = 0; i < Nscalar; i++) { + if (platform->options.compareArgs("SCALAR" + scalarDigitStr(i) + " CHECKPOINTING", "TRUE")) { + const auto temperatureExists = platform->options.compareArgs("SCALAR00 IS TEMPERATURE", "TRUE"); + std::vector o_Si = {o_AVG.slice((idx+i)*fieldOffset, mesh->Nlocal)}; + if (i == 0 && temperatureExists) { + iofld->addVariable("temperature", o_Si); + } else { + const auto is = (temperatureExists) ? i - 1 : i; + iofld->addVariable("scalar" + scalarDigitStr(is), o_Si); + } + } + } + idx += Nscalar; + } + } - fldWriter->writeAttribute("outputmesh", (outXYZ) ? "true" : "false"); - fldWriter->process(); + iofld->addVariable("time", atime); + iofld->writeAttribute("outputmesh", (outXYZ) ? "true" : "false"); + iofld->process(); + }; // iofldWrapper + + int idx = 0; + iofldWrapper(fldWriter_avg, idx, "avg", true); + iofldWrapper(fldWriter_rms, idx, "rms", true); + iofldWrapper(fldWriter_rm2, idx, "rm2", false); + + } else { + + fldWriter = iofldFactory::create(); + + if (!fldWriter->isInitialized()) { + fldWriter->open(mesh, iofld::mode::write, "tavg"); + + fldWriter->writeAttribute("precision", (FP64) ? "64" : "32"); + + fldWriter->addVariable("time", atime); + + for(int i = 0; i < userFieldList.size(); i++) { + fldWriter->addVariable("scalar" + scalarDigitStr(i), std::vector{o_AVG.slice(i * fieldOffset, mesh->Nlocal)}); + } + } + + fldWriter->writeAttribute("outputmesh", (outXYZ) ? "true" : "false"); + fldWriter->process(); + } - atime = 0; // reset + if (reset_) { + atime = 0; // reset + } outfldCounter++; } diff --git a/src/plugins/tavg.hpp b/src/plugins/tavg.hpp index c6bfb44b81..eb21ce27a1 100644 --- a/src/plugins/tavg.hpp +++ b/src/plugins/tavg.hpp @@ -1,3 +1,5 @@ +//.. NOTE: this modified version has been copied from: +//.. https://github.com/yslan/nekrsExamples/blob/master/tavg/tavg.hpp #if !defined(nekrs_tavg_hpp_) #define nekrs_tavg_hpp_ @@ -10,13 +12,15 @@ #include "nekrsSys.hpp" #include "mesh.h" +#include "nrs.hpp" // FIXME namespace tavg { void buildKernel(occa::properties kernelInfo); void run(double time); void setup(dlong fieldOffset, const std::vector< std::vector> >& fields); -void outfld(mesh_t *mesh); +void setup(nrs_t* nrs); +void outfld(mesh_t *mesh, bool FP64 = true, bool reset_ = true); void reset(); void free(); deviceMemory o_avg(); From 2d081cae8adc50be8fa9e8a21b80e097509609fc Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Tue, 20 Jan 2026 13:51:03 +0000 Subject: [PATCH 02/12] Added a BuildMe.Aurora script --- BuildMe.Aurora | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 BuildMe.Aurora diff --git a/BuildMe.Aurora b/BuildMe.Aurora new file mode 100755 index 0000000000..bd4586ac8b --- /dev/null +++ b/BuildMe.Aurora @@ -0,0 +1,35 @@ +#!/bin/bash +set -e -a + +: ${ONEAPI_SDK:="oneapi/release/2025.2.0"} + +#... load the necessary modules here ... +module reload +module load ${ONEAPI_SDK} +module load cmake +module list +#... + +#... set some environment variables +export CC=mpicc +export CXX=mpic++ +export FC=mpif77 + +#.. === +path_to_code=`pwd` +build_date=$(date '+%Y-%m-%d') +which_build=built.on.${build_date} +BUILD_DIR=${path_to_code}/${which_build} + +#.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. +#.. ^^^^ +export NEKRS_HOME=/lus/flare/projects/catalyst/world_shared/bramesh/codes/NekRS/argonne-cps/aurora/nekRS_alcf/.local/nekrs +export INSTALL_DIR=${NEKRS_HOME} + +#... +cmake -S . -B ${BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -Wfatal-errors && \ +cmake --build ${BUILD_DIR} --parallel 8 && \ +cmake --install ${BUILD_DIR} + +#... +ln -fsn ${which_build} current From 73673f87cce4b45428afca12a31f2eed1c4aa7aa Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Sat, 21 Feb 2026 22:06:46 +0000 Subject: [PATCH 03/12] add revised BuildMe.Aurora --- BuildMe.Aurora | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildMe.Aurora b/BuildMe.Aurora index bd4586ac8b..21027f1edb 100755 --- a/BuildMe.Aurora +++ b/BuildMe.Aurora @@ -18,12 +18,12 @@ export FC=mpif77 #.. === path_to_code=`pwd` build_date=$(date '+%Y-%m-%d') -which_build=built.on.${build_date} +which_build=RBK_built.on.${build_date} BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ -export NEKRS_HOME=/lus/flare/projects/catalyst/world_shared/bramesh/codes/NekRS/argonne-cps/aurora/nekRS_alcf/.local/nekrs +export NEKRS_HOME=/lus/flare/projects/catalyst/world_shared/bramesh/codes/NekRS/argonne-cps/aurora/.local/nekrs export INSTALL_DIR=${NEKRS_HOME} #... From 62b3f4d897cc209521165cc4113282a513373701 Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Sat, 21 Feb 2026 22:32:11 +0000 Subject: [PATCH 04/12] add BuildMe.Sunspot --- BuildMe.Sunspot | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 BuildMe.Sunspot diff --git a/BuildMe.Sunspot b/BuildMe.Sunspot new file mode 100755 index 0000000000..f18209c56e --- /dev/null +++ b/BuildMe.Sunspot @@ -0,0 +1,35 @@ +#!/bin/bash +set -e -a + +: ${ONEAPI_SDK:="oneapi/release/2025.3.1"} + +#... load the necessary modules here ... +module reload +module load ${ONEAPI_SDK} +module load cmake +module list +#... + +#... set some environment variables +export CC=mpicc +export CXX=mpic++ +export FC=mpif77 + +#.. === +path_to_code=`pwd` +build_date=$(date '+%Y-%m-%d') +which_build=RBK_built.on.${build_date} +BUILD_DIR=${path_to_code}/${which_build} + +#.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. +#.. ^^^^ +export NEKRS_HOME=/lus/flare/projects/catalyst/world_shared/bramesh/codes/NekRS/argonne-cps/aurora/.local/nekrs +export INSTALL_DIR=${NEKRS_HOME} + +#... +cmake -S . -B ${BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -Wfatal-errors && \ +cmake --build ${BUILD_DIR} --parallel 8 && \ +cmake --install ${BUILD_DIR} + +#... +ln -fsn ${which_build} current From 5b1f65d8b0b4bade334ba028e7433c3ebe7c6587 Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Tue, 10 Mar 2026 18:23:25 +0000 Subject: [PATCH 05/12] modified tavg.cpp to add casename to the avg/rms/rm2 filenames --- src/plugins/tavg.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/plugins/tavg.cpp b/src/plugins/tavg.cpp index 65cab8ad93..83e99ee260 100644 --- a/src/plugins/tavg.cpp +++ b/src/plugins/tavg.cpp @@ -230,6 +230,9 @@ void tavg::outfld(mesh_t *mesh, bool FP64, bool reset_) "%s\n", "called prior to tavg::setup()!"); + //.. instantiate the casename variable + const std::string casename = platform->options.getArgs("CASENAME"); + if (userFieldList.size() == 0) return; const bool outXYZ = mesh && outfldCounter == 0; @@ -283,9 +286,10 @@ void tavg::outfld(mesh_t *mesh, bool FP64, bool reset_) }; // iofldWrapper int idx = 0; - iofldWrapper(fldWriter_avg, idx, "avg", true); - iofldWrapper(fldWriter_rms, idx, "rms", true); - iofldWrapper(fldWriter_rm2, idx, "rm2", false); + //.. add the casename to the name of the avg/rms/rm2 checkpoint files + iofldWrapper(fldWriter_avg, idx, "avg"+casename, true); + iofldWrapper(fldWriter_rms, idx, "rms"+casename, true); + iofldWrapper(fldWriter_rm2, idx, "rm2"+casename, false); } else { From 391dd88bebb46047efb1dafc7ad8a730c05aab4c Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Wed, 11 Mar 2026 04:38:37 +0000 Subject: [PATCH 06/12] Added BuildMe.Polaris script --- BuildMe.Polaris | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 BuildMe.Polaris diff --git a/BuildMe.Polaris b/BuildMe.Polaris new file mode 100755 index 0000000000..e82075dd0c --- /dev/null +++ b/BuildMe.Polaris @@ -0,0 +1,38 @@ +#!/bin/bash +set -e -a + +#... load the necessary modules here ... +module restore +module use /soft/modulefiles +module swap PrgEnv-nvidia PrgEnv-gnu +module load cudatoolkit-standalone/13.0.1 +module load cuda/12.9 +module load gcc-native/13.2 +module load craype-x86-milan craype-accel-nvidia80 +module load spack-pe-base cmake +#... + +#... set some environment variables +export CC=cc +export CXX=CC +export FC=ftn + +#.. === +path_to_code=`pwd` +build_date=$(date '+%Y-%m-%d') +which_build=RBK_built.on.${build_date} +BUILD_DIR=${path_to_code}/${which_build} + +#.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. +#.. ^^^^ +export NEKRS_HOME=/lus/eagle/projects/catalyst/proj-shared/bramesh/Polaris/codes/NekRS/argonne-cps/branches/aurora/.local/nekrs +#... +export INSTALL_DIR=${NEKRS_HOME} + +#... +cmake -S . -B ${BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -Wfatal-errors && \ +cmake --build ${BUILD_DIR} --parallel 8 && \ +cmake --install ${BUILD_DIR} + +#... +ln -fsn ${which_build} current From fdaf1c2b71e07d6ea511741c1af596bfabc67f5e Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Fri, 22 May 2026 04:20:55 +0000 Subject: [PATCH 07/12] Add BuildMe.Frontier build script --- BuildMe.Frontier | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 BuildMe.Frontier diff --git a/BuildMe.Frontier b/BuildMe.Frontier new file mode 100755 index 0000000000..eb44cce130 --- /dev/null +++ b/BuildMe.Frontier @@ -0,0 +1,38 @@ +#!/bin/bash +set -e -a + +#... load the necessary modules here ... +module reset +module load PrgEnv-amd +module load craype-accel-amd-gfx90a +module load cray-mpich +module load rocm +module load cmake +module unload cray-libsci darshan-runtime + +module list +#... + +#... set some environment variables +export CC=cc +export CXX=CC +export FC=ftn + +#.. === +path_to_code=`pwd` +build_date=$(date '+%Y-%m-%d') +which_build=RBK_built.on.${build_date} +BUILD_DIR=${path_to_code}/${which_build} + +#.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. +#.. ^^^^ +export NEKRS_HOME=/lustre/orion/proj-shared/cfd129/bramesh/RECHERCHE/codes/NekRS/argonne-cps/branches/aurora/.local/nekrs +export INSTALL_DIR=${NEKRS_HOME} + +#... +cmake -S . -B ${BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DNEKRS_Fortran_FLAGS="-fuse-ld=bfd" -Wfatal-errors && \ +cmake --build ${BUILD_DIR} --parallel 8 && \ +cmake --install ${BUILD_DIR} + +#... +ln -fsn ${which_build} current From 3c2312b331f01461d19f8071fec4e93f45ac4ad6 Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Fri, 22 May 2026 04:28:23 +0000 Subject: [PATCH 08/12] Updated build scripts --- BuildMe.Aurora | 4 ++-- BuildMe.Frontier | 2 +- BuildMe.Polaris | 2 +- BuildMe.Sunspot | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BuildMe.Aurora b/BuildMe.Aurora index 21027f1edb..ba46cca2d8 100755 --- a/BuildMe.Aurora +++ b/BuildMe.Aurora @@ -1,7 +1,7 @@ #!/bin/bash set -e -a -: ${ONEAPI_SDK:="oneapi/release/2025.2.0"} +: ${ONEAPI_SDK:="oneapi/release/2025.3.1"} #... load the necessary modules here ... module reload @@ -23,7 +23,7 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ -export NEKRS_HOME=/lus/flare/projects/catalyst/world_shared/bramesh/codes/NekRS/argonne-cps/aurora/.local/nekrs +export NEKRS_HOME=/lus/flare/projects/catalyst/proj_shared/bramesh/RECHERCHE/codes/nekRS/argonne-cps/branches/aurora/.local/nekrs export INSTALL_DIR=${NEKRS_HOME} #... diff --git a/BuildMe.Frontier b/BuildMe.Frontier index eb44cce130..02f72d78c5 100755 --- a/BuildMe.Frontier +++ b/BuildMe.Frontier @@ -26,7 +26,7 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ -export NEKRS_HOME=/lustre/orion/proj-shared/cfd129/bramesh/RECHERCHE/codes/NekRS/argonne-cps/branches/aurora/.local/nekrs +export NEKRS_HOME=/lustre/orion/proj-shared/cfd129/bramesh/RECHERCHE/codes/nekRS/argonne-cps/branches/aurora/.local/nekrs export INSTALL_DIR=${NEKRS_HOME} #... diff --git a/BuildMe.Polaris b/BuildMe.Polaris index e82075dd0c..dc1988d2f0 100755 --- a/BuildMe.Polaris +++ b/BuildMe.Polaris @@ -25,7 +25,7 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ -export NEKRS_HOME=/lus/eagle/projects/catalyst/proj-shared/bramesh/Polaris/codes/NekRS/argonne-cps/branches/aurora/.local/nekrs +export NEKRS_HOME=/lus/eagle/projects/catalyst/proj-shared/bramesh/Polaris/codes/nekRS/argonne-cps/branches/aurora/.local/nekrs #... export INSTALL_DIR=${NEKRS_HOME} diff --git a/BuildMe.Sunspot b/BuildMe.Sunspot index f18209c56e..746cc276f8 100755 --- a/BuildMe.Sunspot +++ b/BuildMe.Sunspot @@ -23,7 +23,7 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ -export NEKRS_HOME=/lus/flare/projects/catalyst/world_shared/bramesh/codes/NekRS/argonne-cps/aurora/.local/nekrs +export NEKRS_HOME=/lus/flare/projects/catalyst/world_shared/bramesh/codes/nekRS/argonne-cps/branches/aurora/.local/nekrs export INSTALL_DIR=${NEKRS_HOME} #... From 80f394e483d9ac07c96f2a3525c7ad9ff660243a Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Fri, 22 May 2026 15:34:59 +0000 Subject: [PATCH 09/12] updated build scripts to set NEKRS_HOME automagically --- BuildMe.Aurora | 7 ++++++- BuildMe.Frontier | 7 ++++++- BuildMe.Polaris | 6 +++++- BuildMe.Sunspot | 7 ++++++- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/BuildMe.Aurora b/BuildMe.Aurora index ba46cca2d8..2ac9a9009f 100755 --- a/BuildMe.Aurora +++ b/BuildMe.Aurora @@ -23,7 +23,12 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ -export NEKRS_HOME=/lus/flare/projects/catalyst/proj_shared/bramesh/RECHERCHE/codes/nekRS/argonne-cps/branches/aurora/.local/nekrs +export NEKRS_SOURCE_DIR=${PWD} #.. this is where we are +export NEKRS_BRANCH_DIR=${OLDPWD} #.. this is where we were, one step above +export NEKRS_HOME=${NEKRS_BRANCH_DIR}/.local/nekrs #.. we install stuff in the .local directory, one step above + #.. from where we are now, i.e., one step above ${NEKRS_SOURCE_DIR} + #.. that is, .local is located in ${NEKRS_BRANCH_DIR} +#... export INSTALL_DIR=${NEKRS_HOME} #... diff --git a/BuildMe.Frontier b/BuildMe.Frontier index 02f72d78c5..42f3890b1c 100755 --- a/BuildMe.Frontier +++ b/BuildMe.Frontier @@ -26,7 +26,12 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ -export NEKRS_HOME=/lustre/orion/proj-shared/cfd129/bramesh/RECHERCHE/codes/nekRS/argonne-cps/branches/aurora/.local/nekrs +export NEKRS_SOURCE_DIR=${PWD} #.. this is where we are +export NEKRS_BRANCH_DIR=${OLDPWD} #.. this is where we were, one step above +export NEKRS_HOME=${NEKRS_BRANCH_DIR}/.local/nekrs #.. we install stuff in the .local directory, one step above + #.. from where we are now, i.e., one step above ${NEKRS_SOURCE_DIR} + #.. that is, .local is located in ${NEKRS_BRANCH_DIR} +#... export INSTALL_DIR=${NEKRS_HOME} #... diff --git a/BuildMe.Polaris b/BuildMe.Polaris index dc1988d2f0..0be1439610 100755 --- a/BuildMe.Polaris +++ b/BuildMe.Polaris @@ -25,7 +25,11 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ -export NEKRS_HOME=/lus/eagle/projects/catalyst/proj-shared/bramesh/Polaris/codes/nekRS/argonne-cps/branches/aurora/.local/nekrs +export NEKRS_SOURCE_DIR=${PWD} #.. this is where we are +export NEKRS_BRANCH_DIR=${OLDPWD} #.. this is where we were, one step above +export NEKRS_HOME=${NEKRS_BRANCH_DIR}/.local/nekrs #.. we install stuff in the .local directory, one step above + #.. from where we are now, i.e., one step above ${NEKRS_SOURCE_DIR} + #.. that is, .local is located in ${NEKRS_BRANCH_DIR} #... export INSTALL_DIR=${NEKRS_HOME} diff --git a/BuildMe.Sunspot b/BuildMe.Sunspot index 746cc276f8..3299da5cb0 100755 --- a/BuildMe.Sunspot +++ b/BuildMe.Sunspot @@ -23,7 +23,12 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ -export NEKRS_HOME=/lus/flare/projects/catalyst/world_shared/bramesh/codes/nekRS/argonne-cps/branches/aurora/.local/nekrs +export NEKRS_SOURCE_DIR=${PWD} #.. this is where we are +export NEKRS_BRANCH_DIR=${OLDPWD} #.. this is where we were, one step above +export NEKRS_HOME=${NEKRS_BRANCH_DIR}/.local/nekrs #.. we install stuff in the .local directory, one step above + #.. from where we are now, i.e., one step above ${NEKRS_SOURCE_DIR} + #.. that is, .local is located in ${NEKRS_BRANCH_DIR} +#... export INSTALL_DIR=${NEKRS_HOME} #... From 563be1451f9c945d704763243a338d16ce6c7ca4 Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Sun, 31 May 2026 03:02:59 +0000 Subject: [PATCH 10/12] Corrected Build.* build scripts --- BuildMe.Aurora | 9 ++++++--- BuildMe.Frontier | 5 ++++- BuildMe.Polaris | 5 ++++- BuildMe.Sunspot | 5 ++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/BuildMe.Aurora b/BuildMe.Aurora index 2ac9a9009f..2f087cbdf5 100755 --- a/BuildMe.Aurora +++ b/BuildMe.Aurora @@ -24,10 +24,13 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ export NEKRS_SOURCE_DIR=${PWD} #.. this is where we are -export NEKRS_BRANCH_DIR=${OLDPWD} #.. this is where we were, one step above -export NEKRS_HOME=${NEKRS_BRANCH_DIR}/.local/nekrs #.. we install stuff in the .local directory, one step above +echo ${NEKRS_SOURCE_DIR} +export NEKRS_BRANCH_DIR=${NEKRS_SOURCE_DIR%/*} #.. this is where we were, one step above +echo ${NEKRS_BRANCH_DIR} +export NEKRS_HOME=${NEKRS_BRANCH_DIR}/.local/nekrs #.. we install stuff in the .local directory, one step above #.. from where we are now, i.e., one step above ${NEKRS_SOURCE_DIR} - #.. that is, .local is located in ${NEKRS_BRANCH_DIR} + #.. that is, .local is located in ${NEKRS_BRANCH_DIR} +echo ${NEKRS_HOME} #... export INSTALL_DIR=${NEKRS_HOME} diff --git a/BuildMe.Frontier b/BuildMe.Frontier index 42f3890b1c..0f59bf3423 100755 --- a/BuildMe.Frontier +++ b/BuildMe.Frontier @@ -27,10 +27,13 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ export NEKRS_SOURCE_DIR=${PWD} #.. this is where we are -export NEKRS_BRANCH_DIR=${OLDPWD} #.. this is where we were, one step above +echo ${NEKRS_SOURCE_DIR} +export NEKRS_BRANCH_DIR=${NEKRS_SOURCE_DIR%/*} #.. this is where we were, one step above +echo ${NEKRS_BRANCH_DIR} export NEKRS_HOME=${NEKRS_BRANCH_DIR}/.local/nekrs #.. we install stuff in the .local directory, one step above #.. from where we are now, i.e., one step above ${NEKRS_SOURCE_DIR} #.. that is, .local is located in ${NEKRS_BRANCH_DIR} +echo ${NEKRS_HOME} #... export INSTALL_DIR=${NEKRS_HOME} diff --git a/BuildMe.Polaris b/BuildMe.Polaris index 0be1439610..cb1992061b 100755 --- a/BuildMe.Polaris +++ b/BuildMe.Polaris @@ -26,10 +26,13 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ export NEKRS_SOURCE_DIR=${PWD} #.. this is where we are -export NEKRS_BRANCH_DIR=${OLDPWD} #.. this is where we were, one step above +echo ${NEKRS_SOURCE_DIR} +export NEKRS_BRANCH_DIR=${NEKRS_SOURCE_DIR%/*} #.. this is where we were, one step above +echo ${NEKRS_BRANCH_DIR} export NEKRS_HOME=${NEKRS_BRANCH_DIR}/.local/nekrs #.. we install stuff in the .local directory, one step above #.. from where we are now, i.e., one step above ${NEKRS_SOURCE_DIR} #.. that is, .local is located in ${NEKRS_BRANCH_DIR} +echo ${NEKRS_HOME} #... export INSTALL_DIR=${NEKRS_HOME} diff --git a/BuildMe.Sunspot b/BuildMe.Sunspot index 3299da5cb0..2f087cbdf5 100755 --- a/BuildMe.Sunspot +++ b/BuildMe.Sunspot @@ -24,10 +24,13 @@ BUILD_DIR=${path_to_code}/${which_build} #.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. #.. ^^^^ export NEKRS_SOURCE_DIR=${PWD} #.. this is where we are -export NEKRS_BRANCH_DIR=${OLDPWD} #.. this is where we were, one step above +echo ${NEKRS_SOURCE_DIR} +export NEKRS_BRANCH_DIR=${NEKRS_SOURCE_DIR%/*} #.. this is where we were, one step above +echo ${NEKRS_BRANCH_DIR} export NEKRS_HOME=${NEKRS_BRANCH_DIR}/.local/nekrs #.. we install stuff in the .local directory, one step above #.. from where we are now, i.e., one step above ${NEKRS_SOURCE_DIR} #.. that is, .local is located in ${NEKRS_BRANCH_DIR} +echo ${NEKRS_HOME} #... export INSTALL_DIR=${NEKRS_HOME} From c4dc946cd5be96c97701daae143da86278e89160 Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Tue, 2 Jun 2026 20:59:56 +0000 Subject: [PATCH 11/12] Added BuildeMe.Crux --- BuildMe.Crux | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 BuildMe.Crux diff --git a/BuildMe.Crux b/BuildMe.Crux new file mode 100755 index 0000000000..e677ec98d9 --- /dev/null +++ b/BuildMe.Crux @@ -0,0 +1,42 @@ +#!/bin/bash +set -e -a + +#... load the necessary modules here ... +module restore +module use /soft/modulefiles +module load spack-pe-base/0.9.1 +module load cmake +module load PrgEnv-gnu +#... + +#... set some environment variables +export CC=cc +export CXX=CC +export FC=ftn + +#.. === +path_to_code=`pwd` +build_date=$(date '+%Y-%m-%d') +which_build=RBK_built.on.${build_date} +BUILD_DIR=${path_to_code}/${which_build} + +#.. NOTE: change the location of NEKRS_HOME to a directory that you have access to. +#.. ^^^^ +export NEKRS_SOURCE_DIR=${PWD} #.. this is where we are +echo ${NEKRS_SOURCE_DIR} +export NEKRS_BRANCH_DIR=${NEKRS_SOURCE_DIR%/*} #.. this is where we were, one step above +echo ${NEKRS_BRANCH_DIR} +export NEKRS_HOME=${NEKRS_BRANCH_DIR}/.local/nekrs #.. we install stuff in the .local directory, one step above + #.. from where we are now, i.e., one step above ${NEKRS_SOURCE_DIR} + #.. that is, .local is located in ${NEKRS_BRANCH_DIR} +echo ${NEKRS_HOME} +#... +export INSTALL_DIR=${NEKRS_HOME} + +#... +cmake -S . -B ${BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -Wfatal-errors && \ +cmake --build ${BUILD_DIR} --parallel 8 && \ +cmake --install ${BUILD_DIR} + +#... +ln -fsn ${which_build} current From 07f479235240f7f9ad598603641d8a4a557e9bca Mon Sep 17 00:00:00 2001 From: Ramesh Balakrishnan Date: Tue, 2 Jun 2026 22:46:25 -0400 Subject: [PATCH 12/12] Added modified BuildMe.Frontier --- BuildMe.Frontier | 1 + 1 file changed, 1 insertion(+) diff --git a/BuildMe.Frontier b/BuildMe.Frontier index 0f59bf3423..4f012fca7c 100755 --- a/BuildMe.Frontier +++ b/BuildMe.Frontier @@ -2,6 +2,7 @@ set -e -a #... load the necessary modules here ... +#... Building with the AMD compiler ... module reset module load PrgEnv-amd module load craype-accel-amd-gfx90a