From d0c27d1cef8cf7feac5902ddd817e540ef9d864a Mon Sep 17 00:00:00 2001 From: henrywinterbottom-wxdev Date: Wed, 24 Jan 2024 09:15:54 -0700 Subject: [PATCH 1/4] Updated detect_machine.sh. --- ush/detect_machine.sh | 67 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 58 insertions(+), 9 deletions(-) diff --git a/ush/detect_machine.sh b/ush/detect_machine.sh index ecd1ad53..8a719c10 100755 --- a/ush/detect_machine.sh +++ b/ush/detect_machine.sh @@ -1,9 +1,21 @@ #!/bin/bash +# The authoritative copy of this script lives in the ufs-weather-model at: +# https://github.com/ufs-community/ufs-weather-model/blob/develop/tests/detect_machine.sh +# If any local modifications are made or new platform support added, +# please consider opening an issue and a PR to the ufs-weather-model +# so that this copy remains in sync with its authoritative source +# +# Thank you for your contribution + +# If the MACHINE_ID variable is set, skip this script. +[[ -n ${MACHINE_ID:-} ]] && return + +# First detect w/ hostname case $(hostname -f) in - adecflow0[12].acorn.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### acorn - alogin0[12].acorn.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### acorn + adecflow0[12].acorn.wcoss2.ncep.noaa.gov) MACHINE_ID=acorn ;; ### acorn + alogin0[12].acorn.wcoss2.ncep.noaa.gov) MACHINE_ID=acorn ;; ### acorn clogin0[1-9].cactus.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### cactus01-9 clogin10.cactus.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### cactus10 dlogin0[1-9].dogwood.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### dogwood01-9 @@ -14,7 +26,7 @@ case $(hostname -f) in gaea9.ncrc.gov) MACHINE_ID=gaea ;; ### gaea9 gaea1[0-6].ncrc.gov) MACHINE_ID=gaea ;; ### gaea10-16 - hfe0[1-9]) MACHINE_ID=hera ;; ### hera01-9 + hfe0[1-9]) MACHINE_ID=hera ;; ### hera01-09 hfe1[0-2]) MACHINE_ID=hera ;; ### hera10-12 hecflow01) MACHINE_ID=hera ;; ### heraecflow01 @@ -25,21 +37,58 @@ case $(hostname -f) in Orion-login-[1-4].HPC.MsState.Edu) MACHINE_ID=orion ;; ### orion1-4 - cheyenne[1-6].cheyenne.ucar.edu) MACHINE_ID=cheyenne ;; ### cheyenne1-6 - cheyenne[1-6].ib0.cheyenne.ucar.edu) MACHINE_ID=cheyenne ;; ### cheyenne1-6 - chadmin[1-6].ib0.cheyenne.ucar.edu) MACHINE_ID=cheyenne ;; ### cheyenne1-6 + [Hh]ercules-login-[1-4].[Hh][Pp][Cc].[Mm]s[Ss]tate.[Ee]du) MACHINE_ID=hercules ;; ### hercules1-4 login[1-4].stampede2.tacc.utexas.edu) MACHINE_ID=stampede ;; ### stampede1-4 login0[1-2].expanse.sdsc.edu) MACHINE_ID=expanse ;; ### expanse1-2 discover3[1-5].prv.cube) MACHINE_ID=discover ;; ### discover31-35 + *) MACHINE_ID=UNKNOWN ;; # Unknown platform esac +if [[ ${MACHINE_ID} == "UNKNOWN" ]]; then + case ${PW_CSP:-} in + "aws" | "google" | "azure") MACHINE_ID=noaacloud ;; + *) PW_CSP="UNKNOWN" + esac +fi + # Overwrite auto-detect with MACHINE if set MACHINE_ID=${MACHINE:-${MACHINE_ID}} -# Append compiler (only on machines that have multiple compilers) -if [ $MACHINE_ID = hera ] || [ $MACHINE_ID = cheyenne ]; then - MACHINE_ID=${MACHINE_ID}.${COMPILER} +# 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 /lfs/h3 ]]; then + # We are on NOAA Cactus or Dogwood + MACHINE_ID=wcoss2 +elif [[ -d /lfs/h1 && ! -d /lfs/h3 ]]; then + # We are on NOAA TDS Acorn + MACHINE_ID=acorn +elif [[ -d /mnt/lfs1 ]]; then + # We are on NOAA Jet + MACHINE_ID=jet +elif [[ -d /scratch1 ]]; then + # We are on NOAA Hera + MACHINE_ID=hera +elif [[ -d /work ]]; then + # We are on MSU Orion or Hercules + if [[ -d /apps/other ]]; then + # We are on Hercules + MACHINE_ID=hercules + else + MACHINE_ID=orion + fi +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 +else + echo WARNING: UNKNOWN PLATFORM 1>&2 fi From 6850afc57971cb88dd325c196a3185e39c7e3143 Mon Sep 17 00:00:00 2001 From: HenryWinterbottom-NOAA Date: Tue, 30 Jan 2024 19:30:16 +0000 Subject: [PATCH 2/4] Updates for module names. --- modulefiles/{jet-run.lua => jet.intel-run.lua} | 0 modulefiles/{jet.lua => jet.intel.lua} | 0 modulefiles/{orion-run.lua => orion.intel-run.lua} | 0 modulefiles/{orion.lua => orion.intel.lua} | 0 modulefiles/{s4-run.lua => s4.intel-run.lua} | 0 modulefiles/{s4.lua => s4.intel.lua} | 0 modulefiles/{wcoss2-run.lua => wcoss2.intel-run.lua} | 0 modulefiles/{wcoss2.lua => wcoss2.intel.lua} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename modulefiles/{jet-run.lua => jet.intel-run.lua} (100%) rename modulefiles/{jet.lua => jet.intel.lua} (100%) rename modulefiles/{orion-run.lua => orion.intel-run.lua} (100%) rename modulefiles/{orion.lua => orion.intel.lua} (100%) rename modulefiles/{s4-run.lua => s4.intel-run.lua} (100%) rename modulefiles/{s4.lua => s4.intel.lua} (100%) rename modulefiles/{wcoss2-run.lua => wcoss2.intel-run.lua} (100%) rename modulefiles/{wcoss2.lua => wcoss2.intel.lua} (100%) diff --git a/modulefiles/jet-run.lua b/modulefiles/jet.intel-run.lua similarity index 100% rename from modulefiles/jet-run.lua rename to modulefiles/jet.intel-run.lua diff --git a/modulefiles/jet.lua b/modulefiles/jet.intel.lua similarity index 100% rename from modulefiles/jet.lua rename to modulefiles/jet.intel.lua diff --git a/modulefiles/orion-run.lua b/modulefiles/orion.intel-run.lua similarity index 100% rename from modulefiles/orion-run.lua rename to modulefiles/orion.intel-run.lua diff --git a/modulefiles/orion.lua b/modulefiles/orion.intel.lua similarity index 100% rename from modulefiles/orion.lua rename to modulefiles/orion.intel.lua diff --git a/modulefiles/s4-run.lua b/modulefiles/s4.intel-run.lua similarity index 100% rename from modulefiles/s4-run.lua rename to modulefiles/s4.intel-run.lua diff --git a/modulefiles/s4.lua b/modulefiles/s4.intel.lua similarity index 100% rename from modulefiles/s4.lua rename to modulefiles/s4.intel.lua diff --git a/modulefiles/wcoss2-run.lua b/modulefiles/wcoss2.intel-run.lua similarity index 100% rename from modulefiles/wcoss2-run.lua rename to modulefiles/wcoss2.intel-run.lua diff --git a/modulefiles/wcoss2.lua b/modulefiles/wcoss2.intel.lua similarity index 100% rename from modulefiles/wcoss2.lua rename to modulefiles/wcoss2.intel.lua From 28a17742e59f509da4b51214dcdc7384d6338ca8 Mon Sep 17 00:00:00 2001 From: HenryWinterbottom-NOAA Date: Tue, 30 Jan 2024 19:33:11 +0000 Subject: [PATCH 3/4] Added compiler name to module identifier. --- ush/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/build.sh b/ush/build.sh index edfa0800..5357afc8 100755 --- a/ush/build.sh +++ b/ush/build.sh @@ -22,7 +22,7 @@ echo "MACHINE_ID = $MACHINE_ID" source $DIR_ROOT/ush/module-setup.sh module use $DIR_ROOT/modulefiles -module load $MACHINE_ID +module load $MACHINE_ID.$COMPILER module list # Collect BUILD Options From e43394c2e3d794ea099740461e6998061a3523b3 Mon Sep 17 00:00:00 2001 From: HenryWinterbottom-NOAA Date: Tue, 30 Jan 2024 19:33:32 +0000 Subject: [PATCH 4/4] Removed Gaea machines reaching EOL. --- ush/detect_machine.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ush/detect_machine.sh b/ush/detect_machine.sh index 8a719c10..683ee0db 100755 --- a/ush/detect_machine.sh +++ b/ush/detect_machine.sh @@ -21,10 +21,8 @@ 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 - gaea9) MACHINE_ID=gaea ;; ### gaea9 - gaea1[0-6]) MACHINE_ID=gaea ;; ### gaea10-16 - gaea9.ncrc.gov) MACHINE_ID=gaea ;; ### gaea9 - gaea1[0-6].ncrc.gov) MACHINE_ID=gaea ;; ### gaea10-16 + gaea5[1-8]) MACHINE_ID=gaea ;; ### gaea51-58 + gaea5[1-8].ncrc.gov) MACHINE_ID=gaea ;; ### gaea51-58 hfe0[1-9]) MACHINE_ID=hera ;; ### hera01-09 hfe1[0-2]) MACHINE_ID=hera ;; ### hera10-12