| 1 |
jmc |
1.1 |
#PBS -S /bin/bash |
| 2 |
|
|
#PBS -N tst_fast |
| 3 |
|
|
#PBS -l select=1:ncpus=6:mpiprocs=6:model=san |
| 4 |
|
|
#PBS -l walltime=12:00:00 |
| 5 |
|
|
#PBS -V |
| 6 |
|
|
#PBS -e /u/jcampin/test_pleiades/output/tst_fast.stderr |
| 7 |
|
|
#PBS -o /u/jcampin/test_pleiades/output/tst_fast.stdout |
| 8 |
|
|
|
| 9 |
jmc |
1.7 |
# $Header: /u/gcmpack/MITgcm_contrib/test_scripts/nasa_ames/test_pleiades_fast,v 1.6 2023/06/02 22:51:02 jmc Exp $ |
| 10 |
jmc |
1.1 |
# $Name: $ |
| 11 |
|
|
|
| 12 |
|
|
if test -f /etc/profile.d/modules.sh ; then |
| 13 |
|
|
. /etc/profile.d/modules.sh |
| 14 |
|
|
fi |
| 15 |
|
|
# Note: added "ulimit -s unlimited" in file "~/.bashrc" |
| 16 |
|
|
# to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI |
| 17 |
|
|
|
| 18 |
|
|
umask 0022 |
| 19 |
|
|
#- to get case insensitive "ls" (and order of tested experiments) |
| 20 |
|
|
export LC_ALL="en_US.UTF-8" |
| 21 |
|
|
echo " running on: "`hostname` |
| 22 |
|
|
|
| 23 |
|
|
dNam='pleiades' |
| 24 |
|
|
HERE="$HOME/test_$dNam" |
| 25 |
jmc |
1.6 |
SubD="$HERE/nasa_ames" ; OUTP="$HERE/output" ; SavD="$HERE/send" |
| 26 |
jmc |
1.1 |
SEND="ssh pfe $SavD/mpack" |
| 27 |
|
|
ADDR='jm_c@mitgcm.org' |
| 28 |
jmc |
1.5 |
TST_DISK="/nobackupp17/jcampin" |
| 29 |
jmc |
1.1 |
TST_DIR="$TST_DISK/test_${dNam}" |
| 30 |
jmc |
1.3 |
#- where local copy of code is (need to be consistent with "test_submit_pleiades"): |
| 31 |
jmc |
1.2 |
srcDIR='.' |
| 32 |
|
|
#srcDIR=$HERE |
| 33 |
|
|
srcCode="MITgcm_today" |
| 34 |
jmc |
1.1 |
|
| 35 |
jmc |
1.2 |
echo "cd $TST_DISK ; pwd (x2)" |
| 36 |
jmc |
1.1 |
cd $TST_DISK ; pwd |
| 37 |
jmc |
1.2 |
if test ! -d $TST_DIR ; then |
| 38 |
|
|
echo -n "Creating a working dir: $TST_DIR ..." |
| 39 |
|
|
#/bin/rm -rf $TST_DIR |
| 40 |
|
|
mkdir $TST_DIR |
| 41 |
|
|
retVal=$? |
| 42 |
|
|
if test "x$retVal" != x0 ; then |
| 43 |
|
|
echo "Error: unable to make dir: $TST_DIR (err=$retVal ) --> Exit" |
| 44 |
|
|
exit 1 |
| 45 |
|
|
fi |
| 46 |
jmc |
1.1 |
fi |
| 47 |
jmc |
1.2 |
echo "start from TST_DIR='$TST_DIR' at: "`date` |
| 48 |
|
|
cd $TST_DIR ; pwd |
| 49 |
jmc |
1.1 |
|
| 50 |
jmc |
1.6 |
checkOut=2 ; dblTr=0 ; typ='' ; addExp='' ; skipExp='' |
| 51 |
jmc |
1.1 |
#sfx='ifc' |
| 52 |
jmc |
1.4 |
#sfx='ieee'; dblTr=1 |
| 53 |
|
|
sfx='fast'; dblTr=1 |
| 54 |
jmc |
1.6 |
#sfx='fast'; checkOut=2 ; dblTr=2 #- fast-1 |
| 55 |
|
|
#sfx='fast'; checkOut=0 ; dblTr=1 #- fast-2 |
| 56 |
jmc |
1.4 |
#addExp='global_ocean.gm_k3d global_ocean.gm_res' |
| 57 |
jmc |
1.1 |
|
| 58 |
|
|
module purge |
| 59 |
jmc |
1.4 |
#- using older version of Intel Compiler: |
| 60 |
|
|
#module load comp-intel/2016.2.181 |
| 61 |
|
|
#- using newer version of Intel Compiler: |
| 62 |
|
|
module load comp-intel/2020.4.304 |
| 63 |
|
|
#- for MPI and NetCDF: |
| 64 |
|
|
module load mpi-hpe/mpt.2.25 |
| 65 |
jmc |
1.1 |
module load hdf4/4.2.12 hdf5/1.8.18_mpt netcdf/4.4.1.1_mpt |
| 66 |
|
|
module list |
| 67 |
|
|
|
| 68 |
|
|
OPTFILE="../tools/build_options/linux_amd64_ifort+mpi_ice_nas" |
| 69 |
jmc |
1.4 |
options="$typ -MPI 6" |
| 70 |
|
|
#options="-j 2 $options" |
| 71 |
jmc |
1.3 |
#mpiCMD='mpiexec_mpt -np TR_NPROC ./mitgcmuv' |
| 72 |
jmc |
1.1 |
#- need this to get "staf": |
| 73 |
|
|
#export PATH="$PATH:$HOME/bin" |
| 74 |
|
|
|
| 75 |
|
|
dInWeek=`date +%a` |
| 76 |
|
|
#if test "x$dInWeek" = xSun ; then options="$options -fast" ; fi |
| 77 |
|
|
if test $sfx = 'fast' ; then options="$options -fast" ; fi |
| 78 |
|
|
|
| 79 |
jmc |
1.4 |
#options="$options -nc" ; checkOut=1 ; dblTr=0 |
| 80 |
|
|
#options="$options -q" ; checkOut=0 ; dblTr=0 |
| 81 |
jmc |
1.1 |
|
| 82 |
|
|
#- keep a copy of MPI_MFILE: |
| 83 |
|
|
#cp -p $PBS_NODEFILE $OUTP"/mf_"$sfx |
| 84 |
|
|
|
| 85 |
|
|
cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q' |
| 86 |
|
|
gcmDIR="MITgcm_$sfx" |
| 87 |
|
|
|
| 88 |
|
|
if [ $checkOut -eq 1 ] ; then |
| 89 |
|
|
if test -d $gcmDIR/CVS ; then |
| 90 |
|
|
#- remove previous output tar files and tar & remove previous output-dir |
| 91 |
|
|
/bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz |
| 92 |
|
|
( cd $gcmDIR/verification |
| 93 |
|
|
listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null` |
| 94 |
|
|
for dd in $listD |
| 95 |
|
|
do |
| 96 |
|
|
if test -d $dd ; then |
| 97 |
|
|
tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd |
| 98 |
jmc |
1.2 |
retVal=$? |
| 99 |
|
|
if test "x$retVal" != x0 ; then |
| 100 |
jmc |
1.1 |
echo "ERROR in tar+gzip prev outp-dir: $dd" |
| 101 |
jmc |
1.2 |
echo " on '"`hostname`"' (return val=$retVal) but continue" |
| 102 |
jmc |
1.1 |
fi |
| 103 |
|
|
fi |
| 104 |
|
|
done ) |
| 105 |
|
|
echo "clean tst_2+2 + testreport output (+ Makefile_syntax files)" |
| 106 |
|
|
( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
| 107 |
|
|
( cd $gcmDIR/verification ; ./testreport $typ -clean ) |
| 108 |
|
|
# ( cd $gcmDIR/verification ; rm -f */build/Makefile_syntax ) |
| 109 |
|
|
# ( cd $gcmDIR/verification ; rm -f */build/port_rand.i */build/ptracers_set_iolabel.i ) |
| 110 |
|
|
echo "cvs update of dir $gcmDIR :" |
| 111 |
|
|
( cd $gcmDIR ; $cmdCVS update -P -d ) 2>&1 |
| 112 |
jmc |
1.2 |
retVal=$? |
| 113 |
|
|
if test "x$retVal" != x0 ; then |
| 114 |
|
|
echo "cvs update on '"`hostname`"' fail (return val=$retVal) => exit" |
| 115 |
jmc |
1.1 |
exit |
| 116 |
|
|
fi |
| 117 |
|
|
else |
| 118 |
|
|
echo "no dir: $gcmDIR/CVS => try a fresh check-out" |
| 119 |
|
|
checkOut=2 |
| 120 |
|
|
fi |
| 121 |
|
|
fi |
| 122 |
|
|
if [ $checkOut -eq 2 ] ; then |
| 123 |
|
|
if test -e $gcmDIR ; then |
| 124 |
|
|
echo -n "Removing working copy: $gcmDIR ..." |
| 125 |
|
|
rm -rf $gcmDIR |
| 126 |
|
|
echo " done" |
| 127 |
|
|
fi |
| 128 |
|
|
#echo "Downloading using '$cmdCVS co -P -d $gcmDIR MITgcm' ..." |
| 129 |
|
|
#$cmdCVS co -P -d $gcmDIR MITgcm > /dev/null |
| 130 |
jmc |
1.2 |
#retVal=$? |
| 131 |
|
|
#if test "x$retVal" != x0 ; then |
| 132 |
|
|
# echo "cvs co on '"`hostname`"' fail (return val=$retVal) => exit" |
| 133 |
jmc |
1.1 |
# exit |
| 134 |
|
|
#fi |
| 135 |
|
|
#if test -d $gcmDIR/verification ; then |
| 136 |
|
|
# /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
| 137 |
|
|
# /usr/bin/find $gcmDIR -type f | xargs chmod g+r |
| 138 |
|
|
#fi |
| 139 |
|
|
#- make a local copy (instead of using CVS): |
| 140 |
|
|
today=`date +%Y%m%d` |
| 141 |
jmc |
1.2 |
nCount=0; updFile="${srcDIR}/updated_code" |
| 142 |
jmc |
1.1 |
updDate=0 ; test -f $updFile && updDate=`cat $updFile` |
| 143 |
|
|
while [ $today -gt $updDate ] ; do |
| 144 |
|
|
nCount=`expr $nCount + 1` |
| 145 |
|
|
if [ $nCount -gt 40 ] ; then |
| 146 |
|
|
echo " waiting too long (nCount=$nCount) for updated code" |
| 147 |
|
|
echo " today=$today , updDate=$updDate " |
| 148 |
|
|
ls -l $updFile |
| 149 |
|
|
exit |
| 150 |
|
|
fi |
| 151 |
|
|
sleep 60 |
| 152 |
|
|
updDate=0 ; test -f $updFile && updDate=`cat $updFile` |
| 153 |
|
|
done |
| 154 |
|
|
ls -l $updFile |
| 155 |
|
|
echo " waited nCount=$nCount for updated code ($updDate) to copy" |
| 156 |
jmc |
1.2 |
if test -d $srcDIR/$srcCode ; then |
| 157 |
|
|
echo -n "Make local copy of dir '$srcDIR/$srcCode' to: $gcmDIR ..." |
| 158 |
|
|
cp -pra $srcDIR/$srcCode $gcmDIR |
| 159 |
jmc |
1.1 |
echo " done" |
| 160 |
jmc |
1.2 |
else echo " dir: $srcDIR/$srcCode missing => exit" ; exit ; fi |
| 161 |
jmc |
1.1 |
fi |
| 162 |
|
|
|
| 163 |
|
|
#- change dir to $gcmDIR/verification dir: |
| 164 |
|
|
if test -e $gcmDIR/verification ; then |
| 165 |
|
|
if [ $checkOut -lt 2 ] ; then |
| 166 |
|
|
echo " dir $gcmDIR/verification exist" ; fi |
| 167 |
|
|
cd $gcmDIR/verification |
| 168 |
|
|
#------------ |
| 169 |
|
|
for exp2add in $addExp ; do |
| 170 |
|
|
if test -d ${exp2add}/CVS ; then |
| 171 |
|
|
echo " assumes dir: $exp2add has been updated" |
| 172 |
|
|
else |
| 173 |
|
|
test -r $exp2add && /bin/rm -rf $exp2add |
| 174 |
|
|
echo " add dir: $exp2add (from Contrib:verification_other)" |
| 175 |
|
|
( $cmdCVS co -P -d $exp2add \ |
| 176 |
|
|
MITgcm_contrib/verification_other/$exp2add > /dev/null ) |
| 177 |
|
|
if test $exp2add = 'global_oce_cs32' ; then |
| 178 |
|
|
echo " link dir 'other_input/core2_cnyf' in here" |
| 179 |
|
|
( cd ${exp2add} ; ln -s ../../../other_input/core2_cnyf . ) |
| 180 |
|
|
fi |
| 181 |
|
|
if test $exp2add = 'global_oce_llc90' ; then |
| 182 |
|
|
echo " link dir 'other_input/gael_oce_llc90_input' to 'input_fields'" |
| 183 |
|
|
( cd ${exp2add} ; ln -s ../../../other_input/gael_oce_llc90_input input_fields ) |
| 184 |
|
|
echo " link dirs: 'core2_cnyf' & 'global_oce_input_fields/*' in input_verifs" |
| 185 |
|
|
( test ! -e ${exp2add}/input_verifs && mkdir ${exp2add}/input_verifs |
| 186 |
|
|
cd ${exp2add}/input_verifs |
| 187 |
|
|
ln -s ../../../../other_input/core2_cnyf . |
| 188 |
|
|
ln -s ../../../../other_input/global_oce_input_fields/* . ) |
| 189 |
|
|
fi |
| 190 |
|
|
/usr/bin/find $exp2add -type d | xargs chmod g+rxs |
| 191 |
|
|
/usr/bin/find $exp2add -type f | xargs chmod g+r |
| 192 |
|
|
fi |
| 193 |
|
|
done |
| 194 |
|
|
else |
| 195 |
|
|
echo "no dir: $gcmDIR/verification => exit" |
| 196 |
|
|
exit |
| 197 |
|
|
fi |
| 198 |
|
|
|
| 199 |
jmc |
1.6 |
if [ $dblTr -eq 2 ] ; then |
| 200 |
|
|
LIST=`ls */results/output.txt | sed 's/\/results\/output.txt//'` |
| 201 |
|
|
tstList=`echo $LIST | sed 's/tutorial_.*$//'` |
| 202 |
|
|
else |
| 203 |
|
|
LIST=`ls tutorial_*/results/output.txt | head -n 1 | sed 's/\/results\/output.txt//'` |
| 204 |
|
|
tstList="start_from $LIST" |
| 205 |
|
|
fi |
| 206 |
|
|
|
| 207 |
|
|
if [ $dblTr -ge 1 ] ; then |
| 208 |
jmc |
1.4 |
# echo '' |
| 209 |
|
|
#- 0) just make all module header ( *__genmod.mod files) using modified Makefile |
| 210 |
|
|
# echo ./testreport $options -of $OPTFILE -j 4 \ |
| 211 |
|
|
# -repl_mk do_make_syntax.sh -obj -dd |
| 212 |
|
|
# ./testreport $options -of $OPTFILE -j 4 \ |
| 213 |
|
|
# -repl_mk do_make_syntax.sh -obj -dd 2>&1 |
| 214 |
|
|
# options="$options -q" |
| 215 |
jmc |
1.1 |
|
| 216 |
jmc |
1.4 |
echo '' |
| 217 |
|
|
#- 1) just compile ("-nr"), using "-j 4" to speed up |
| 218 |
|
|
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx -j 4 -nr |
| 219 |
|
|
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx -j 4 -nr |
| 220 |
|
|
nFc=`grep -c '^Y . N N ' tr_out.txt` |
| 221 |
|
|
echo " <= fail to compile $nFc experiments" |
| 222 |
|
|
options="$options -q" |
| 223 |
jmc |
1.6 |
if [ $dblTr -eq 2 ] ; then |
| 224 |
|
|
echo -n "Submit second job:" $SubD/test_${dNam}_${sfx}2 |
| 225 |
|
|
qsub $SubD/test_${dNam}_${sfx}2 |
| 226 |
|
|
exit 0 |
| 227 |
|
|
fi |
| 228 |
jmc |
1.4 |
fi |
| 229 |
|
|
|
| 230 |
|
|
echo '' |
| 231 |
jmc |
1.1 |
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
| 232 |
jmc |
1.3 |
-send \"$SEND\" -sd $SavD -a $ADDR |
| 233 |
jmc |
1.1 |
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
| 234 |
jmc |
1.3 |
-send "$SEND" -sd $SavD -a $ADDR |
| 235 |
jmc |
1.7 |
retVal=$? |
| 236 |
jmc |
1.1 |
|
| 237 |
jmc |
1.7 |
if test "x$retVal" != x0 ; then |
| 238 |
|
|
echo "<== testreport returned retVal=${retVal}, expecting 0" |
| 239 |
|
|
echo " -> skip restart test 'do_tst_2+2'" |
| 240 |
|
|
else |
| 241 |
jmc |
1.1 |
echo '' |
| 242 |
|
|
echo ../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
| 243 |
jmc |
1.3 |
-send \"$SEND\" -sd $SavD -a $ADDR |
| 244 |
jmc |
1.1 |
../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
| 245 |
jmc |
1.3 |
-send "$SEND" -sd $SavD -a $ADDR |
| 246 |
jmc |
1.7 |
fi |