From a4ba44c4659bf12685398d46e0265564b2daedb6 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Wed, 9 Apr 2025 23:15:07 +0000 Subject: [PATCH 01/12] feature/use_container_stack-stack-1.6.0 --- modulefiles/container.lua | 33 +++++++++++++++++++++++++++++++++ tests/detect_machine.sh | 22 ++++++++++++++-------- 2 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 modulefiles/container.lua diff --git a/modulefiles/container.lua b/modulefiles/container.lua new file mode 100644 index 000000000..87fd6198e --- /dev/null +++ b/modulefiles/container.lua @@ -0,0 +1,33 @@ +help([[ +Load environment to build UPP on Container +]]) + +prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core") +prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.6.0/envs/fms-2024.01/install/modulefiles/Core") +--prepend_path("MODULEPATH", "/apps/modules/modulefiles") +prepend_path("MODULEPATH", "/root/modulefiles") + +local stack_intel_ver=os.getenv("stack_intel_ver") or "2021.10.0" +local stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0" + +load("gnu") +load(pathJoin("stack-intel", stack_intel_ver)) +load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) +unload("gnu") + +load("tbb/latest") +load("compiler-rt/latest") +load("oclfpga/latest") +load("compiler/latest") +load("mpi/latest") + +cmake_ver=os.getenv("cmake_ver") or "3.23.1" +load(pathJoin("cmake", cmake_ver)) + +load("upp_common") + +setenv("CC","mpiicc") +setenv("CXX","mpiicpc") +setenv("FC","mpiifort") + +whatis("Description: UPP build environment") diff --git a/tests/detect_machine.sh b/tests/detect_machine.sh index eb7237f82..e25ebaba6 100755 --- a/tests/detect_machine.sh +++ b/tests/detect_machine.sh @@ -21,11 +21,11 @@ case $(hostname -f) in dlogin0[1-9].dogwood.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### dogwood01-9 dlogin10.dogwood.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### dogwood10 - gaea5[1-8]) MACHINE_ID=gaea ;; ### gaea51-58 - gaea5[1-8].ncrc.gov) MACHINE_ID=gaea ;; ### gaea51-58 + gaea5[1-8]) MACHINE_ID=gaeac5 ;; ### gaea51-58 + gaea5[1-8].ncrc.gov) MACHINE_ID=gaeac5 ;; ### gaea51-58 - gaea6[1-8]) MACHINE_ID=gaea ;; ### gaea61-68 - gaea6[1-8].ncrc.gov) MACHINE_ID=gaea ;; ### gaea61-68 + gaea6[1-8]) MACHINE_ID=gaeac6 ;; ### gaea61-68 + gaea6[1-8].ncrc.gov) MACHINE_ID=gaeac6 ;; ### gaea61-68 hfe0[1-9]) MACHINE_ID=hera ;; ### hera01-09 hfe1[01]) MACHINE_ID=hera ;; ### hera10-11 @@ -66,7 +66,10 @@ if [[ "${MACHINE_ID}" != "UNKNOWN" ]]; then fi # Try searching based on paths since hostname may not match on compute nodes -if [[ -d /lfs/h3 ]]; then +if [[ -d /opt/spack-stack ]]; then + # We are in a container + MACHINE_ID=container +elif [[ -d /lfs/h3 ]]; then # We are on NOAA Cactus or Dogwood MACHINE_ID=wcoss2 elif [[ -d /lfs/h1 && ! -d /lfs/h3 ]]; then @@ -87,9 +90,12 @@ elif [[ -d /work ]]; then else MACHINE_ID=orion fi -elif [[ -d /gpfs && -d /ncrc ]]; then - # We are on GAEA. - MACHINE_ID=gaea +elif [[ -d /gpfs/f5 ]]; then + # We are on GAEA-C5. + MACHINE_ID=gaeac5 +elif [[ -d /gpfs/f6 ]]; then + # We are on GAEA-C6. + MACHINE_ID=gaeac6 elif [[ -d /data/prod ]]; then # We are on SSEC's S4 MACHINE_ID=s4 From 1f814979f531f0a0e8184ed44a1032325cba4554 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Wed, 9 Apr 2025 23:38:01 +0000 Subject: [PATCH 02/12] feature/use_container_stack-stack-1.6.0 --- modulefiles/upp_common.lua | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/modulefiles/upp_common.lua b/modulefiles/upp_common.lua index 2dd5269b7..3f1664176 100644 --- a/modulefiles/upp_common.lua +++ b/modulefiles/upp_common.lua @@ -3,21 +3,22 @@ whatis("Description: UPP build environment common libraries") help([[Load UFS Model common libraries]]) local ufs_modules = { - {["jasper"] = "2.0.32" }, - {["zlib-ng"] = "2.1.6" }, - {["libpng"] = "1.6.37" }, - {["hdf5"] = "1.14.3" }, - {["netcdf-c"] = "4.9.2" }, - {["netcdf-fortran"] = "4.6.1" }, - {["bacio"] = "2.4.1" }, + {["jasper"] = "2.0.32"}, + {["zlib"] = "1.2.13"}, + {["libpng"] = "1.6.37"}, + {["hdf5"] = "1.14.0"}, + {["netcdf-c"] = "4.9.2"}, + {["netcdf-fortran"] = "4.6.1"}, + {["bacio"] = "2.4.1"}, {["crtm"] = "2.4.0.1"}, - {["g2"] = "3.5.1" }, - {["g2tmpl"] = "1.13.0" }, - {["ip"] = "5.0.0" }, - {["w3emc"] = "2.10.0" }, - {["nemsio"] = "2.5.4" }, - {["sigio"] = "2.3.2" }, - {["wrf-io"] = "1.2.0" }, + {["g2"] = "3.5.1"}, + {["g2tmpl"] = "1.13.0"}, + {["ip"] = "4.3.0"}, + {["sp"] = "2.5.0"}, + {["w3emc"] = "2.10.0"}, + {["nemsio"] = "2.5.4"}, + {["sigio"] = "2.3.2"}, + {["wrf-io"] = "1.2.0"}, } for i = 1, #ufs_modules do From 4c9bdad97843b5b965c2227e72c915b5aea5e6ea Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Fri, 11 Apr 2025 15:41:12 +0000 Subject: [PATCH 03/12] compiled on hera --- modulefiles/container.lua | 22 +++++----------------- tests/compile_upp.sh | 3 +++ tests/detect_machine.sh | 11 +++++++---- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/modulefiles/container.lua b/modulefiles/container.lua index 87fd6198e..93e884d62 100644 --- a/modulefiles/container.lua +++ b/modulefiles/container.lua @@ -1,33 +1,21 @@ help([[ -Load environment to build UPP on Container +Build environment for UPP in container ]]) prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core") -prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.6.0/envs/fms-2024.01/install/modulefiles/Core") ---prepend_path("MODULEPATH", "/apps/modules/modulefiles") -prepend_path("MODULEPATH", "/root/modulefiles") +prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.6.0/envs/unified-env/install/modulefiles/intel-oneapi-mpi/2021.9.0/intel/2021.10.0") +prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.6.0/envs/unified-env/install/modulefiles/intel/2021.10.0") local stack_intel_ver=os.getenv("stack_intel_ver") or "2021.10.0" local stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0" +local cmake_ver=os.getenv("cmake_ver") or "3.23.1" load("gnu") load(pathJoin("stack-intel", stack_intel_ver)) load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) unload("gnu") -load("tbb/latest") -load("compiler-rt/latest") -load("oclfpga/latest") -load("compiler/latest") -load("mpi/latest") - -cmake_ver=os.getenv("cmake_ver") or "3.23.1" load(pathJoin("cmake", cmake_ver)) - load("upp_common") -setenv("CC","mpiicc") -setenv("CXX","mpiicpc") -setenv("FC","mpiifort") - -whatis("Description: UPP build environment") +whatis("Description: UPP environment in container with Intel Compilers") diff --git a/tests/compile_upp.sh b/tests/compile_upp.sh index 90d727973..3de2b2272 100755 --- a/tests/compile_upp.sh +++ b/tests/compile_upp.sh @@ -112,6 +112,9 @@ source ${PATHTR}/tests/detect_machine.sh if [[ $MACHINE_ID != "unknown" ]]; then if [ $MACHINE_ID == "wcoss2" -o $MACHINE_ID == "wcoss2_a" ]; then module reset + elif [ $MACHINE_ID == "container" ]; then + module purge + unset MODULEPATH elif [[ "$MACHINE_ID" =~ gaea* ]] ; then module reset # Unset the read-only variables $PELOCAL_PRGENV and $RCLOCAL_PRGENV diff --git a/tests/detect_machine.sh b/tests/detect_machine.sh index e25ebaba6..113429f7b 100755 --- a/tests/detect_machine.sh +++ b/tests/detect_machine.sh @@ -60,16 +60,19 @@ fi # Overwrite auto-detect with MACHINE if set MACHINE_ID=${MACHINE:-${MACHINE_ID}} +# Check if it is in container +if [[ -d /opt/spack-stack ]]; then + # We are in a container + MACHINE_ID=container +fi + # If MACHINE_ID is no longer UNKNNOWN, return it if [[ "${MACHINE_ID}" != "UNKNOWN" ]]; then return fi # Try searching based on paths since hostname may not match on compute nodes -if [[ -d /opt/spack-stack ]]; then - # We are in a container - MACHINE_ID=container -elif [[ -d /lfs/h3 ]]; then +if [[ -d /lfs/h3 ]]; then # We are on NOAA Cactus or Dogwood MACHINE_ID=wcoss2 elif [[ -d /lfs/h1 && ! -d /lfs/h3 ]]; then From 73e4d7a50b6c94d154cd6a0b851e0a254e7ed60d Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Wed, 7 May 2025 16:37:36 +0000 Subject: [PATCH 04/12] compiled on hera --- tests/compile_upp.sh | 1 + tests/detect_machine.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/compile_upp.sh b/tests/compile_upp.sh index 3de2b2272..18d2cb12d 100755 --- a/tests/compile_upp.sh +++ b/tests/compile_upp.sh @@ -113,6 +113,7 @@ if [[ $MACHINE_ID != "unknown" ]]; then if [ $MACHINE_ID == "wcoss2" -o $MACHINE_ID == "wcoss2_a" ]; then module reset elif [ $MACHINE_ID == "container" ]; then + source /usr/lmod/lmod/init/bash module purge unset MODULEPATH elif [[ "$MACHINE_ID" =~ gaea* ]] ; then diff --git a/tests/detect_machine.sh b/tests/detect_machine.sh index 113429f7b..4192dff7b 100755 --- a/tests/detect_machine.sh +++ b/tests/detect_machine.sh @@ -8,6 +8,12 @@ # # Thank you for your contribution +# Check if it is in container +if [[ -d /opt/spack-stack ]]; then + # We are in a container + MACHINE_ID=container +fi + # If the MACHINE_ID variable is set, skip this script. [[ -n ${MACHINE_ID:-} ]] && return @@ -60,12 +66,6 @@ fi # Overwrite auto-detect with MACHINE if set MACHINE_ID=${MACHINE:-${MACHINE_ID}} -# Check if it is in container -if [[ -d /opt/spack-stack ]]; then - # We are in a container - MACHINE_ID=container -fi - # If MACHINE_ID is no longer UNKNNOWN, return it if [[ "${MACHINE_ID}" != "UNKNOWN" ]]; then return From 2217400d63dd429b75b2cc0be5618123073da2d0 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Fri, 13 Jun 2025 01:24:22 +0000 Subject: [PATCH 05/12] remove extra module path, and check SINGULARITY_CONTAINER env. var --- modulefiles/container.lua | 2 -- tests/detect_machine.sh | 14 ++++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modulefiles/container.lua b/modulefiles/container.lua index 93e884d62..877bd1da6 100644 --- a/modulefiles/container.lua +++ b/modulefiles/container.lua @@ -3,8 +3,6 @@ Build environment for UPP in container ]]) prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core") -prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.6.0/envs/unified-env/install/modulefiles/intel-oneapi-mpi/2021.9.0/intel/2021.10.0") -prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.6.0/envs/unified-env/install/modulefiles/intel/2021.10.0") local stack_intel_ver=os.getenv("stack_intel_ver") or "2021.10.0" local stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0" diff --git a/tests/detect_machine.sh b/tests/detect_machine.sh index 4192dff7b..803d3d618 100755 --- a/tests/detect_machine.sh +++ b/tests/detect_machine.sh @@ -8,12 +8,6 @@ # # Thank you for your contribution -# Check if it is in container -if [[ -d /opt/spack-stack ]]; then - # We are in a container - MACHINE_ID=container -fi - # If the MACHINE_ID variable is set, skip this script. [[ -n ${MACHINE_ID:-} ]] && return @@ -102,6 +96,14 @@ elif [[ -d /gpfs/f6 ]]; then elif [[ -d /data/prod ]]; then # We are on SSEC's S4 MACHINE_ID=s4 + +elif [[ -d /opt/spack-stack ]]; then + if [[ -v SINGULARITY_CONTAINER ]]; then + # We are in a container + MACHINE_ID=container + else + echo WARNING: UNKNOWN PLATFORM 1>&2 + fi else echo WARNING: UNKNOWN PLATFORM 1>&2 fi From da50de02ccacfdaae8d5ea77fe3394e1d3afe3a8 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Fri, 13 Jun 2025 01:27:14 +0000 Subject: [PATCH 06/12] remove extra module path, and check SINGULARITY_CONTAINER env. var --- tests/compile_upp.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/compile_upp.sh b/tests/compile_upp.sh index 18d2cb12d..b9c37ef52 100755 --- a/tests/compile_upp.sh +++ b/tests/compile_upp.sh @@ -115,7 +115,6 @@ if [[ $MACHINE_ID != "unknown" ]]; then elif [ $MACHINE_ID == "container" ]; then source /usr/lmod/lmod/init/bash module purge - unset MODULEPATH elif [[ "$MACHINE_ID" =~ gaea* ]] ; then module reset # Unset the read-only variables $PELOCAL_PRGENV and $RCLOCAL_PRGENV From 27d877b5f377c8d7735c6f68efeb6023105374d7 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Fri, 13 Jun 2025 02:55:27 +0000 Subject: [PATCH 07/12] container use its own package version --- modulefiles/container.lua | 27 ++++++++++++++++++++++++++- modulefiles/upp_common.lua | 29 ++++++++++++++--------------- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/modulefiles/container.lua b/modulefiles/container.lua index 877bd1da6..969439dc2 100644 --- a/modulefiles/container.lua +++ b/modulefiles/container.lua @@ -14,6 +14,31 @@ load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) unload("gnu") load(pathJoin("cmake", cmake_ver)) -load("upp_common") +-- {["zlib-ng"] = "2.1.6" }, + +local ufs_modules = { + {["jasper"] = "2.0.32" }, + {["libpng"] = "1.6.37" }, + {["hdf5"] = "1.14.0" }, + {["netcdf-c"] = "4.9.2" }, + {["netcdf-fortran"] = "4.6.1" }, + {["bacio"] = "2.4.1" }, + {["crtm"] = "2.4.0.1"}, + {["g2"] = "3.5.1" }, + {["g2tmpl"] = "1.13.0" }, + {["ip"] = "4.3.0" }, + {["w3emc"] = "2.10.0" }, + {["nemsio"] = "2.5.4" }, + {["sigio"] = "2.3.2" }, + {["wrf-io"] = "1.2.0" }, +} + +for i = 1, #ufs_modules do + for name, default_version in pairs(ufs_modules[i]) do + local env_version_name = string.gsub(name, "-", "_") .. "_ver" + load(pathJoin(name, os.getenv(env_version_name) or default_version)) + end +end + whatis("Description: UPP environment in container with Intel Compilers") diff --git a/modulefiles/upp_common.lua b/modulefiles/upp_common.lua index 3f1664176..2dd5269b7 100644 --- a/modulefiles/upp_common.lua +++ b/modulefiles/upp_common.lua @@ -3,22 +3,21 @@ whatis("Description: UPP build environment common libraries") help([[Load UFS Model common libraries]]) local ufs_modules = { - {["jasper"] = "2.0.32"}, - {["zlib"] = "1.2.13"}, - {["libpng"] = "1.6.37"}, - {["hdf5"] = "1.14.0"}, - {["netcdf-c"] = "4.9.2"}, - {["netcdf-fortran"] = "4.6.1"}, - {["bacio"] = "2.4.1"}, + {["jasper"] = "2.0.32" }, + {["zlib-ng"] = "2.1.6" }, + {["libpng"] = "1.6.37" }, + {["hdf5"] = "1.14.3" }, + {["netcdf-c"] = "4.9.2" }, + {["netcdf-fortran"] = "4.6.1" }, + {["bacio"] = "2.4.1" }, {["crtm"] = "2.4.0.1"}, - {["g2"] = "3.5.1"}, - {["g2tmpl"] = "1.13.0"}, - {["ip"] = "4.3.0"}, - {["sp"] = "2.5.0"}, - {["w3emc"] = "2.10.0"}, - {["nemsio"] = "2.5.4"}, - {["sigio"] = "2.3.2"}, - {["wrf-io"] = "1.2.0"}, + {["g2"] = "3.5.1" }, + {["g2tmpl"] = "1.13.0" }, + {["ip"] = "5.0.0" }, + {["w3emc"] = "2.10.0" }, + {["nemsio"] = "2.5.4" }, + {["sigio"] = "2.3.2" }, + {["wrf-io"] = "1.2.0" }, } for i = 1, #ufs_modules do From df8fc5debaafdbac7813fb83fee85e662417037a Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Fri, 13 Jun 2025 03:25:10 +0000 Subject: [PATCH 08/12] check /opt/spack-stack, and SINGULARITY_CONTAINER to set MACHINE_ID container --- .../{container.lua => container_intel.lua} | 2 -- tests/detect_machine.sh | 20 +++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) rename modulefiles/{container.lua => container_intel.lua} (97%) diff --git a/modulefiles/container.lua b/modulefiles/container_intel.lua similarity index 97% rename from modulefiles/container.lua rename to modulefiles/container_intel.lua index 969439dc2..90cc5bd5b 100644 --- a/modulefiles/container.lua +++ b/modulefiles/container_intel.lua @@ -14,7 +14,6 @@ load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) unload("gnu") load(pathJoin("cmake", cmake_ver)) --- {["zlib-ng"] = "2.1.6" }, local ufs_modules = { {["jasper"] = "2.0.32" }, @@ -40,5 +39,4 @@ for i = 1, #ufs_modules do end end - whatis("Description: UPP environment in container with Intel Compilers") diff --git a/tests/detect_machine.sh b/tests/detect_machine.sh index 4e78dc711..822983e49 100755 --- a/tests/detect_machine.sh +++ b/tests/detect_machine.sh @@ -53,6 +53,14 @@ case $(hostname -f) in *) MACHINE_ID=UNKNOWN ;; # Unknown platform esac +# overwrite MACHINE_ID, if use container +if [[ -d /opt/spack-stack ]]; then + if [[ -v SINGULARITY_CONTAINER ]]; then + # We are in a container + MACHINE_ID=container + fi +fi + if [[ ${MACHINE_ID} == "UNKNOWN" ]]; then case ${PW_CSP:-} in "aws" | "google" | "azure") MACHINE_ID=noaacloud ;; @@ -99,14 +107,10 @@ elif [[ -d /gpfs/f6 ]]; then elif [[ -d /data/prod ]]; then # We are on SSEC's S4 MACHINE_ID=s4 - -elif [[ -d /opt/spack-stack ]]; then - if [[ -v SINGULARITY_CONTAINER ]]; then - # We are in a container - MACHINE_ID=container - else - echo WARNING: UNKNOWN PLATFORM 1>&2 - fi +elif [[ -d /opt/spack-stack && -v SINGULARITY_CONTAINER ]]; then + # We are in a container + MACHINE_ID=container else echo WARNING: UNKNOWN PLATFORM 1>&2 fi + From 516c4bc27bbc7c1409b0f498e39653432b5fdd94 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Fri, 20 Jun 2025 21:34:48 +0000 Subject: [PATCH 09/12] re-sync with UPP develop --- tests/detect_machine.sh | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/detect_machine.sh b/tests/detect_machine.sh index 822983e49..c267c7929 100755 --- a/tests/detect_machine.sh +++ b/tests/detect_machine.sh @@ -21,11 +21,11 @@ case $(hostname -f) in dlogin0[1-9].dogwood.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### dogwood01-9 dlogin10.dogwood.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### dogwood10 - gaea5[1-8]) MACHINE_ID=gaeac5 ;; ### gaea51-58 - gaea5[1-8].ncrc.gov) MACHINE_ID=gaeac5 ;; ### gaea51-58 + gaea5[1-8]) MACHINE_ID=gaea ;; ### gaea51-58 + gaea5[1-8].ncrc.gov) MACHINE_ID=gaea ;; ### gaea51-58 - gaea6[1-8]) MACHINE_ID=gaeac6 ;; ### gaea61-68 - gaea6[1-8].ncrc.gov) MACHINE_ID=gaeac6 ;; ### gaea61-68 + gaea6[1-8]) MACHINE_ID=gaea ;; ### gaea61-68 + gaea6[1-8].ncrc.gov) MACHINE_ID=gaea ;; ### gaea61-68 hfe0[1-9]) MACHINE_ID=hera ;; ### hera01-09 hfe1[01]) MACHINE_ID=hera ;; ### hera10-11 @@ -98,12 +98,9 @@ elif [[ -d /work ]]; then else MACHINE_ID=orion fi -elif [[ -d /gpfs/f5 ]]; then - # We are on GAEA-C5. - MACHINE_ID=gaeac5 -elif [[ -d /gpfs/f6 ]]; then - # We are on GAEA-C6. - MACHINE_ID=gaeac6 +elif [[ -d /gpfs && -d /ncrc ]]; then + # We are on GAEA. + MACHINE_ID=gaea elif [[ -d /data/prod ]]; then # We are on SSEC's S4 MACHINE_ID=s4 @@ -113,4 +110,3 @@ elif [[ -d /opt/spack-stack && -v SINGULARITY_CONTAINER ]]; then else echo WARNING: UNKNOWN PLATFORM 1>&2 fi - From 05bdd423f7fdcc884e780d76451227b224a844f6 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Wed, 23 Jul 2025 23:25:44 +0000 Subject: [PATCH 10/12] using container spack-stack 1.9.1 --- modulefiles/container_intel.lua | 38 ++++++--------------------------- modulefiles/noaacloud_intel.lua | 16 +++++--------- modulefiles/upp_common.lua | 7 ++++-- 3 files changed, 17 insertions(+), 44 deletions(-) diff --git a/modulefiles/container_intel.lua b/modulefiles/container_intel.lua index 90cc5bd5b..79acb0e38 100644 --- a/modulefiles/container_intel.lua +++ b/modulefiles/container_intel.lua @@ -2,41 +2,17 @@ help([[ Build environment for UPP in container ]]) -prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core") +prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.9.1/envs/unified-env/install/modulefiles/Core") -local stack_intel_ver=os.getenv("stack_intel_ver") or "2021.10.0" -local stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0" -local cmake_ver=os.getenv("cmake_ver") or "3.23.1" +stack_oneapi_ver=os.getenv("stack_oneapi_ver") or "2024.2.0" +stack_impi_ver=os.getenv("stack_impi_ver") or "2021.13" +cmake_ver=os.getenv("cmake_ver") or "3.27.9" -load("gnu") -load(pathJoin("stack-intel", stack_intel_ver)) +load(pathJoin("stack-oneapi", stack_oneapi_ver)) load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) -unload("gnu") - load(pathJoin("cmake", cmake_ver)) -local ufs_modules = { - {["jasper"] = "2.0.32" }, - {["libpng"] = "1.6.37" }, - {["hdf5"] = "1.14.0" }, - {["netcdf-c"] = "4.9.2" }, - {["netcdf-fortran"] = "4.6.1" }, - {["bacio"] = "2.4.1" }, - {["crtm"] = "2.4.0.1"}, - {["g2"] = "3.5.1" }, - {["g2tmpl"] = "1.13.0" }, - {["ip"] = "4.3.0" }, - {["w3emc"] = "2.10.0" }, - {["nemsio"] = "2.5.4" }, - {["sigio"] = "2.3.2" }, - {["wrf-io"] = "1.2.0" }, -} - -for i = 1, #ufs_modules do - for name, default_version in pairs(ufs_modules[i]) do - local env_version_name = string.gsub(name, "-", "_") .. "_ver" - load(pathJoin(name, os.getenv(env_version_name) or default_version)) - end -end +setenv("zlib_ng_ver", "unused") +load("upp_common") whatis("Description: UPP environment in container with Intel Compilers") diff --git a/modulefiles/noaacloud_intel.lua b/modulefiles/noaacloud_intel.lua index c372006d0..02b3cc507 100644 --- a/modulefiles/noaacloud_intel.lua +++ b/modulefiles/noaacloud_intel.lua @@ -2,24 +2,18 @@ help([[ Load environment to build UPP on NOAA Cloud ]]) -prepend_path("MODULEPATH", "/contrib/spack-stack-rocky8/spack-stack-1.9.1/envs/ue-oneapi-2024.2.1/install/modulefiles/Core") +prepend_path("MODULEPATH", "/contrib/spack-stack-rocky8/spack-stack-1.9.2/envs/ue-oneapi-2024.2.1/install/modulefiles/Core") prepend_path("MODULEPATH", "/apps/modules/modulefiles") -local gcc_ver=os.getenv("gcc_ver") or "13.2.0" -local stack_oneapi_ver=os.getenv("stack_oneapi_ver") or "2024.2.1" -local stack_impi_ver=os.getenv("stack_impi_ver") or "2021.13" +stack_oneapi_ver=os.getenv("stack_oneapi_ver") or "2024.2.1" +stack_impi_ver=os.getenv("stack_impi_ver") or "2021.13" +cmake_ver=os.getenv("cmake_ver") or "3.27.9" -load(pathJoin("gnu", gcc_ver)) load(pathJoin("stack-oneapi", stack_oneapi_ver)) load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) - -cmake_ver=os.getenv("cmake_ver") or "3.27.9" load(pathJoin("cmake", cmake_ver)) +setenv("zlib_ng_ver", "unused") load("upp_common") -setenv("CC","/apps/oneapi/mpi/latest/bin/mpiicc") -setenv("CXX","/apps/oneapi/mpi/latest/bin/mpiicpc") -setenv("FC","/apps/oneapi/mpi/latest/bin/mpiifort") - whatis("Description: UPP build environment") diff --git a/modulefiles/upp_common.lua b/modulefiles/upp_common.lua index ef0f30573..2637faf05 100644 --- a/modulefiles/upp_common.lua +++ b/modulefiles/upp_common.lua @@ -4,7 +4,7 @@ help([[Load UFS Model common libraries]]) local ufs_modules = { {["jasper"] = "2.0.32" }, - {["zlib"] = "1.2.13" }, + {["zlib-ng"] = "2.1.6" }, {["libpng"] = "1.6.37" }, {["hdf5"] = "1.14.3" }, {["netcdf-c"] = "4.9.2" }, @@ -23,6 +23,9 @@ local ufs_modules = { for i = 1, #ufs_modules do for name, default_version in pairs(ufs_modules[i]) do local env_version_name = string.gsub(name, "-", "_") .. "_ver" - load(pathJoin(name, os.getenv(env_version_name) or default_version)) + local env_version = os.getenv(env_version_name) + if env_version ~= "unused" then + load(pathJoin(name, env_version or default_version)) + end end end From 02d4adc9ecc9615aa4d9ce097d98276eacad16eb Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Wed, 20 Aug 2025 14:39:36 +0000 Subject: [PATCH 11/12] update to ss192 --- modulefiles/container_intel.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modulefiles/container_intel.lua b/modulefiles/container_intel.lua index 79acb0e38..87e4fc90a 100644 --- a/modulefiles/container_intel.lua +++ b/modulefiles/container_intel.lua @@ -2,7 +2,7 @@ help([[ Build environment for UPP in container ]]) -prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.9.1/envs/unified-env/install/modulefiles/Core") +prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.9.2/envs/unified-env/install/modulefiles/Core") stack_oneapi_ver=os.getenv("stack_oneapi_ver") or "2024.2.0" stack_impi_ver=os.getenv("stack_impi_ver") or "2021.13" @@ -15,4 +15,13 @@ load(pathJoin("cmake", cmake_ver)) setenv("zlib_ng_ver", "unused") load("upp_common") +setenv("CC", "mpiicx") +setenv("CXX", "mpiicpx") +setenv("FC", "mpiifort") +setenv("I_MPI_CC", "icx") +setenv("I_MPI_CXX", "icpx") +setenv("I_MPI_FC", "ifort") +setenv("I_MPI_F77", "ifort") +setenv("I_MPI_F90", "ifort") + whatis("Description: UPP environment in container with Intel Compilers") From 3e178f84ce88c051105f52ae0b79bac40d85a8ac Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Thu, 21 Aug 2025 13:55:29 +0000 Subject: [PATCH 12/12] sync with emc repo, and cleanup --- modulefiles/container_intel.lua | 1 - modulefiles/noaacloud_intel.lua | 14 ++++++++++---- modulefiles/upp_common.lua | 7 ++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/modulefiles/container_intel.lua b/modulefiles/container_intel.lua index 87e4fc90a..fca6c26ef 100644 --- a/modulefiles/container_intel.lua +++ b/modulefiles/container_intel.lua @@ -12,7 +12,6 @@ load(pathJoin("stack-oneapi", stack_oneapi_ver)) load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) load(pathJoin("cmake", cmake_ver)) -setenv("zlib_ng_ver", "unused") load("upp_common") setenv("CC", "mpiicx") diff --git a/modulefiles/noaacloud_intel.lua b/modulefiles/noaacloud_intel.lua index 02b3cc507..fe93c05c1 100644 --- a/modulefiles/noaacloud_intel.lua +++ b/modulefiles/noaacloud_intel.lua @@ -5,15 +5,21 @@ Load environment to build UPP on NOAA Cloud prepend_path("MODULEPATH", "/contrib/spack-stack-rocky8/spack-stack-1.9.2/envs/ue-oneapi-2024.2.1/install/modulefiles/Core") prepend_path("MODULEPATH", "/apps/modules/modulefiles") -stack_oneapi_ver=os.getenv("stack_oneapi_ver") or "2024.2.1" -stack_impi_ver=os.getenv("stack_impi_ver") or "2021.13" -cmake_ver=os.getenv("cmake_ver") or "3.27.9" +local gcc_ver=os.getenv("gcc_ver") or "13.2.0" +local stack_oneapi_ver=os.getenv("stack_oneapi_ver") or "2024.2.1" +local stack_impi_ver=os.getenv("stack_impi_ver") or "2021.13" +load(pathJoin("gnu", gcc_ver)) load(pathJoin("stack-oneapi", stack_oneapi_ver)) load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) + +cmake_ver=os.getenv("cmake_ver") or "3.27.9" load(pathJoin("cmake", cmake_ver)) -setenv("zlib_ng_ver", "unused") load("upp_common") +setenv("CC","/apps/oneapi/mpi/latest/bin/mpiicc") +setenv("CXX","/apps/oneapi/mpi/latest/bin/mpiicpc") +setenv("FC","/apps/oneapi/mpi/latest/bin/mpiifort") + whatis("Description: UPP build environment") diff --git a/modulefiles/upp_common.lua b/modulefiles/upp_common.lua index 2637faf05..ef0f30573 100644 --- a/modulefiles/upp_common.lua +++ b/modulefiles/upp_common.lua @@ -4,7 +4,7 @@ help([[Load UFS Model common libraries]]) local ufs_modules = { {["jasper"] = "2.0.32" }, - {["zlib-ng"] = "2.1.6" }, + {["zlib"] = "1.2.13" }, {["libpng"] = "1.6.37" }, {["hdf5"] = "1.14.3" }, {["netcdf-c"] = "4.9.2" }, @@ -23,9 +23,6 @@ local ufs_modules = { for i = 1, #ufs_modules do for name, default_version in pairs(ufs_modules[i]) do local env_version_name = string.gsub(name, "-", "_") .. "_ver" - local env_version = os.getenv(env_version_name) - if env_version ~= "unused" then - load(pathJoin(name, env_version or default_version)) - end + load(pathJoin(name, os.getenv(env_version_name) or default_version)) end end