diff --git a/regtests/matrix_pdlib b/regtests/matrix_pdlib index 4e2381266..542ab1696 100644 --- a/regtests/matrix_pdlib +++ b/regtests/matrix_pdlib @@ -28,20 +28,56 @@ module load esmf/8.4.2 module load scotch/7.0.4 - # Funcs function run_pdlib_ascii() { + if [ $# -ne 1 ]; then + echo 'usage: run_pdlib_ascii ' + return + fi + local runtasks=$1 + ./bin/run_cmake_test -b slurm -o all -S -T -s MPI -s PDLIB_ASCII -w work_${runtasks} -g pdlib -f -p srun -n ${runtasks} ../model ww3_repro + return + } + + function pdlib_start_run() { if [ $# -ne 2 ]; then - echo 'usage: run_pdlib_ascii ' + echo 'usage: pdlib_start_run ' + return + fi + local nproc=$1 + local ww3shel="$2" + cp -v ww3_repro/input/$ww3shel ww3_repro/input/ww3_shel.inp + run_pdlib_ascii $nproc + return + } + + function pdlib_restart_run() { + if [ $# -ne 4 ]; then + echo 'usage: pdlib_restart_mproc ' return fi - local numProc=$1 - local gridID=$2 - ./bin/run_cmake_test -b slurm -o all -S -T -s MPI -s PDLIB_ASCII -w work_${numProc} -g ${gridID} -f -p srun -n ${numProc} ../model ww3_repro + local mproc=$1 + local ww3shel="$2" + local nproc=$3 + local rst="$4" + mkdir -p ww3_repro/work_${mproc} + cp -v ww3_repro/work_${nproc}/${rst} ww3_repro/work_${mproc}/restart.ww3 + pdlib_start_run $mproc $ww3shel + return + } + + function run_comp() { + if [ $# -ne 2 ]; then + echo 'usage: run_comp ' + return + fi + local nproc=$1 + local mproc=$2 + ./bin/test.comp ww3_repro work_${nproc} work_${mproc} return } ### - export path_build_root=/scratch1/NCEPDEV/climate/Matthew.Masarik/projs/reproduce_mpi/regtest_ww3_ufs1.1-unstr/mem_runs/ww3-small-mesh/regtests/build_small_mesh + export path_build_root=${REGDIR}/build_small_mesh [[ -d ${path_build_root} ]] && rm -rf ${path_build_root} echo ' ' echo ' **********************************************' @@ -49,34 +85,32 @@ echo ' **********************************************' echo ' ' - # Grid: pdlib - grid='pdlib' - rst_dt='20100801.030000' - rst_03=${rst_dt}.restart.ww3 + # Grid: pdlib, block-explicit + # Rst: 03z + rst_03=20100801.030000.restart.ww3 + cd $REGDIR - # N PROC - # ------ - echo -e "\nnproc: $nproc" - cp -v ww3_repro/input/ww3_shel.inp.start ww3_repro/input/ww3_shel.inp - run_pdlib_ascii $nproc $grid + # START RUN: N PROC + # ----------------- + echo -e "\nstart: nproc=$nproc" + pdlib_start_run $nproc ww3_shel.inp.start + + # RESTART RUN: M PROC + # ------------------- + echo -e "\nrestart: mproc=$mproc" + pdlib_restart_run $mproc ww3_shel.inp.restart + + # COMP RUNS: NPROC v. MPROC + # ------------------------- + run_comp $nproc $mproc - # M PROC - # ------ - echo -e "\nmproc: $mproc" - mkdir -p ww3_repro/work_${mproc} - cp -v ww3_repro/work_${nproc}/${rst_03} ww3_repro/work_${mproc}/restart.ww3 - cp -v ww3_repro/input/ww3_shel.inp.restart ww3_repro/input/ww3_shel.inp - run_pdlib_ascii $mproc $grid - # compare NPROC v. MPROC - # ---------------------- - ./bin/test.comp ww3_repro work_${nproc} work_${mproc} [[ -d ${path_build_root} ]] && rm -rf ${path_build_root}* - echo "done running." + echo -e "\ndone running.\n" echo ' ' echo ' **************************************************************' echo ' * end WAVEWATCH III - PDLIB small mesh *'