From d3cd70ad68e4a3b1617037ba3cc17ccaa733eb3a Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Sun, 23 Oct 2022 03:48:33 -0500 Subject: [PATCH 1/4] Update to match gfs-util machine changes A recent update changed the name of the script that determines the machine to `detect_machine.sh`, so scripts that call that script had to be updated. The variable name holding the machine name has also changed (from `$target` to `$MACHINE_ID`) and it may now include a compiler at the end, so changes were necessary to account for that. The WW3 build is changed completely to use the UFS modules instead of maintaining separate modules in workflow that may use different module versions. Refs #1086 --- modulefiles/modulefile.ww3.hera.lua | 23 ----------------------- modulefiles/modulefile.ww3.orion.lua | 25 ------------------------- modulefiles/modulefile.ww3.s4.lua | 21 --------------------- modulefiles/modulefile.ww3.wcoss2.lua | 22 ---------------------- sorc/build_all.sh | 8 ++++---- sorc/build_gdas.sh | 10 ++++++---- sorc/build_ww3prepost.sh | 7 ++++--- 7 files changed, 14 insertions(+), 102 deletions(-) delete mode 100644 modulefiles/modulefile.ww3.hera.lua delete mode 100644 modulefiles/modulefile.ww3.orion.lua delete mode 100644 modulefiles/modulefile.ww3.s4.lua delete mode 100644 modulefiles/modulefile.ww3.wcoss2.lua diff --git a/modulefiles/modulefile.ww3.hera.lua b/modulefiles/modulefile.ww3.hera.lua deleted file mode 100644 index 9b1ab7492ed..00000000000 --- a/modulefiles/modulefile.ww3.hera.lua +++ /dev/null @@ -1,23 +0,0 @@ -help([[ -Build environment for WW3 on Hera -]]) - -prepend_path("MODULEPATH", "/scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/modulefiles/stack") - -load(pathJoin("hpc", "1.1.0")) -load(pathJoin("hpc-intel", "2022.1.2")) -load(pathJoin("hpc-impi", "2022.1.2")) - -load(pathJoin("cmake", "3.20.1")) - -load(pathJoin("jasper", "2.0.25")) -load(pathJoin("zlib", "1.2.11")) -load(pathJoin("libpng", "1.6.37")) - -load(pathJoin("bacio", "2.4.1")) -load(pathJoin("g2", "3.4.5")) - -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("w3emc", "2.9.2")) diff --git a/modulefiles/modulefile.ww3.orion.lua b/modulefiles/modulefile.ww3.orion.lua deleted file mode 100644 index de1da6b4f95..00000000000 --- a/modulefiles/modulefile.ww3.orion.lua +++ /dev/null @@ -1,25 +0,0 @@ -help([[ -Build environment for WW3 on Orion -]]) - -prepend_path("MODULEPATH", "/apps/contrib/NCEP/libs/hpc-stack/modulefiles/stack") - -load(pathJoin("hpc", "1.1.0")) -load(pathJoin("hpc-intel", "2022.1.2")) -load(pathJoin("hpc-impi", "2022.1.2")) - -load("contrib") -load("noaatools") -load(pathJoin("cmake", "3.22.1")) - -load(pathJoin("jasper", "2.0.25")) -load(pathJoin("zlib", "1.2.11")) -load(pathJoin("libpng", "1.6.37")) - -load(pathJoin("bacio", "2.4.1")) -load(pathJoin("g2", "3.4.5")) - -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("w3emc", "2.9.2")) diff --git a/modulefiles/modulefile.ww3.s4.lua b/modulefiles/modulefile.ww3.s4.lua deleted file mode 100644 index 0a8dcb25ff5..00000000000 --- a/modulefiles/modulefile.ww3.s4.lua +++ /dev/null @@ -1,21 +0,0 @@ -help([[ -Build environment for WW3 on S4 -]]) - -load("license_intel") -prepend_path("MODULEPATH", "/data/prod/hpc-stack/modulefiles/stack") -load(pathJoin("hpc", "1.1.0")) -load(pathJoin("hpc-intel", "18.0.4")) -load(pathJoin("hpc-impi", "18.0.4")) - -load(pathJoin("jasper", "2.0.25")) -load(pathJoin("zlib", "1.2.11")) -load(pathJoin("png", "1.6.35")) - -load(pathJoin("bacio", "2.4.1")) -load(pathJoin("g2", "3.4.1")) - -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("w3emc", "2.9.2")) diff --git a/modulefiles/modulefile.ww3.wcoss2.lua b/modulefiles/modulefile.ww3.wcoss2.lua deleted file mode 100644 index 3536428d31f..00000000000 --- a/modulefiles/modulefile.ww3.wcoss2.lua +++ /dev/null @@ -1,22 +0,0 @@ -help([[ -Build environment for WW3 on WCOSS2 -]]) - -load(pathJoin("PrgEnv-intel", "8.1.0")) -load(pathJoin("craype", "2.7.10")) -load(pathJoin("intel", "19.1.3.304")) -load(pathJoin("cray-mpich", "8.1.9")) - -load(pathJoin("cmake", "3.20.2")) - -load(pathJoin("jasper", "2.0.25")) -load(pathJoin("zlib", "1.2.11")) -load(pathJoin("libpng", "1.6.37")) - -load(pathJoin("bacio", "2.4.1")) -load(pathJoin("g2", "3.4.5")) - -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("w3emc", "2.9.2")) diff --git a/sorc/build_all.sh b/sorc/build_all.sh index 162c5ae427b..9e30865185a 100755 --- a/sorc/build_all.sh +++ b/sorc/build_all.sh @@ -73,11 +73,11 @@ fi #------------------------------------ # GET MACHINE #------------------------------------ -target="" +export COMPILER="intel" # shellcheck disable=SC1091 -source gfs_utils.fd/ush/machine-setup.sh > /dev/null 2>&1 +source gfs_utils.fd/ush/detect_machine.sh # shellcheck disable= -if [[ -z "${target}" ]]; then +if [[ -z "${MACHINE_ID}" ]]; then echo "FATAL: Unable to determine target machine" exit 1 fi @@ -88,7 +88,7 @@ fi # shellcheck source-path=sorc source ./partial_build.sh $_verbose_opt $_partial_opt -if [[ ${target} == "jet" ]]; then +if [[ ${MACHINE_ID} =~ "jet.*" ]]; then Build_gldas="false" Build_ww3_prepost="false" fi diff --git a/sorc/build_gdas.sh b/sorc/build_gdas.sh index c167c246f1c..aba96dd785a 100755 --- a/sorc/build_gdas.sh +++ b/sorc/build_gdas.sh @@ -5,14 +5,16 @@ script_dir=$(dirname "${BASH_SOURCE[0]}") cd "${script_dir}" || exit 1 # shellcheck disable=SC1091 -source gfs_utils.fd/ush/machine-setup.sh > /dev/null 2>&1 +source gfs_utils.fd/ush/detect_machine.sh # shellcheck disable= -export BUILD_TARGET="${target}" +# detect_machine now includes the compiler on some machines +# but the GDAS build script does not want it +MACHINE_ID=$(echo ${MACHINE_ID} | cut -d "." -f 1) # use more build jobs if on NOAA HPC build_jobs=4 -case "${target}" in +case "${MACHINE_ID}" in hera|orion) build_jobs=10 ;; @@ -24,7 +26,7 @@ if [ ! -d "../exec" ]; then fi cd gdas.cd -BUILD_JOBS="${build_jobs}" ./build.sh -t "${BUILD_TARGET}" +BUILD_JOBS="${build_jobs}" ./build.sh -t "${MACHINE_ID}" exit diff --git a/sorc/build_ww3prepost.sh b/sorc/build_ww3prepost.sh index c80ed108a7f..ca34853efad 100755 --- a/sorc/build_ww3prepost.sh +++ b/sorc/build_ww3prepost.sh @@ -4,8 +4,9 @@ set -x script_dir=$(dirname "${BASH_SOURCE[0]}") cd "${script_dir}" || exit 1 +export RT_COMPILER="intel" # shellcheck disable=SC1091 -source gfs_utils.fd/ush/machine-setup.sh > /dev/null 2>&1 +source ${script_dir}/ufs_model.fd/tests/detect_machine.sh # shellcheck disable= # Default settings @@ -44,8 +45,8 @@ finalexecdir=$( pwd -P )/../exec #Determine machine and load modules set +x -module use ../modulefiles -module load modulefile.ww3.${target} +module use ${script_dir}/ufs_model.fd/modulefiles +module load ufs_${MACHINE_ID} set -x #Set WW3 directory, switch, prep and post exes From b8fd464ca825b0e7f20bd4a5112cc5ea6608e39e Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Sun, 23 Oct 2022 03:54:08 -0500 Subject: [PATCH 2/4] Fix permissions on checkout.sh A recent merge inadvertently removed the execute permissions from `checkout.sh`. Refs #1086 --- sorc/checkout.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 sorc/checkout.sh diff --git a/sorc/checkout.sh b/sorc/checkout.sh old mode 100644 new mode 100755 From 72f461ba236ef7ecc26502b1a9b77f7e19a76f1c Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Sun, 23 Oct 2022 05:02:00 -0500 Subject: [PATCH 3/4] Fix regex in build all Special symbols in bash regex matching need to not be in quotes to work. --- sorc/build_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/build_all.sh b/sorc/build_all.sh index 9e30865185a..3acebb73474 100755 --- a/sorc/build_all.sh +++ b/sorc/build_all.sh @@ -88,7 +88,7 @@ fi # shellcheck source-path=sorc source ./partial_build.sh $_verbose_opt $_partial_opt -if [[ ${MACHINE_ID} =~ "jet.*" ]]; then +if [[ ${MACHINE_ID} =~ jet.* ]]; then Build_gldas="false" Build_ww3_prepost="false" fi From bf0765acbb468ee559fffe4cf2265ae668c21e8a Mon Sep 17 00:00:00 2001 From: "Walter.Kolczynski" Date: Sun, 23 Oct 2022 05:10:21 -0500 Subject: [PATCH 4/4] Make linter corrections --- sorc/build_gdas.sh | 2 +- sorc/build_ww3prepost.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sorc/build_gdas.sh b/sorc/build_gdas.sh index aba96dd785a..468516ff43a 100755 --- a/sorc/build_gdas.sh +++ b/sorc/build_gdas.sh @@ -10,7 +10,7 @@ source gfs_utils.fd/ush/detect_machine.sh # detect_machine now includes the compiler on some machines # but the GDAS build script does not want it -MACHINE_ID=$(echo ${MACHINE_ID} | cut -d "." -f 1) +MACHINE_ID=$(echo "${MACHINE_ID}" | cut -d "." -f 1) # use more build jobs if on NOAA HPC build_jobs=4 diff --git a/sorc/build_ww3prepost.sh b/sorc/build_ww3prepost.sh index ca34853efad..786eeaa7cbf 100755 --- a/sorc/build_ww3prepost.sh +++ b/sorc/build_ww3prepost.sh @@ -45,8 +45,8 @@ finalexecdir=$( pwd -P )/../exec #Determine machine and load modules set +x -module use ${script_dir}/ufs_model.fd/modulefiles -module load ufs_${MACHINE_ID} +module use "${script_dir}/ufs_model.fd/modulefiles" +module load "ufs_${MACHINE_ID}" set -x #Set WW3 directory, switch, prep and post exes