Skip to content

Commit

Permalink
run_unstr: add job card with two differing MPI runs, no warm start/re…
Browse files Browse the repository at this point in the history
…start, though
  • Loading branch information
MatthewMasarik-NOAA committed Apr 16, 2024
1 parent 6539d8c commit 5fa2dd8
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions regtests/run_unstr
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/bin/bash

#SBATCH -n 40
#SBATCH -q batch
#SBATCH -t 01:00:00
#SBATCH -A marine-cpu
#SBATCH -J w3_pdlib
#SBATCH -o w3_pdlib.out
#SBATCH --exclusive


nProc=40 # nProc: highest MPI count should match, SBATCH -n <proc>, above
mProc=20 # mProc: lowest MPI count should be less than nProc

iostyp='1' # WW3 IOSTYP = [0, 1]


REGDIR=$SLURM_SUBMIT_DIR
module purge
module use /scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/unified-env-rocky8/install/modulefiles/Core
module load stack-intel/2021.5.0
module load stack-intel-oneapi-mpi/2021.5.1
module load cmake/3.23.1
module load libpng/1.6.37
module load zlib/1.2.13
module load jasper/2.0.32
module load hdf5/1.14.0
module load netcdf-c/4.9.2
module load netcdf-fortran/4.6.1
module load bacio/2.4.1
module load g2/3.4.5
module load w3emc/2.10.0
module load esmf/8.5.0
module load scotch/7.0.4
export METIS_PATH=/scratch1/NCEPDEV/climate/Matthew.Masarik/waves/opt/hera/intel/spack-stack/1.6.0/parmetis-4.0.3/install


# runs ww3_ufs1.1/unstr_rstrt(grid b) w ascii flag. grid b := block-explicit shceme
function run_pdlib_ascii() {
if [ $# -ne 1 ]; then echo 'usage: run_pdlib_ascii <numProc>'; return; fi
local numProc=$1
./bin/run_cmake_test -b slurm -o all -S -T -s PDLIB_ASCII -i input_unstr_rstrt -w work_IOSTYP_${iostyp}_$numProc -g b -f -p srun -n $numProc ../model ww3_ufs1.1
return
}


cd $REGDIR

echo ' '
echo ' **********************************************'
echo ' *** WAVEWATCH III - PDLIB ***'
echo ' **********************************************'
echo ' '
export path_build_root=$REGDIR/build
[[ -d ${path_build_root} ]] && rm -rf ${path_build_root}


# N PROC - cold start
# -------------------
echo -e "\nnProc: $nProc"
cp -v ww3_ufs1.1/input_unstr_rstrt/ww3_shel.inp.start.IOSTYP_${iostyp} ww3_ufs1.1/input_unstr_rstrt/ww3_shel.inp
run_pdlib_ascii $nProc

# M PROC - cold start
# -------------------
echo -e "\nmProc: $mProc"
cp -v ww3_ufs1.1/input_unstr_rstrt/ww3_shel.inp.start.IOSTYP_${iostyp} ww3_ufs1.1/input_unstr_rstrt/ww3_shel.inp
run_pdlib_ascii $mProc

# compare NPROC v. MPROC - test.comp
# ----------------------------------
./bin/test.comp ww3_ufs1.1 work_IOSTYP_${iostyp}_${nProc} work_IOSTYP_${iostyp}_${mProc}

# check restart sizes (KB)
du -k ww3_ufs1.1/work_IOSTYP_${iostyp}_${nProc}/*restart.ww3
du -k ww3_ufs1.1/work_IOSTYP_${iostyp}_${mProc}/*restart.ww3


echo -e "\ndone running."
[[ -d ${path_build_root} ]] && rm -rf ${path_build_root}*
echo ' '
echo ' **************************************************************'
echo ' * end of WAVEWATCH III - PDLIB regtest *'
echo ' **************************************************************'
echo ' '
exit 0

0 comments on commit 5fa2dd8

Please sign in to comment.