From 5aec057dd4e79868e35beeb38d05643fc388ab5f Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Wed, 9 Apr 2025 23:12:01 +0000 Subject: [PATCH 1/9] use_container_stack-stack-1.6.0 --- modulefiles/build.container.intel.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modulefiles/build.container.intel.lua b/modulefiles/build.container.intel.lua index 5d4beb308..6402b3634 100644 --- a/modulefiles/build.container.intel.lua +++ b/modulefiles/build.container.intel.lua @@ -2,24 +2,26 @@ help([[ Load environment to compile UFS_UTILS in a container using Intel ]]) -prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.8.0/envs/unified-env/install/modulefiles/Core") +prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.6.0/envs/unified-env/install/modulefiles/Core") stack_intel_ver=os.getenv("stack_intel_ver") or "2021.10.0" -load(pathJoin("stack-intel", stack_intel_ver)) +stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0" -stack_impi_ver=os.getenv("stack_impi_ver") or "2021.12.1" +load("gnu") +load(pathJoin("stack-intel", stack_intel_ver)) load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver)) +unload("gnu") -cmake_ver=os.getenv("cmake_ver") or "3.27.9" +cmake_ver=os.getenv("cmake_ver") or "3.23.1" load(pathJoin("cmake", cmake_ver)) bacio_ver=os.getenv("bacio_ver") or "2.4.1" load(pathJoin("bacio", bacio_ver)) -g2_ver=os.getenv("g2_ver") or "3.5.1" +g2_ver=os.getenv("g2_ver") or "3.4.5" load(pathJoin("g2", g2_ver)) -ip_ver=os.getenv("ip_ver") or "5.0.0" +ip_ver=os.getenv("ip_ver") or "4.3.0" load(pathJoin("ip", ip_ver)) nemsio_ver=os.getenv("nemsio_ver") or "2.5.4" @@ -46,10 +48,10 @@ load(pathJoin("netcdf-fortran", netcdf_fortran_ver)) nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1" load(pathJoin("nccmp", nccmp_ver)) -esmf_ver=os.getenv("esmf_ver") or "8.6.1" +esmf_ver=os.getenv("esmf_ver") or "8.6.0" load(pathJoin("esmf", esmf_ver)) -nco_ver=os.getenv("nco_ver") or "5.1.6" +nco_ver=os.getenv("nco_ver") or "5.0.6" load(pathJoin("nco", nco_ver)) whatis("Description: UFS_UTILS build environment") From 8b0cb9b7500ccc87109c8abc0d3600500eb7dbe1 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Thu, 10 Apr 2025 19:43:19 +0000 Subject: [PATCH 2/9] update g2 to 3.5.1 --- modulefiles/build.container.intel.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modulefiles/build.container.intel.lua b/modulefiles/build.container.intel.lua index 6402b3634..b5e35f8ec 100644 --- a/modulefiles/build.container.intel.lua +++ b/modulefiles/build.container.intel.lua @@ -18,7 +18,7 @@ load(pathJoin("cmake", cmake_ver)) bacio_ver=os.getenv("bacio_ver") or "2.4.1" load(pathJoin("bacio", bacio_ver)) -g2_ver=os.getenv("g2_ver") or "3.4.5" +g2_ver=os.getenv("g2_ver") or "3.5.1" load(pathJoin("g2", g2_ver)) ip_ver=os.getenv("ip_ver") or "4.3.0" From 41a3666c91c6dfb0268bbcee8789a322ed71f9ae Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Fri, 2 May 2025 14:41:48 +0000 Subject: [PATCH 3/9] prepare to put into container --- sorc/machine-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/machine-setup.sh b/sorc/machine-setup.sh index 1765b5922..ad9c33222 100644 --- a/sorc/machine-setup.sh +++ b/sorc/machine-setup.sh @@ -34,7 +34,7 @@ elif [[ -d /opt/spack-stack ]] ; then # We are using a container if ( ! eval module help > /dev/null 2>&1 ) ; then echo load the module command 1>&2 - source /apps/lmod/lmod/init/$__ms_shell + source /var/lmod/lmod/init/$__ms_shell fi target=container module purge From db4aaab8ed29eb172d53eb80af5527bbe7991a47 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Fri, 9 May 2025 15:54:33 +0000 Subject: [PATCH 4/9] container module-setup --- sorc/machine-setup.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sorc/machine-setup.sh b/sorc/machine-setup.sh index ad9c33222..846e406ba 100644 --- a/sorc/machine-setup.sh +++ b/sorc/machine-setup.sh @@ -32,10 +32,9 @@ elif [[ -d /lfs/h1 ]] ; then module reset elif [[ -d /opt/spack-stack ]] ; then # We are using a container - if ( ! eval module help > /dev/null 2>&1 ) ; then - echo load the module command 1>&2 - source /var/lmod/lmod/init/$__ms_shell - fi + # if ( ! eval module help > /dev/null 2>&1 ) ; then + source /usr/lmod/lmod/init/$__ms_shell + # fi target=container module purge elif [[ -d /scratch1 ]] ; then From 90d62c6a160b73b6321673b0054f95125f88956d Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Thu, 12 Jun 2025 20:44:07 +0000 Subject: [PATCH 5/9] also check if SINGULARITY_CONTAINER is set --- sorc/machine-setup.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sorc/machine-setup.sh b/sorc/machine-setup.sh index 846e406ba..907bac8f1 100644 --- a/sorc/machine-setup.sh +++ b/sorc/machine-setup.sh @@ -32,11 +32,14 @@ elif [[ -d /lfs/h1 ]] ; then module reset elif [[ -d /opt/spack-stack ]] ; then # We are using a container - # if ( ! eval module help > /dev/null 2>&1 ) ; then + if [[ -v SINGULARITY_CONTAINER ]]; then + # We are in a container source /usr/lmod/lmod/init/$__ms_shell - # fi - target=container - module purge + target=container + module purge + else + echo WARNING: UNKNOWN PLATFORM 1>&2; exit 99 + fi elif [[ -d /scratch1 ]] ; then # We are on NOAA Hera if ( ! eval module help > /dev/null 2>&1 ) ; then From e5de9bf742d1bd03120310d6555c6930529eb6dc Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Fri, 13 Jun 2025 04:24:57 +0000 Subject: [PATCH 6/9] use && to check /opt and SINGULAIRY_CCONTAINER for container --- sorc/machine-setup.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sorc/machine-setup.sh b/sorc/machine-setup.sh index 907bac8f1..f3296baa8 100644 --- a/sorc/machine-setup.sh +++ b/sorc/machine-setup.sh @@ -30,16 +30,11 @@ if [[ -d /lfs5 ]] ; then elif [[ -d /lfs/h1 ]] ; then target=wcoss2 module reset -elif [[ -d /opt/spack-stack ]] ; then - # We are using a container - if [[ -v SINGULARITY_CONTAINER ]]; then - # We are in a container - source /usr/lmod/lmod/init/$__ms_shell - target=container - module purge - else - echo WARNING: UNKNOWN PLATFORM 1>&2; exit 99 - fi +elif [[ -d /opt/spack-stack && -v SINGULARITY_CONTAINER ]]; then + # We are in a container + source /usr/lmod/lmod/init/$__ms_shell + target=container + module purge elif [[ -d /scratch1 ]] ; then # We are on NOAA Hera if ( ! eval module help > /dev/null 2>&1 ) ; then From e7641ebca61351e39c90608705a6e270565f33e7 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Wed, 23 Jul 2025 21:43:56 +0000 Subject: [PATCH 7/9] using contianer ss1.9.1 --- modulefiles/build.container.intel.lua | 74 ++++++++++----------------- 1 file changed, 27 insertions(+), 47 deletions(-) diff --git a/modulefiles/build.container.intel.lua b/modulefiles/build.container.intel.lua index b5e35f8ec..35de75938 100644 --- a/modulefiles/build.container.intel.lua +++ b/modulefiles/build.container.intel.lua @@ -2,56 +2,36 @@ help([[ Load environment to compile UFS_UTILS in a container using Intel ]]) -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") -stack_intel_ver=os.getenv("stack_intel_ver") or "2021.10.0" -stack_impi_ver=os.getenv("stack_impi_ver") or "2021.9.0" +stack_oneapi_ver=os.getenv("stack_oneapi_ver") or "2024.2.0" +stack_impi_ver=os.getenv("stack_impi_ver") or "2021.13" -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") -cmake_ver=os.getenv("cmake_ver") or "3.23.1" -load(pathJoin("cmake", cmake_ver)) - -bacio_ver=os.getenv("bacio_ver") or "2.4.1" -load(pathJoin("bacio", bacio_ver)) - -g2_ver=os.getenv("g2_ver") or "3.5.1" -load(pathJoin("g2", g2_ver)) - -ip_ver=os.getenv("ip_ver") or "4.3.0" -load(pathJoin("ip", ip_ver)) - -nemsio_ver=os.getenv("nemsio_ver") or "2.5.4" -load(pathJoin("nemsio", nemsio_ver)) - -sp_ver=os.getenv("sp_ver") or "2.5.0" -load(pathJoin("sp", sp_ver)) - -w3emc_ver=os.getenv("w3emc_ver") or "2.10.0" -load(pathJoin("w3emc", w3emc_ver)) - -sigio_ver=os.getenv("sigio_ver") or "2.3.2" -load(pathJoin("sigio", sigio_ver)) - -png_ver=os.getenv("png_ver") or "1.6.37" -load(pathJoin("libpng", png_ver)) - -netcdf_c_ver=os.getenv("netcdf_c_ver") or "4.9.2" -load(pathJoin("netcdf-c", netcdf_c_ver)) - -netcdf_fortran_ver=os.getenv("netcdf_fortran_ver") or "4.6.1" -load(pathJoin("netcdf-fortran", netcdf_fortran_ver)) - -nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1" -load(pathJoin("nccmp", nccmp_ver)) - -esmf_ver=os.getenv("esmf_ver") or "8.6.0" -load(pathJoin("esmf", esmf_ver)) - -nco_ver=os.getenv("nco_ver") or "5.0.6" -load(pathJoin("nco", nco_ver)) +local ufs_utils_modules = { + {["cmake"] = "3.27.9" }, + {["bacio"] = "2.4.1" }, + {["g2"] = "3.5.1" }, + {["ip"] = "5.1.0" }, + {["sp"] = "2.5.0" }, + {["w3emc"] = "2.10.0" }, + {["nemsio"] = "2.5.4" }, + {["sigio"] = "2.3.3" }, + {["libpng"] = "1.6.37" }, + {["netcdf-c"] = "4.9.2" }, + {["netcdf-fortran"] = "4.6.1" }, + {["nccmp"] = "1.9.0.1"}, + {["esmf"] = "8.8.0" }, + {["nco"] = "5.2.4" }, +} + +for i = 1, #ufs_utils_modules do + for name, default_version in pairs(ufs_utils_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: UFS_UTILS build environment") From ff46fb77ae1c386ecc7a141bebd10474b6a30a9b Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Wed, 20 Aug 2025 14:57:36 +0000 Subject: [PATCH 8/9] update to ss192 --- modulefiles/build.container.intel.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modulefiles/build.container.intel.lua b/modulefiles/build.container.intel.lua index 35de75938..dfe4c10fc 100644 --- a/modulefiles/build.container.intel.lua +++ b/modulefiles/build.container.intel.lua @@ -2,7 +2,7 @@ help([[ Load environment to compile UFS_UTILS in a container using Intel ]]) -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" From 2fc126569e82266e7e3de7de68d0efdf5f156f0d Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Thu, 4 Sep 2025 17:09:36 +0000 Subject: [PATCH 9/9] add container ref in README --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 1ac10c705..94f5ae830 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,37 @@ ReadTheDocs documentation files. The `cmake` directory contains CMake package find utilities, and utilities to run units tests on some supported HPC platforms. +## Compile ufs-utils with container on Ursa, and AWS +container SIFs can be found: +AWS: EPIC users: /contrib/containers/ubuntu22.04-intel-ufs-env-v1.9.2.img + NOAA users: /contrib-epic/containers/ubuntu22.04-intel-ufs-env-v1.9.2.img +Ursa: /scratch3/NCEPDEV/nems/role.epic/containers/ubuntu22.04-intel-ufs-env-v1.9.2.img + (or at dir: /scratch4/NAGAPE/epic/Wei.Huang/containers) + +To compile use container: +img=/path/to/ubuntu22.04-intel-ufs-env-v1.9.2.img + +on AWS: + singularity shell -e -B /contrib [-B /contrib-epic] $img + # now in singularity shell with prompt: Singularity> + cd /path/to/ufs-utils-source-code-dir + ./build_all.sh +on Ursa: + singularity shell -e -B /scratch3 -B /scrathc4 $img + # now in singularity shell with prompt: Singularity> + cd /path/to/ufs-utils-source-code-dir + ./build_all.sh + +At Singularity prompt, type "exit" to quit from singularity. + +On other machines, need to copy SIF ubuntu22.04-intel-ufs-env-v1.9.2.img to the machine, +if it is not available there. + +If run executables directly, just issue singularity command as above, +and then run the executable. There is no experience/experiments to run batch jobs yet (outside Global-Workflow), +please contact Wei.Huang@noaa.gov to discuss how to run batch jobs. + + ## References Gayno G., Beck J., Carson L., [Pre-Processing: