Skip to content

Commit

Permalink
Branch slurm_regtests: timing option -T added to run_test, option to …
Browse files Browse the repository at this point in the history
…run batch queue [slurm] -b added to run_test, created new matrix_ncep with slurm directives for R&D testing, corrected bug in matrix.base ww3_ts4 [mpi run were missing -p -n flags.
  • Loading branch information
ajhenrique committed Jun 19, 2019
1 parent a939155 commit 972106c
Show file tree
Hide file tree
Showing 4 changed files with 1,638 additions and 1,064 deletions.
6 changes: 3 additions & 3 deletions regtests/bin/matrix.base
Original file line number Diff line number Diff line change
Expand Up @@ -1965,9 +1965,9 @@
echo ' ' >> matrix.body
if [ "$dist" = 'y' ]
then
echo "$rtst -s MPI -w work_rg_shel_MPI -i input_rg_shel $ww3 ww3_ts4" >> matrix.body
echo "$rtst -s MPI -w work_rg_multi_MPI -i input_rg_multi -m grdset $ww3 ww3_ts4" >> matrix.body
echo "$rtst -s MPI -w work_ug_MPI -i input_ug $ww3 ww3_ts4" >> matrix.body
echo "$rtst -s MPI -w work_rg_shel_MPI -i input_rg_shel -f -p $mpi -n $np $ww3 ww3_ts4" >> matrix.body
echo "$rtst -s MPI -w work_rg_multi_MPI -i input_rg_multi -m grdset -f -p $mpi -n $np $ww3 ww3_ts4" >> matrix.body
echo "$rtst -s MPI -w work_ug_MPI -i input_ug -f -p $mpi -n $np $ww3 ww3_ts4" >> matrix.body
else
echo "$rtst -w work_rg_shel -i input_rg_shel $ww3 ww3_ts4" >> matrix.body
echo "$rtst -w work_rg_multi -i input_rg_multi -m grdset $ww3 ww3_ts4" >> matrix.body
Expand Down
30 changes: 18 additions & 12 deletions regtests/bin/matrix.comp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,21 @@
# 1. Set up
# 1.a Computer/ user dependent set up

if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ]
then
printf "\n ERROR ABORTING \n"
printf "\n matrix.comp requires 3 arguments: "
printf " 1: test type (eg, all or test-name), 2: base directory and 3: reference directory. \n"
printf "\n Usage:"
printf " ./bin/matrix.comp all basedir compdir \n\n"
exit
fi

ctest=$1
base_dir=$2
comp_dir=$3
home_dir=`pwd`
base_dir='.'
comp_dir='../../EMC_ww3_master/regtests'

rm -rf $home_dir/output
rm -f $home_dir/matrixDiff.out

Expand Down Expand Up @@ -58,18 +70,12 @@
echo '**********************************************************************' >> $home_dir/fulldiff.tmp


if [ "$#" != '1' ] ; then
echo "usage: matrix.comp test"
echo " test can be 'all'" ; exit 1 ; fi

test=$1

if [ "$test" = 'all' ] ; then
test=`ls -d ww3_tp1.? ww3_tp2.? ww3_ts? ww3_tbt1.? ww3_tbt2.? ww3_tic1.? ww3_tic2.? ww3_tig1.? ww3_tp2.1? mww3_test_0?` ; fi
if [ "$ctest" = 'all' ] ; then
ctest=`ls -d ww3_tp1.? ww3_tp2.? ww3_ts? ww3_tbt1.? ww3_tbt2.? ww3_tic1.? ww3_tic2.? ww3_tig1.? ww3_tp2.1? mww3_test_0?` ; fi
echo "base directory : $base_dir" >> $home_dir/header.tmp
echo "comp directory : $comp_dir" >> $home_dir/header.tmp
echo "test(s) : " >> $home_dir/header.tmp
echo $test >> $home_dir/header.tmp
echo $ctest >> $home_dir/header.tmp
echo " " >> $home_dir/header.tmp

cat $home_dir/header.tmp
Expand All @@ -84,7 +90,7 @@
# 2. Looping over tests #
# --------------------------------------------------------------------------- #

for tst in $test
for tst in $ctest
do
cd $home_dir ; cd $base_dir
if [ ! -d $tst ]
Expand Down
157 changes: 157 additions & 0 deletions regtests/bin/matrix_ncep
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
#!/bin/bash
# --------------------------------------------------------------------------- #
# matrix.go: Run matrix of regression tests on target machine. #
# #
# Remarks: #
# - This version is set up for automatic w3_setenv script and for the #
# NOAA RDHPC 'zeus' system. When using this for your own setup and #
# computer, please copy rather than modify. #
# #
# Hendrik L. Tolman #
# August 2013 #
# December 2013 #
# April 2018 #
# #
# Copyright 2013 National Weather Service (NWS), #
# National Oceanic and Atmospheric Administration. All rights #
# reserved. WAVEWATCH III is a trademark of the NWS. #
# No unauthorized use without permission. #
# #
# --------------------------------------------------------------------------- #
# 0. Environment file

source $(dirname $0)/../../model/bin/w3_setenv
main_dir=$WWATCH3_DIR
temp_dir=$WWATCH3_TMP
source=$WWATCH3_SOURCE
list=$WWATCH3_LIST

echo "Main directory : $main_dir"
echo "Scratch directory : $temp_dir"
echo "Save source codes : $source"
echo "Save listings : $list"

# Set batchq queue to define headers etc (default to original version if empty)
batchq="slurm"

# 1. Set up
# 1.a Computer/ user dependent set up

echo '#!/bin/sh --login' > matrix.head
echo ' ' >> matrix.head
if [ $batchq = "slurm" ]
then
echo '#SBATCH -n 24' >> matrix.head
echo '#SBATCH -q batch' >> matrix.head
echo '#SBATCH -t 08:00:00' >> matrix.head
echo '#SBATCH -A marine-cpu' >> matrix.head
echo '#SBATCH -J ww3_regtest' >> matrix.head
echo '#SBATCH -o matrix.out' >> matrix.head
else
echo '#PBS -l procs=24' >> matrix.head
echo '#PBS -q batch' >> matrix.head
echo '#PBS -l walltime=08:00:00' >> matrix.head
echo '#PBS -A marine-cpu' >> matrix.head
echo '#PBS -N ww3_regtest' >> matrix.head
echo '#PBS -j oe' >> matrix.head
echo '#PBS -o matrix.out' >> matrix.head
echo ' ' >> matrix.head
fi
echo " cd $(dirname $main_dir)/regtests" >> matrix.head
echo ' ' >> matrix.head

# Netcdf and Parmetis modules & variables

istheia=`hostname | grep tfe`
if [ $istheia ]
then
modcomp='intel/14.0.2'
modmpi='impi/5.1.2.150'
modnetcdf='netcdf/4.3.0'
fi

echo " module load $modcomp $modmpi $modnetcdf" >> matrix.head
echo " export WWATCH3_NETCDF=NC4" >> matrix.head
echo " export NETCDF_CONFIG=`which nc-config`" >> matrix.head
echo " export METIS_PATH=/scratch3/NCEPDEV/stmp2/Jessica.Meixner/parmetis-4.0.3" >> matrix.head
echo " export WW3_PARCOMPN=4" >> matrix.head
echo ' '

# Compiler option. Choose appropriate compiler and set cmplOption to
# y if using for the first time or using a different compiler

cmplr=Intel
export cmplOption='y'

if [ "$batchq" = 'slurm' ]
then
export mpi='srun'
else
export mpi='mpirun'
fi
export np='24'
export nr='4'
export nth='6'
# Compile option
if [ "$cmplOption" = 'y' ]
then
opt="-c $cmplr -S -T"
else
opt="-S"
fi
# Batch queue option
if [ "$batchq" = 'slurm' ]
then
opt="-b $batchq $opt"
fi

# Base run_test command line
export rtst="./bin/run_test $opt"

export ww3='../model'

# 1.b Flags to do course selection - - - - - - - - - - - - - - - - - - - - - -
# Addition selection by commenting out lines as below

export shrd='y' # Do shared architecture tests
export dist='y' # Do distributed architecture (MPI) tests
export omp='y' # Threaded (OpenMP) tests
export hybd='n' # Hybrid options

export prop1D='y' # 1-D propagation tests (ww3_tp1.X)
export prop2D='y' # 2-D propagation tests (ww3_tp2.X)
export time='y' # time linmited growth
export fetch='y' # fetch linmited growth
export hur1mg='y' # Hurricane with one moving grid
export shwtr='y' # shallow water tests
export unstr='y' # unstructured grid tests
export pdlib='y' # unstr with pdlib for domain decomposition and implicit solver
export smcgr='y' # SMC/Rotated grid test
export mudice='y' # Mud/Ice and wave interaction tests
export infgrv='y' # Second harmonic generation tests
export uost='y' # ww3_ts4 Unresolved Obstacles Source Term (UOST)
export assim='y' # Restart spectra update

export multi01='y' # mww3_test_01 (wetting and drying)
export multi02='y' # mww3_test_02 (basic two-way nesting test))
export multi03='y' # mww3_test_03 (three high and three low res grids).
export multi04='y' # mww3_test_04 (swell on sea mount and/or current)
export multi05='y' # mww3_test_05 (three-grid moving hurricane)
export multi06='y' # mww3_test_06 (curvilinear grid tests)
export multi07='y' # mww3_test_07 (unstructured grid tests)
export multi08='y' # mww3_test_08 (wind and ice tests)

# export filter='PR3 ST2 UQ'
# The filter does a set of consecutinve greps on the
# command lines generated by filter.base with the above
# selected options.

# --------------------------------------------------------------------------- #
# 2. Execute matrix.base ... #
# --------------------------------------------------------------------------- #

$main_dir/../regtests/bin/matrix.base

# --------------------------------------------------------------------------- #
# End to the matrix #
# --------------------------------------------------------------------------- #
Loading

0 comments on commit 972106c

Please sign in to comment.