Skip to content

Commit

Permalink
streamline the module load process and the rrfs-test process (NOAA-EM…
Browse files Browse the repository at this point in the history
…C#141)

Simplify the module load process and the rrfs-test step so that each can
be done with one simple command.
  • Loading branch information
guoqing-noaa authored Sep 3, 2024
1 parent b220867 commit 97afb4b
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 10 deletions.
11 changes: 2 additions & 9 deletions docs/build_and_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.).
2 changes: 1 addition & 1 deletion ush/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
16 changes: 16 additions & 0 deletions ush/load_eva.sh
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions ush/load_rdas.sh
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions ush/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions ush/run_rrfs_tests.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 97afb4b

Please sign in to comment.