Skip to content

Commit

Permalink
matrix_pdlib: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewMasarik-NOAA committed Jan 31, 2024
1 parent 348874a commit 6e5f3d9
Showing 1 changed file with 60 additions and 26 deletions.
86 changes: 60 additions & 26 deletions regtests/matrix_pdlib
Original file line number Diff line number Diff line change
Expand Up @@ -28,55 +28,89 @@
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 <runtasks>'
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 <numProc> <gridID>'
echo 'usage: pdlib_start_run <nproc> <ww3shel>'
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 <mproc> <ww3shel> <nproc> <rst>'
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 <nproc> <mproc>'
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 ' **********************************************'
echo ' *** WAVEWATCH III matrix - PDLIB small mesh ***'
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 *'
Expand Down

0 comments on commit 6e5f3d9

Please sign in to comment.