Skip to content

Commit

Permalink
matrix_pdlib: added
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewMasarik-NOAA committed Oct 12, 2023
1 parent b30f472 commit dc4bc5f
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions regtests/matrix_pdlib
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#!/bin/sh

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


REGDIR=/scratch1/NCEPDEV/climate/Matthew.Masarik/projs/reproduce_mpi/regtest_ww3_ufs1.1-unstr/runs/ww3-blk-exp-02/regtests

module purge
module load cmake/3.20.1
module load intel/2022.1.2
module load impi/2022.1.2
module use /scratch1/NCEPDEV/nems/role.epic/hpc-stack/libs/intel-2022.1.2/modulefiles/stack
module load hpc/1.2.0
module load hpc-intel/2022.1.2
module load hpc-impi/2022.1.2
module load libpng/1.6.37
module load zlib/1.2.11
module load jasper/2.0.25
module load hdf5/1.10.6
module load netcdf/4.7.4
module load bacio/2.4.1
module load g2/3.4.5
module load w3emc/2.9.2
module load esmf/8.3.0b09
export METIS_PATH=/scratch1/NCEPDEV/climate/Matthew.Masarik/waves/opt/hpc-stack/parmetis-4.0.3/install
export SCOTCH_PATH=/scratch1/NCEPDEV/climate/Matthew.Masarik/waves/opt/hpc-stack/scotch-v7.0.3/install
export path_build_root=$REGDIR/build

function run_pdlib() {
if [ $# -ne 3 ]; then
echo 'usage: run_pdlib <nprocs> <worktag> <grid>'
return
fi
local nprocs=$1
local worktag=$2
local grid=$3
./bin/run_cmake_test -b slurm -o all -S -T -s MPI -s PDLIB -i input_unstr -w work_${grid}_${nprocs}_${worktag} -g $grid -f -p srun -n $nprocs ../model ww3_ufs1.1
return
}

function cmp_pdlib() {
if [ $# -ne 2 ]; then
echo 'usage: cmp_pdlib <wrkdir1> <wrkdir2>'
return
fi
local wrkdir1=$1
local wrkdir2=$2
./bin/test.comp ww3_ufs1.1 work_${wrkdir1} work_${wrkdir2}
return
}


echo ' '
echo ' **********************************************'
echo ' *** WAVEWATCH III - PDLIB ***'
echo ' **********************************************'
echo ' '

cd $REGDIR
[[ -d ${path_build_root} ]] && rm -rf ${path_build_root}

# A-RUN1: 39 vs. 40
GRD="a"
TAG="run1"
NP0=39
NP1=40
run_pdlib ${NP0} ${TAG} $GRD
run_pdlib ${NP1} ${TAG} $GRD
cmp_pdlib ${GRD}_${NP0}_${TAG} ${GRD}_${NP1}_${TAG}
du -hs $REGDIR/ww3_ufs1.1/work_${GRD}_${NP0}_${TAG}/*
du -hs $REGDIR/ww3_ufs1.1/work_${GRD}_${NP1}_${TAG}/*


# B-RUN1: 39 vs. 40
GRD="b"
TAG="run1"
NP0=39
NP1=40
run_pdlib ${NP0} ${TAG} $GRD
run_pdlib ${NP1} ${TAG} $GRD
cmp_pdlib ${GRD}_${NP0}_${TAG} ${GRD}_${NP1}_${TAG}
du -hs $REGDIR/ww3_ufs1.1/work_${GRD}_${NP0}_${TAG}/*
du -hs $REGDIR/ww3_ufs1.1/work_${GRD}_${NP1}_${TAG}/*

# C-RUN1: 39 vs. 40
GRD="c"
TAG="run1"
NP0=39
NP1=40
run_pdlib ${NP0} ${TAG} $GRD
run_pdlib ${NP1} ${TAG} $GRD
cmp_pdlib ${GRD}_${NP0}_${TAG} ${GRD}_${NP1}_${TAG}
du -hs $REGDIR/ww3_ufs1.1/work_${GRD}_${NP0}_${TAG}/*
du -hs $REGDIR/ww3_ufs1.1/work_${GRD}_${NP1}_${TAG}/*


echo "done running."

[[ -d ${path_build_root} ]] && rm -rf ${path_build_root}*
echo ' '
echo ' **************************************************************'
echo ' * end of WAVEWATCH III - PDLIB regtest *'
echo ' **************************************************************'
echo ' '

0 comments on commit dc4bc5f

Please sign in to comment.