Skip to content

Commit

Permalink
uniformize regtests output by setting a global output type in the mat…
Browse files Browse the repository at this point in the history
…rix script (#605)
  • Loading branch information
mickaelaccensi authored and aliabdolali committed Mar 16, 2022
1 parent dc3bb49 commit f40315c
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 200 deletions.
140 changes: 70 additions & 70 deletions regtests/bin/matrix.base

Large diffs are not rendered by default.

95 changes: 49 additions & 46 deletions regtests/bin/matrix_datarmor
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/bin/bash
# --------------------------------------------------------------------------- #
# matrix.go: Run matrix of regression tests on target machine. #
# matrix_datarmor: Run matrix of regression tests on target machine. #
# #
# Remarks: #
# - This version is set up for automatic w3_setenv script and for the #
# IFREMER HPC 'datarmor'. When using this for your own setup and #
# computer, please copy rather than modify. #
# #
# Hendrik L. Tolman #
# Mickael Accensi #
# #
# August 2013 #
# December 2013 #
# April 2018 #
# October 2021 #
# #
# Copyright 2013 National Weather Service (NWS), #
# National Oceanic and Atmospheric Administration. All rights #
Expand All @@ -31,89 +34,88 @@
echo "Save source codes : $source"
echo "Save listings : $list"

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

cmplr=datarmor_intel
export cmplOption='y'

# 1. Set up

export cmplOption='y'
export np='28' #number of mpi tasks
export npl='28' #number of mpi tasks for ufs applications and large setups
export npl1='20' #number of mpi tasks for ufs/large setups (b4b check)
export nr='4' #number of mpi tasks for hybrid
export nth='7' #number of threads
export nth1='6' #number of threads (b4b check)

# 1.a Computer/ user dependent set up

echo '#!/bin/bash' > matrix.head
echo ' ' >> matrix.head
echo '#PBS -q mpi_1' >> matrix.head
echo '#PBS -l mem=20G' >> matrix.head
echo '#PBS -l walltime=48:00:00' >> matrix.head
echo '#PBS -N ww3_regtest' >> matrix.head
echo "#PBS -l select=1:ncpus=28:mpiprocs=$nr:ompthreads=$nth:mem=20G" >> matrix.head
echo '#PBS -l walltime=08:00:00' >> matrix.head
echo "#PBS -N $(basename $(dirname $(dirname $PWD)))" >> matrix.head
echo '#PBS -j oe' >> matrix.head
echo '#PBS -o matrix.out' >> matrix.head
echo ' ' >> matrix.head

echo " cd $(dirname $main_dir)/regtests" >> matrix.head
echo ' ' >> matrix.head

# Netcdf modules

cmplr=datarmor_intel
# Netcdf, grib and Parmetis modules

echo ' source /usr/share/Modules/3.2.10/init/bash' >> matrix.head
echo ' module purge' >> matrix.head
echo " export WW3_PARCOMPN=4" >> matrix.head

if [ $cmplr = "datarmor_intel_debug" ] || [ $cmplr = "datarmor_intel" ]
then
COMP='INTEL'
echo ' module load intel-comp/18' >> matrix.head
echo ' module load impi/2018.1.163' >> matrix.head
echo ' export PATH=${PATH}:/home/datawork-wave/NETCDF2019/INTEL/bin' >> matrix.head
echo ' export CPATH=${CPATH}:/home/datawork-wave/NETCDF2019/INTEL/include' >> matrix.head
echo ' export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/datawork-wave/NETCDF2019/INTEL/lib' >> matrix.head
echo ' export NETCDF_CONFIG=/home/datawork-wave/NETCDF2019/INTEL/bin/nc-config' >> matrix.head
echo ' export METIS_PATH=/home/datawork-wave/PARMETIS2019/INTEL' >> matrix.head

elif [ $cmplr = "datarmor_mpt_debug" ] || [ $cmplr = "datarmor_mpt" ]
then
COMP='MPT'
echo ' module load intel-comp/18' >> matrix.head
echo ' module load mpt/2.18' >> matrix.head
echo ' export PATH=${PATH}:/home/datawork-wave/NETCDF2019/MPT/bin' >> matrix.head
echo ' export CPATH=${CPATH}:/home/datawork-wave/NETCDF2019/MPT/include' >> matrix.head
echo ' export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/datawork-wave/NETCDF2019/MPT/lib' >> matrix.head
echo ' export NETCDF_CONFIG=/home/datawork-wave/NETCDF2019/MPT/bin/nc-config' >> matrix.head
echo ' export METIS_PATH=/home/datawork-wave/PARMETIS2019/MPT' >> matrix.head

elif [ $cmplr = "datarmor_gnu_debug" ] || [ $cmplr = "datarmor_gnu" ]
then
COMP='GNU'
echo ' module load impi/2018.1.163' >> matrix.head
echo ' export PATH=${PATH}:/home/datawork-wave/NETCDF2019/GNU/bin' >> matrix.head
echo ' export CPATH=${CPATH}:/home/datawork-wave/NETCDF2019/GNU/include' >> matrix.head
echo ' export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/datawork-wave/NETCDF2019/GNU/lib' >> matrix.head
echo ' export NETCDF_CONFIG=/home/datawork-wave/NETCDF2019/GNU/bin/nc-config' >> matrix.head
echo ' export METIS_PATH=/home/datawork-wave/PARMETIS2019/GNU' >> matrix.head

elif [ $cmplr = "datarmor_pgi_debug" ] || [ $cmplr = "datarmor_pgi" ]
then
COMP='PGI'
echo ' module load pgi/17.10' >> matrix.head
echo ' export PATH=${PATH}:/home/datawork-wave/NETCDF2019/PGI/bin' >> matrix.head
echo ' export CPATH=${CPATH}:/home/datawork-wave/NETCDF2019/PGI/include' >> matrix.head
echo ' export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/datawork-wave/NETCDF2019/PGI/lib' >> matrix.head
echo ' export NETCDF_CONFIG=/home/datawork-wave/NETCDF2019/PGI/bin/nc-config' >> matrix.head
echo ' export METIS_PATH=/home/datawork-wave/PARMETIS2019/PGI' >> matrix.head
fi

echo " export PATH=\${PATH}:/home/datawork-wave/NETCDF2019/${COMP}/bin" >> matrix.head
echo " export CPATH=\${CPATH}:/home/datawork-wave/NETCDF2019/${COMP}/include" >> matrix.head
echo " export LD_LIBRARY_PATH=\${LD_LIBRARY_PATH}:/home/datawork-wave/NETCDF2019/${COMP}/lib" >> matrix.head
echo " export NETCDF_CONFIG=/home/datawork-wave/NETCDF2019/${COMP}/bin/nc-config" >> matrix.head
echo " export METIS_PATH=/home/datawork-wave/PARMETIS2019/${COMP}" >> matrix.head
echo " export WW3_PARCOMPN=4" >> matrix.head
echo " export G2_LIB4=/home/datawork-wave/GRIB2021/${COMP}/lib/libg2.a" >> matrix.head
echo " export BACIO_LIB4=/home/datawork-wave/GRIB2021/${COMP}/lib/libbacio.a" >> matrix.head
echo " export JASPER_LIB=/home/datawork-wave/NETCDF2019/${COMP}/lib/libjasper.so" >> matrix.head
echo " export PNG_LIB=/home/datawork-wave/NETCDF2019/${COMP}/lib/libpng.so" >> matrix.head
echo " export Z_LIB=/lib64/libz.so.1" >> matrix.head
echo ' '

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

export cmplOption='y'

export mpi='$MPI_LAUNCH'
export np='28'
export nr='14'
export nth='2'
export mpi='$MPI_LAUNCH'

# Compile option
if [ "$cmplOption" = 'y' ]
then
export rtst="./bin/run_test -o both -N -f -S -T -c $cmplr"
export opt="-o all -f -c $cmplr -S -T"
else
export rtst="./bin/run_test -o both -N -f -S -T"
export opt="-o all -f -S -T"
fi

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

export ww3='../model'

# 1.b Flags to do course selection - - - - - - - - - - - - - - - - - - - - - -
Expand All @@ -122,7 +124,7 @@
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 hybd='y' # Hybrid options

export prop1D='y' # 1-D propagation tests (ww3_tp1.X)
export prop2D='y' # 2-D propagation tests (ww3_tp2.X)
Expand All @@ -138,7 +140,7 @@
export infgrv='y' # Second harmonic generation tests
export uost='y' # ww3_ts4 Unresolved Obstacles Source Term (UOST)
export assim='y' # Restart spectra update
export oasis='y' # Atmosphere, ocean, and ice coupling using oasis
export oasis='y' # Atmosphere, ocean, and ice coupling using OASIS
export calendar='y' # Calendar type
export confignc='y' # Configurable netCDF meta data (ww3_ounf)

Expand All @@ -153,13 +155,13 @@
export multi09='y' # mww3_test_09 (SMC multi grid test)
export ufs='n' # The Unified Forecast System
export ufscoarse='n' # Option for small PCs
export grib='n' # grib file field output
export grib='y' # grib file field output
export rstrt_b4b='y' # Restart Reproducibility
export npl_b4b='y' # MPI task Reproducibility
export nth_b4b='y' # Thread Reproducibility
export esmf='n' # ESMF coupling
# export filter='PR3 ST2 UQ'
# The filter does a set of consecutinve greps on the
# The filter does a set of consecutive greps on the
# command lines generated by filter.base with the above
# selected options.

Expand All @@ -169,6 +171,7 @@

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

$main_dir/../regtests/bin/matrix_divider_p.sh
# --------------------------------------------------------------------------- #
# End to the matrix #
# --------------------------------------------------------------------------- #
4 changes: 2 additions & 2 deletions regtests/bin/matrix_milhydro
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
# Compile option
if [ "$cmplOption" = 'y' ]
then
opt="-c $cmplr -S -T"
opt="-o all -c $cmplr -S -T"
else
opt="-S"
opt="-o all -S"
fi
# Batch queue option
if [ "$batchq" = 'slurm' ]
Expand Down
4 changes: 2 additions & 2 deletions regtests/bin/matrix_ncep
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@
# Compile option
if [ "$cmplOption" = 'y' ]
then
opt="-c $cmplr -S -T"
opt="-o all -c $cmplr -S -T"
else
opt="-S"
opt="-o all -S"
fi
# Batch queue option
if [ "$batchq" = 'slurm' ]
Expand Down
4 changes: 2 additions & 2 deletions regtests/bin/matrix_s4
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@
# Compile option
if [ "$cmplOption" = 'y' ]
then
opt="-c $cmplr -S -T"
opt="-o all -c $cmplr -S -T"
else
opt="-S"
opt="-o all -S"
fi
# Batch queue option
opt="-b $batchq $opt"
Expand Down
4 changes: 2 additions & 2 deletions regtests/bin/matrix_ukmo_cray
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ fi

if [ "$cmplOption" = 'y' ]
then
export rtst="./bin/run_test -c $cmplr -S"
export rtst="./bin/run_test -o both -c $cmplr -S"
else
export rtst="./bin/run_test -S"
export rtst="./bin/run_test -o both -S"
fi

export ww3='../model'
Expand Down
3 changes: 1 addition & 2 deletions regtests/bin/run_test
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,7 @@ fi

# 3.b2 Preprocess cdl files into nc files ----------------------------------- #

filescdl=$path_i/*.cdl
for f in $filescdl
for f in $(find $path_i/ -type f -name "*.cdl")
do
echo "Converting $f to NetCDF"
# take action on each file. Note that converted file is in $path_w
Expand Down
11 changes: 0 additions & 11 deletions regtests/ww3_tic2.2/input/ww3_outp_spec.inp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@ $ WAVEWATCH III Point output post-processing
$ ------------------------------------------
19680606 120000 3600. 1
$
1
2
3
4
5
6
7
8
9
10
11
-1
$
1
Expand Down
24 changes: 0 additions & 24 deletions regtests/ww3_tic2.2/input/ww3_outp_tab50.inp
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@ $ WAVEWATCH III Point output post-processing
$ ------------------------------------------
19680606 000000 600. 9999
$
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-1
$
2
Expand Down
2 changes: 0 additions & 2 deletions regtests/ww3_tic2.2/input/ww3_outp_tab51.inp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ $ WAVEWATCH III Point output post-processing
$ ------------------------------------------
19680606 000000 900. 49
$
$ 1
16
-1
$
2
Expand Down
11 changes: 0 additions & 11 deletions regtests/ww3_tic2.2/input_IC2/ww3_outp_spec.inp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@ $ WAVEWATCH III Point output post-processing
$ ------------------------------------------
19680606 120000 3600. 1
$
1
2
3
4
5
6
7
8
9
10
11
-1
$
1
Expand Down
24 changes: 0 additions & 24 deletions regtests/ww3_tic2.2/input_IC2/ww3_outp_tab50.inp
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@ $ WAVEWATCH III Point output post-processing
$ ------------------------------------------
19680606 000000 600. 9999
$
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-1
$
2
Expand Down
2 changes: 0 additions & 2 deletions regtests/ww3_tic2.2/input_IC2/ww3_outp_tab51.inp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ $ WAVEWATCH III Point output post-processing
$ ------------------------------------------
19680606 000000 900. 49
$
$ 1
16
-1
$
2
Expand Down

0 comments on commit f40315c

Please sign in to comment.