From 97afb4b98277bfe7b48fbfbc4d1026ea8de4ee22 Mon Sep 17 00:00:00 2001 From: Guoqing Ge Date: Tue, 3 Sep 2024 09:41:33 -0600 Subject: [PATCH] streamline the module load process and the rrfs-test process (#141) Simplify the module load process and the rrfs-test step so that each can be done with one simple command. --- docs/build_and_test.md | 11 ++--------- ush/init.sh | 2 +- ush/load_eva.sh | 16 ++++++++++++++++ ush/load_rdas.sh | 16 ++++++++++++++++ ush/module-setup.sh | 7 +++++++ ush/run_rrfs_tests.sh | 17 +++++++++++++++++ 6 files changed, 59 insertions(+), 10 deletions(-) create mode 100755 ush/load_eva.sh create mode 100755 ush/load_rdas.sh create mode 100755 ush/run_rrfs_tests.sh diff --git a/docs/build_and_test.md b/docs/build_and_test.md index 897d1bc..3642fd2 100644 --- a/docs/build_and_test.md +++ b/docs/build_and_test.md @@ -11,13 +11,6 @@ Run `./build.sh -h` to learn more about command line options supported by build. ## 3. RRFS CTest ``` -module use modulefiles -module load RDAS/hera.intel -export SLURM_ACCOUNT=$account -cd build -ctest -VV -R rrfs_fv3jedi_hyb_2022052619 -ctest -VV -R rrfs_fv3jedi_letkf_2022052619 -ctest -VV -R rrfs_mpasjedi_2022052619_Ens3Dvar -ctest -VV -R rrfs_mpasjedi_2022052619_letkf + ush/run_rrfs_tests.sh $account ``` -Where `hera.intel` should be replaced with a correct platform-dependent module file, such as `jet.intel`, `orion.intel`, `hercules.intel` etc. And `$account` is the slurm resource account (e.g., `fv3-cam`, `da-cpu`, `wrfruc`, etc.). +Where `$account` is your valid slurm resource account (e.g., `fv3-cam`, `da-cpu`, `wrfruc`, `rtrr`, `nrtrr`, etc.). diff --git a/ush/init.sh b/ush/init.sh index 57a30f4..a28a3a1 100755 --- a/ush/init.sh +++ b/ush/init.sh @@ -12,7 +12,7 @@ case ${MACHINE_ID} in RDAS_DATA=/lfs5/BMC/nrtrr/RDAS_DATA ;; orion|hercules) - RDAS_DATA=/work/noaa/rtrr/RDAS_DATA + RDAS_DATA=/work/noaa/zrtrr/RDAS_DATA ;; *) echo "platform not supported: ${MACHINE_ID}" diff --git a/ush/load_eva.sh b/ush/load_eva.sh new file mode 100755 index 0000000..c6ec457 --- /dev/null +++ b/ush/load_eva.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check if the script is sourced +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + echo "Usage: source ${0}" + exit 1 +fi + +### scripts continues here... +ushdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +source ${ushdir}/detect_machine.sh + +module purge +module use ${ushdir}/../modulefiles +module load EVA/${MACHINE_ID} +module list diff --git a/ush/load_rdas.sh b/ush/load_rdas.sh new file mode 100755 index 0000000..d3d1b40 --- /dev/null +++ b/ush/load_rdas.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check if the script is sourced +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + echo "Usage: source ${0}" + exit 1 +fi + +### scripts continues here... +ushdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +source ${ushdir}/detect_machine.sh + +module purge +module use ${ushdir}/../modulefiles +module load RDAS/${MACHINE_ID}.intel +module list diff --git a/ush/module-setup.sh b/ush/module-setup.sh index 469fd4a..2b7dfb5 100755 --- a/ush/module-setup.sh +++ b/ush/module-setup.sh @@ -22,6 +22,13 @@ elif [[ $MACHINE_ID = orion* ]] ; then fi module purge +elif [[ $MACHINE_ID = hercules* ]] ; then + # We are on hercules + if ( ! eval module help > /dev/null 2>&1 ) ; then + source /apps/lmod/init/bash + fi + module purge + elif [[ $MACHINE_ID = s4* ]] ; then # We are on SSEC Wisconsin S4 if ( ! eval module help > /dev/null 2>&1 ) ; then diff --git a/ush/run_rrfs_tests.sh b/ush/run_rrfs_tests.sh new file mode 100755 index 0000000..7c7c920 --- /dev/null +++ b/ush/run_rrfs_tests.sh @@ -0,0 +1,17 @@ +#!/bin/sh +# +export SLURM_ACCOUNT=${1} + +if [[ "${1}" == "" ]]; then + echo "Usage: ${0} account_name" + exit 1 +fi + +# +ushdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +source ${ushdir}/load_rdas.sh + +set -x +cd ${ushdir}/../build/rrfs-test +pwd +ctest # or ctest -VV for verbose outputs