| 1 |
jmc |
1.1 |
#!/bin/bash |
| 2 |
jmc |
1.13 |
#SBATCH -J ifcMp2_tst |
| 3 |
jmc |
1.1 |
#SBATCH -p sched_mit_hill |
| 4 |
|
|
#SBATCH --mem-per-cpu 4000 |
| 5 |
|
|
#SBATCH -N 1 |
| 6 |
|
|
#SBATCH --tasks-per-node 10 |
| 7 |
jmc |
1.24 |
# #SBATCH -x node[360,365] |
| 8 |
jmc |
1.13 |
#SBATCH -e /home/jm_c/test_engaging/output/ifcMp2_tst.stderr |
| 9 |
|
|
#SBATCH -o /home/jm_c/test_engaging/output/ifcMp2_tst.stdout |
| 10 |
jmc |
1.19 |
#SBATCH --no-requeue |
| 11 |
|
|
#SBATCH --constraint=centos6 |
| 12 |
jmc |
1.1 |
|
| 13 |
jmc |
1.24 |
# $Header: /u/gcmpack/MITgcm_contrib/test_scripts/engaging/test_engag_ifc_mp2,v 1.23 2021/11/11 18:03:27 jmc Exp $ |
| 14 |
jmc |
1.1 |
# $Name: $ |
| 15 |
|
|
|
| 16 |
|
|
if test -f /etc/profile.d/modules.sh ; then |
| 17 |
|
|
. /etc/profile.d/modules.sh |
| 18 |
|
|
fi |
| 19 |
|
|
# Note: added "ulimit -s unlimited" in file "~/.bashrc" |
| 20 |
|
|
# to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI |
| 21 |
|
|
|
| 22 |
|
|
umask 0022 |
| 23 |
|
|
#- to get case insensitive "ls" (and order of tested experiments) |
| 24 |
|
|
export LC_ALL="en_US.UTF-8" |
| 25 |
|
|
echo " running on: "`hostname` |
| 26 |
|
|
|
| 27 |
|
|
dNam='engaging' |
| 28 |
|
|
HERE="$HOME/test_$dNam" |
| 29 |
|
|
OUTP="$HERE/output"; SavD="$HERE/send" |
| 30 |
jmc |
1.22 |
SEND="ssh eofe8 $SavD/mpack" |
| 31 |
jmc |
1.1 |
TST_DIR="/pool001/jm_c/test_$dNam" |
| 32 |
jmc |
1.11 |
tmpFil="/tmp/"`basename $0`".$$" |
| 33 |
|
|
cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q' |
| 34 |
jmc |
1.13 |
#- which GitHub repository to use and how to access it: |
| 35 |
jmc |
1.14 |
git_repo='MITgcm'; git_code='MITgcm' ; git_other='verification_other' |
| 36 |
jmc |
1.11 |
#git_repo='altMITgcm'; #git_code='MITgcm66h' |
| 37 |
jmc |
1.13 |
#-- |
| 38 |
|
|
git_repo="https://github.com/$git_repo" |
| 39 |
|
|
#git_repo="git://github.com/$git_repo" |
| 40 |
|
|
#git_repo="git@github.com:$git_repo" |
| 41 |
jmc |
1.1 |
|
| 42 |
jmc |
1.23 |
dblTr=0 ; typ='' ; addExp='' ; skipExp='' |
| 43 |
|
|
sfx='ifcMp2'; dblTr=1 |
| 44 |
jmc |
1.16 |
addExp='atm_gray atm_strato offline_cheapaml' |
| 45 |
jmc |
1.1 |
module add slurm |
| 46 |
|
|
module add gcc |
| 47 |
|
|
module add engaging/intel/2013.1.046 |
| 48 |
|
|
#export MPI_INC_DIR="$MPI_HOME/include" |
| 49 |
|
|
OPTFILE="../tools/build_options/linux_amd64_ifort+impi" |
| 50 |
jmc |
1.4 |
export GENERIC='on' # <-- to prevent the use of "-xHost" option |
| 51 |
jmc |
1.1 |
mpiCMD="mpirun -env I_MPI_DEBUG 2 -n TR_NPROC ./mitgcmuv" #- currently not used |
| 52 |
jmc |
1.8 |
options="$typ -MPI 4 -mth" |
| 53 |
jmc |
1.9 |
#options="-j 4 $options" |
| 54 |
jmc |
1.1 |
export OMP_NUM_THREADS=2 |
| 55 |
jmc |
1.2 |
export KMP_STACKSIZE=400m |
| 56 |
jmc |
1.1 |
#options="$options -gsl" |
| 57 |
|
|
#export GSL_IEEE_MODE=double-precision,mask-underflow,mask-denormalized |
| 58 |
|
|
ulimit -s unlimited |
| 59 |
|
|
#- need this to get "staf" & "do_make_syntax.sh": |
| 60 |
|
|
export PATH="$PATH:$HOME/bin" |
| 61 |
|
|
|
| 62 |
jmc |
1.11 |
gcmDIR="MITgcm_$sfx" |
| 63 |
jmc |
1.1 |
dAlt=`date +%d` ; dAlt=`expr $dAlt % 3` |
| 64 |
|
|
if [ $dAlt -eq 1 ] ; then options="$options -fast" |
| 65 |
|
|
else options="$options -devel" ; fi |
| 66 |
|
|
|
| 67 |
|
|
checkOut=1 ; #options="$options -do" |
| 68 |
jmc |
1.23 |
#options="$options -nc" ; checkOut=1 ; dblTr=0 |
| 69 |
|
|
#options="$options -q" ; checkOut=0 ; dblTr=0 |
| 70 |
jmc |
1.1 |
|
| 71 |
jmc |
1.11 |
if test -d $TST_DIR ; then |
| 72 |
|
|
echo "start from TST_DIR='$TST_DIR' at: "`date` |
| 73 |
|
|
else |
| 74 |
|
|
#if test ! -d $TST_DIR ; then mkdir $TST_DIR ; fi |
| 75 |
|
|
#if test ! -d $TST_DIR ; then |
| 76 |
|
|
# echo "ERROR: Can't create directory \"$TST_DIR\"" |
| 77 |
|
|
# exit 1 |
| 78 |
|
|
#fi |
| 79 |
|
|
#echo "start in new dir TST_DIR='$TST_DIR' at: "`date` |
| 80 |
|
|
echo "ERROR: missing directory \"$TST_DIR\"" |
| 81 |
|
|
exit 1 |
| 82 |
|
|
fi |
| 83 |
|
|
cd $TST_DIR |
| 84 |
|
|
pwd |
| 85 |
jmc |
1.21 |
df . |
| 86 |
jmc |
1.11 |
|
| 87 |
jmc |
1.1 |
NSLOTS=$SLURM_NTASKS |
| 88 |
|
|
THEDATE=`date` |
| 89 |
|
|
echo '********************************************************************************' |
| 90 |
|
|
echo 'Start job '$THEDATE |
| 91 |
|
|
echo 'NSLOTS = '$NSLOTS |
| 92 |
|
|
echo '======= NODELIST ===============================================================' |
| 93 |
|
|
echo $SLURM_NODELIST |
| 94 |
jmc |
1.20 |
cat /etc/redhat-release |
| 95 |
jmc |
1.4 |
echo '======= Procs ==================================================================' |
| 96 |
|
|
grep 'model name' /proc/cpuinfo | uniq |
| 97 |
|
|
echo -n ' x ' |
| 98 |
|
|
grep -c 'model name' /proc/cpuinfo |
| 99 |
jmc |
1.1 |
echo '======= env ====================================================================' |
| 100 |
|
|
env | grep SLURM |
| 101 |
|
|
echo '======= modules ================================================================' |
| 102 |
|
|
module list 2>&1 |
| 103 |
|
|
echo '================================================================================' |
| 104 |
|
|
|
| 105 |
|
|
#- |
| 106 |
|
|
MPI_MFile="${OUTP}/mf_${sfx}" #- currently not used |
| 107 |
|
|
#mpiCMD="mpirun -hostfile TR_MFILE -n TR_NPROC ./mitgcmuv" |
| 108 |
|
|
#- make the testreport MPI_MFILE: |
| 109 |
|
|
#listNODES=`echo $SLURM_NODELIST | sed -e 's/\[/ /' -e 's/\]//' -e 's/,/ /' -e 's/-/ /'` |
| 110 |
|
|
# duplicate the 2 listed nodes into a 6 list file: |
| 111 |
|
|
#/bin/rm -f $MPI_MFile ; touch $MPI_MFile |
| 112 |
|
|
#for nc in `seq 1 4` ; do pfx='' |
| 113 |
|
|
# for nd in $listNODES ; do |
| 114 |
|
|
# if test "x$pfx" = x ; then pfx=$nd ; else |
| 115 |
|
|
# echo "${pfx}${nd}" >> $MPI_MFile |
| 116 |
|
|
# fi |
| 117 |
|
|
# done |
| 118 |
|
|
#done |
| 119 |
|
|
|
| 120 |
|
|
#- check for disk space: relative space (99%) or absolute (10.G): |
| 121 |
|
|
dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'` |
| 122 |
|
|
if [ $dsp -gt 99 ] ; then |
| 123 |
|
|
#dsp=`df -P . | tail -1 | awk '{print $4}'` |
| 124 |
|
|
#if [ $dsp -le 100000000 ] ; then |
| 125 |
|
|
echo 'Not enough space on this disk => do not run testreport.' |
| 126 |
|
|
df . |
| 127 |
|
|
exit |
| 128 |
|
|
fi |
| 129 |
jmc |
1.14 |
|
| 130 |
|
|
if [ $checkOut -eq 1 ] ; then |
| 131 |
|
|
if test ! -e $gcmDIR/.git/config ; then |
| 132 |
|
|
echo "no file: $gcmDIR/.git/config => try to download a fresh clone" |
| 133 |
|
|
checkOut=2 |
| 134 |
|
|
fi |
| 135 |
|
|
if test "x$addExp" != x ; then |
| 136 |
|
|
if test ! -e $gcmDIR/$git_other/.git/config ; then |
| 137 |
|
|
echo "no file: $gcmDIR/$git_other/.git/config => try a fresh clone" |
| 138 |
|
|
checkOut=2 |
| 139 |
|
|
fi |
| 140 |
|
|
fi |
| 141 |
|
|
fi |
| 142 |
jmc |
1.1 |
if [ $checkOut -eq 1 ] ; then |
| 143 |
|
|
echo "cleaning output from $gcmDIR/verification :" |
| 144 |
|
|
#- remove previous output tar files and tar & remove previous output-dir |
| 145 |
|
|
/bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz |
| 146 |
|
|
( cd $gcmDIR/verification |
| 147 |
|
|
listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null` |
| 148 |
|
|
for dd in $listD |
| 149 |
|
|
do |
| 150 |
|
|
if test -d $dd ; then |
| 151 |
|
|
tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd |
| 152 |
jmc |
1.11 |
retVal=$? |
| 153 |
|
|
if test "x$retVal" != x0 ; then |
| 154 |
jmc |
1.1 |
echo "ERROR in tar+gzip prev outp-dir: $dd" |
| 155 |
jmc |
1.11 |
echo " on '"`hostname`"' (return val=$retVal) but continue" |
| 156 |
jmc |
1.1 |
fi |
| 157 |
|
|
fi |
| 158 |
|
|
done ) |
| 159 |
|
|
echo "clean tst_2+2 + testreport output (+ Makefile_syntax files)" |
| 160 |
|
|
( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
| 161 |
|
|
( cd $gcmDIR/verification ; ./testreport $typ -clean ) |
| 162 |
|
|
( cd $gcmDIR/verification ; rm -f */build/Makefile_syntax ) |
| 163 |
|
|
( cd $gcmDIR/verification ; rm -f */build/port_rand.i */build/ptracers_set_iolabel.i ) |
| 164 |
jmc |
1.14 |
if test "x$addExp" != x ; then |
| 165 |
|
|
( cd $gcmDIR/verification |
| 166 |
|
|
listD=`ls -o | grep '^l' | awk '{print $8}' 2> /dev/null` |
| 167 |
|
|
echo " + remove local links: $listD" |
| 168 |
|
|
/bin/rm -f $listD |
| 169 |
|
|
) |
| 170 |
|
|
fi |
| 171 |
|
|
echo "Update $git_code code in dir $gcmDIR :" |
| 172 |
jmc |
1.15 |
( cd $gcmDIR ; git pull ) 2>&1 |
| 173 |
jmc |
1.11 |
retVal=$? |
| 174 |
|
|
if test "x$retVal" != x0 ; then |
| 175 |
|
|
echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit" |
| 176 |
jmc |
1.1 |
exit |
| 177 |
|
|
fi |
| 178 |
jmc |
1.15 |
echo " and checkout master:" |
| 179 |
|
|
( cd $gcmDIR ; git checkout master -- . ) 2>&1 |
| 180 |
jmc |
1.14 |
if test "x$addExp" != x ; then |
| 181 |
|
|
echo "Update $git_other code in dir $gcmDIR/$git_other :" |
| 182 |
jmc |
1.15 |
( cd $gcmDIR/$git_other ; git pull ) 2>&1 |
| 183 |
jmc |
1.14 |
retVal=$? |
| 184 |
|
|
if test "x$retVal" != x0 ; then |
| 185 |
|
|
echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit" |
| 186 |
|
|
exit |
| 187 |
|
|
fi |
| 188 |
jmc |
1.15 |
echo " and checkout master:" |
| 189 |
|
|
( cd $gcmDIR/$git_other ; git checkout master -- . ) 2>&1 |
| 190 |
jmc |
1.1 |
fi |
| 191 |
|
|
fi |
| 192 |
jmc |
1.14 |
|
| 193 |
jmc |
1.1 |
if [ $checkOut -eq 2 ] ; then |
| 194 |
|
|
if test -e $gcmDIR ; then |
| 195 |
|
|
echo -n "Removing working copy: $gcmDIR ..." |
| 196 |
|
|
rm -rf $gcmDIR |
| 197 |
|
|
echo " done" |
| 198 |
|
|
fi |
| 199 |
jmc |
1.14 |
echo "Make a clone of $git_code from repo: $git_repo ..." |
| 200 |
jmc |
1.13 |
git clone $git_repo/${git_code}.git $gcmDIR 2> $tmpFil |
| 201 |
jmc |
1.11 |
retVal=$? |
| 202 |
|
|
if test $retVal = 0 ; then |
| 203 |
|
|
echo ' done' ; rm -f $tmpFil |
| 204 |
|
|
else |
| 205 |
|
|
echo " Error: 'git clone' returned: $retVal" |
| 206 |
|
|
cat $tmpFil ; rm -f $tmpFil |
| 207 |
jmc |
1.1 |
exit |
| 208 |
jmc |
1.11 |
fi |
| 209 |
jmc |
1.14 |
if test "x$addExp" != x ; then |
| 210 |
|
|
echo "Make a clone of $git_other from repo: $git_repo ..." |
| 211 |
|
|
( cd $gcmDIR ; git clone $git_repo/${git_other}.git 2> $tmpFil ) |
| 212 |
|
|
retVal=$? |
| 213 |
|
|
if test $retVal = 0 ; then |
| 214 |
|
|
echo ' done' ; rm -f $tmpFil |
| 215 |
|
|
else |
| 216 |
|
|
echo " Error: 'git clone' returned: $retVal" |
| 217 |
|
|
cat $tmpFil ; rm -f $tmpFil |
| 218 |
|
|
exit |
| 219 |
|
|
fi |
| 220 |
|
|
fi |
| 221 |
jmc |
1.1 |
if test -d $gcmDIR/verification ; then |
| 222 |
|
|
/usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
| 223 |
|
|
/usr/bin/find $gcmDIR -type f | xargs chmod g+r |
| 224 |
|
|
fi |
| 225 |
|
|
fi |
| 226 |
|
|
|
| 227 |
jmc |
1.18 |
#- change dir to $gcmDIR/verification + add link for additional experiments: |
| 228 |
jmc |
1.1 |
if test -e $gcmDIR/verification ; then |
| 229 |
|
|
if [ $checkOut -lt 2 ] ; then |
| 230 |
|
|
echo " dir $gcmDIR/verification exist" ; fi |
| 231 |
|
|
cd $gcmDIR/verification |
| 232 |
|
|
for exp2add in $addExp ; do |
| 233 |
jmc |
1.14 |
test -r $exp2add && /bin/rm -rf $exp2add |
| 234 |
|
|
if test -d ../$git_other/$exp2add ; then |
| 235 |
|
|
echo " add $exp2add link from $git_other" |
| 236 |
|
|
ln -s ../$git_other/$exp2add . |
| 237 |
jmc |
1.1 |
else |
| 238 |
jmc |
1.14 |
echo " missing dir: $git_other/$exp2add" |
| 239 |
|
|
continue |
| 240 |
jmc |
1.1 |
fi |
| 241 |
|
|
done |
| 242 |
|
|
else |
| 243 |
|
|
echo "no dir: $gcmDIR/verification => exit" |
| 244 |
|
|
exit |
| 245 |
|
|
fi |
| 246 |
|
|
|
| 247 |
jmc |
1.23 |
if [ $dblTr -eq 1 ] ; then |
| 248 |
jmc |
1.9 |
#- 0) just make all module header ( *__genmod.mod files) using modified Makefile |
| 249 |
|
|
# <-- skip this step |
| 250 |
jmc |
1.1 |
echo '' |
| 251 |
jmc |
1.9 |
#- 1) just compile ("-nr"), using "-j 4" to speed up |
| 252 |
|
|
echo ./testreport $options -of $OPTFILE \ |
| 253 |
|
|
-j 4 -nr -odir ${dNam}-$sfx |
| 254 |
|
|
./testreport $options -of $OPTFILE \ |
| 255 |
|
|
-j 4 -nr -odir ${dNam}-$sfx |
| 256 |
|
|
nFc=`grep -c '^Y . N N ' tr_out.txt` |
| 257 |
|
|
echo " <= fail to compile $nFc experiments" |
| 258 |
jmc |
1.23 |
options="$options -q" |
| 259 |
jmc |
1.10 |
fi |
| 260 |
jmc |
1.9 |
|
| 261 |
|
|
echo '' |
| 262 |
|
|
#- 2) run and report results ; also finish to compile those who failed with "-j" |
| 263 |
jmc |
1.5 |
#echo ./testreport $options -of $OPTFILE -command \'$mpiCMD\' -mf $MPI_MFile \ |
| 264 |
|
|
echo ./testreport $options -of $OPTFILE \ |
| 265 |
jmc |
1.23 |
-odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org |
| 266 |
jmc |
1.5 |
#./testreport $options -of $OPTFILE -command "$mpiCMD" -mf $MPI_MFile \ |
| 267 |
|
|
./testreport $options -of $OPTFILE \ |
| 268 |
jmc |
1.23 |
-odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org |
| 269 |
jmc |
1.1 |
|
| 270 |
|
|
echo '' |
| 271 |
jmc |
1.9 |
#- 3) test restart and report results |
| 272 |
jmc |
1.5 |
#echo ../tools/do_tst_2+2 -mpi -exe \'$mpiCMD\' -mf $MPI_MFile \ |
| 273 |
|
|
echo ../tools/do_tst_2+2 -mpi \ |
| 274 |
jmc |
1.10 |
-o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org |
| 275 |
jmc |
1.5 |
#../tools/do_tst_2+2 -mpi -exe "$mpiCMD" -mf $MPI_MFile \ |
| 276 |
|
|
../tools/do_tst_2+2 -mpi \ |
| 277 |
jmc |
1.10 |
-o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org |
| 278 |
jmc |
1.1 |
|