| 1 |
jmc |
1.1 |
#! /usr/bin/env bash |
| 2 |
|
|
|
| 3 |
jmc |
1.21 |
# $Header: /u/gcmpack/MITgcm_contrib/test_scripts/other/testing_loc,v 1.20 2015/03/02 13:40:25 jmc Exp $ |
| 4 |
jmc |
1.1 |
# $Name: $ |
| 5 |
|
|
|
| 6 |
jmc |
1.9 |
if test $# = 0 ; then |
| 7 |
|
|
echo 'need 1 argument' |
| 8 |
|
|
exit |
| 9 |
jmc |
1.6 |
else |
| 10 |
jmc |
1.9 |
if test $1 = ifort ; then |
| 11 |
jmc |
1.11 |
# tst_list='iadm imp2 iur4' |
| 12 |
|
|
tst_list='iad4 imp2 iur4' |
| 13 |
jmc |
1.19 |
dd1=`date +%d -d "1 day"` |
| 14 |
|
|
if test $dd1 != '01' ; then echo 'not last day of month'; exit ; fi |
| 15 |
jmc |
1.9 |
elif test $1 = gfort ; then |
| 16 |
jmc |
1.12 |
# tst_list='gadm gads gmp2 gmpi gfo g77' |
| 17 |
jmc |
1.17 |
tst_list='gadm gads gmp2 gfo' |
| 18 |
jmc |
1.15 |
elif test $1 = gfor4 ; then |
| 19 |
jmc |
1.17 |
tst_list='gad4 gmp4 gfo4 g77' |
| 20 |
jmc |
1.9 |
else |
| 21 |
|
|
tst_list=$* |
| 22 |
|
|
fi |
| 23 |
jmc |
1.6 |
fi |
| 24 |
jmc |
1.11 |
echo "run: \""`basename $0` $*"\" on:" `date` |
| 25 |
|
|
echo " tst_list='$tst_list'" |
| 26 |
jmc |
1.1 |
|
| 27 |
jmc |
1.19 |
#- to get ~/bin in the patch (for staf) when run on cron: |
| 28 |
|
|
if [ -d ~/bin ]; then |
| 29 |
|
|
echo 'add ~/bin to $PATH' |
| 30 |
|
|
export PATH=$PATH:~/bin |
| 31 |
|
|
fi |
| 32 |
|
|
#- to get case insensitive "ls" (and order of tested experiments) |
| 33 |
|
|
#export LC_ALL="en_US.UTF-8" |
| 34 |
|
|
#- Turn off stack limit for FIZHI & AD-tests |
| 35 |
|
|
ulimit -s unlimited |
| 36 |
|
|
#- method to acces CVS: |
| 37 |
|
|
cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q' |
| 38 |
|
|
|
| 39 |
jmc |
1.9 |
#-- for now, cannot mix ifort/gfortran tests: |
| 40 |
|
|
gfort=1 |
| 41 |
|
|
for tt in $tst_list |
| 42 |
|
|
do |
| 43 |
|
|
echo $tt | grep '^g' > /dev/null 2>&1 ; retv=$? |
| 44 |
|
|
if [ $retv -eq 0 -a $gfort -ge 1 ] ; then gfort=2 |
| 45 |
|
|
elif [ $retv -ne 0 -a $gfort -le 1 ] ; then gfort=0 |
| 46 |
|
|
else echo 'cannot mix ifort/gfortran' ; exit |
| 47 |
|
|
fi |
| 48 |
|
|
done |
| 49 |
|
|
if [ $gfort -eq 0 ] ; then |
| 50 |
jmc |
1.18 |
echo 'source ~jmc/bin/intel_v14.sh' |
| 51 |
|
|
source ~jmc/bin/intel_v14.sh |
| 52 |
jmc |
1.21 |
#echo 'source ~jmc/bin/intel_v15.sh' |
| 53 |
|
|
#source ~jmc/bin/intel_v15.sh |
| 54 |
jmc |
1.9 |
fi |
| 55 |
|
|
if [ $gfort -eq 2 ] ; then |
| 56 |
|
|
echo 'source ~jmc/bin/openmpi.sh' |
| 57 |
|
|
source ~jmc/bin/openmpi.sh |
| 58 |
|
|
fi |
| 59 |
|
|
|
| 60 |
|
|
#-------------------------------------------------------------------- |
| 61 |
jmc |
1.1 |
for tt in $tst_list |
| 62 |
|
|
do |
| 63 |
|
|
|
| 64 |
|
|
echo "==========================================================================" |
| 65 |
jmc |
1.15 |
# set -x |
| 66 |
|
|
rm -f tr_clean_$tt.log |
| 67 |
|
|
echo $tt | grep '^.ad' > /dev/null 2>&1 ; fwd=$? |
| 68 |
|
|
echo " testing tt= $tt , fwd= $fwd" |
| 69 |
jmc |
1.21 |
if test -d MITgcm_$tt/verification ; then |
| 70 |
|
|
#- cleaning previous testreport run and updating the code: |
| 71 |
|
|
if [ $fwd -eq 0 ] ; then |
| 72 |
|
|
set -x |
| 73 |
|
|
#- cleanup previous test: |
| 74 |
|
|
( cd MITgcm_$tt/verification ; ./testreport -adm -clean > ../../tr_clean_$tt.log 2>&1 ) |
| 75 |
|
|
set +x |
| 76 |
|
|
else |
| 77 |
|
|
set -x |
| 78 |
jmc |
1.1 |
#- cleanup previous restart: |
| 79 |
jmc |
1.21 |
( cd MITgcm_$tt/verification ; ../tools/do_tst_2+2 -clean > ../../tr_clean_$tt.log 2>&1 ) |
| 80 |
jmc |
1.1 |
#- cleanup previous test: |
| 81 |
jmc |
1.21 |
( cd MITgcm_$tt/verification ; ./testreport -clean >> ../../tr_clean_$tt.log 2>&1 ) |
| 82 |
|
|
set +x |
| 83 |
|
|
fi |
| 84 |
jmc |
1.14 |
if [ $gfort -eq 0 ] ; then |
| 85 |
|
|
echo ' remove all Makefile_syntax and do "cvs update -P -d"' >> tr_clean_$tt.log |
| 86 |
|
|
( cd MITgcm_$tt/verification ; rm -f */build/Makefile_syntax ) |
| 87 |
|
|
else |
| 88 |
jmc |
1.19 |
echo " run '$cmdCVS update -P -d'" >> tr_clean_$tt.log |
| 89 |
jmc |
1.14 |
fi |
| 90 |
jmc |
1.1 |
echo "" |
| 91 |
|
|
|
| 92 |
|
|
echo "==========================================================================" |
| 93 |
|
|
set -x |
| 94 |
jmc |
1.21 |
#- update the code: |
| 95 |
jmc |
1.19 |
( cd MITgcm_$tt ; $cmdCVS update -P -d >> ../tr_clean_$tt.log 2>&1 ) |
| 96 |
jmc |
1.1 |
set +x |
| 97 |
jmc |
1.21 |
else |
| 98 |
|
|
#- download new code: |
| 99 |
|
|
echo " run '$cmdCVS co -P -d MITgcm_$tt MITgcm'" >> tr_clean_$tt.log |
| 100 |
|
|
echo "==========================================================================" |
| 101 |
|
|
set -x |
| 102 |
|
|
$cmdCVS co -P -d MITgcm_$tt MITgcm >> tr_clean_$tt.log 2>&1 |
| 103 |
|
|
set +x |
| 104 |
|
|
fi |
| 105 |
jmc |
1.1 |
echo "" |
| 106 |
|
|
echo "==========================================================================" |
| 107 |
|
|
|
| 108 |
jmc |
1.21 |
if test -d MITgcm_$tt/verification ; then |
| 109 |
jmc |
1.8 |
if test -e tr_run_$tt.log ; then mv -f tr_run_$tt.log tr_run_$tt.log_bak ; fi |
| 110 |
jmc |
1.1 |
cd MITgcm_$tt/verification |
| 111 |
|
|
|
| 112 |
|
|
date |
| 113 |
|
|
# verbose mode: |
| 114 |
|
|
set -x |
| 115 |
|
|
pwd |
| 116 |
jmc |
1.19 |
test -e tr_out.txt && mv -f tr_out.txt tr_out.sav |
| 117 |
jmc |
1.1 |
|
| 118 |
jmc |
1.9 |
case $tt in |
| 119 |
|
|
'iadm' ) |
| 120 |
jmc |
1.6 |
|
| 121 |
jmc |
1.19 |
./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_ifort11 \ |
| 122 |
jmc |
1.20 |
-devel -nc -ncad -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1 |
| 123 |
jmc |
1.12 |
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 124 |
jmc |
1.6 |
|
| 125 |
jmc |
1.19 |
./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_ifort11 \ |
| 126 |
jmc |
1.17 |
-devel -q -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 127 |
jmc |
1.6 |
|
| 128 |
jmc |
1.12 |
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 129 |
jmc |
1.9 |
;; |
| 130 |
jmc |
1.6 |
|
| 131 |
jmc |
1.10 |
'iad4' ) |
| 132 |
|
|
|
| 133 |
jmc |
1.19 |
./testreport -MPI 3 -ur4 -adm -of ../tools/build_options/linux_amd64_ifort11 \ |
| 134 |
jmc |
1.20 |
-devel -nc -ncad -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1 |
| 135 |
jmc |
1.12 |
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 136 |
jmc |
1.10 |
|
| 137 |
jmc |
1.19 |
./testreport -MPI 3 -ur4 -adm -of ../tools/build_options/linux_amd64_ifort11 \ |
| 138 |
jmc |
1.17 |
-devel -q -match 5 -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 139 |
jmc |
1.10 |
|
| 140 |
jmc |
1.12 |
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 141 |
jmc |
1.10 |
;; |
| 142 |
|
|
|
| 143 |
jmc |
1.9 |
'imp2') |
| 144 |
jmc |
1.1 |
|
| 145 |
|
|
export OMP_NUM_THREADS=2 |
| 146 |
|
|
export KMP_STACKSIZE=400m |
| 147 |
|
|
|
| 148 |
jmc |
1.19 |
./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_ifort11 \ |
| 149 |
jmc |
1.8 |
-devel -nc -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1 |
| 150 |
jmc |
1.12 |
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 151 |
jmc |
1.6 |
|
| 152 |
jmc |
1.19 |
./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_ifort11 \ |
| 153 |
jmc |
1.17 |
-devel -q -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 154 |
jmc |
1.1 |
|
| 155 |
jmc |
1.12 |
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 156 |
jmc |
1.1 |
|
| 157 |
|
|
#- test restart: |
| 158 |
|
|
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 159 |
jmc |
1.17 |
../tools/do_tst_2+2 -mpi -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 160 |
jmc |
1.9 |
;; |
| 161 |
jmc |
1.1 |
|
| 162 |
jmc |
1.9 |
'iur4') |
| 163 |
jmc |
1.5 |
|
| 164 |
jmc |
1.19 |
./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_ifort11 \ |
| 165 |
jmc |
1.8 |
-devel -nc -repl_mk do_make_syntax.sh -obj -dd > ../../tr_run_$tt.log 2>&1 |
| 166 |
jmc |
1.12 |
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 167 |
jmc |
1.1 |
|
| 168 |
jmc |
1.19 |
./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_ifort11 \ |
| 169 |
jmc |
1.17 |
-devel -q -match 5 -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 170 |
jmc |
1.1 |
|
| 171 |
jmc |
1.12 |
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 172 |
jmc |
1.1 |
|
| 173 |
|
|
#- test restart: |
| 174 |
|
|
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 175 |
jmc |
1.17 |
../tools/do_tst_2+2 -mpi -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 176 |
jmc |
1.9 |
;; |
| 177 |
|
|
|
| 178 |
|
|
'gadm') |
| 179 |
|
|
|
| 180 |
jmc |
1.19 |
./testreport -MPI 3 -adm -of ../tools/build_options/linux_amd64_gfortran \ |
| 181 |
jmc |
1.20 |
-devel -ncad -nc -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 182 |
jmc |
1.9 |
|
| 183 |
jmc |
1.12 |
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 184 |
jmc |
1.9 |
;; |
| 185 |
|
|
|
| 186 |
|
|
'gads') |
| 187 |
|
|
|
| 188 |
jmc |
1.19 |
./testreport -adm -of ../tools/build_options/linux_amd64_gfortran \ |
| 189 |
jmc |
1.20 |
-devel -ncad -nc -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 190 |
jmc |
1.9 |
|
| 191 |
jmc |
1.12 |
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 192 |
jmc |
1.9 |
;; |
| 193 |
|
|
|
| 194 |
jmc |
1.15 |
'gad4') |
| 195 |
|
|
|
| 196 |
jmc |
1.19 |
./testreport -adm -ur4 -of ../tools/build_options/linux_amd64_gfortran \ |
| 197 |
jmc |
1.20 |
-devel -ncad -nc -match 5 -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 198 |
jmc |
1.15 |
|
| 199 |
|
|
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 200 |
|
|
;; |
| 201 |
|
|
|
| 202 |
jmc |
1.9 |
'gmp2') |
| 203 |
|
|
|
| 204 |
|
|
export OMP_NUM_THREADS=2 |
| 205 |
|
|
export GOMP_STACKSIZE=400m |
| 206 |
|
|
|
| 207 |
jmc |
1.19 |
./testreport -MPI 2 -mth -of ../tools/build_options/linux_amd64_gfortran \ |
| 208 |
jmc |
1.17 |
-devel -nc -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 209 |
jmc |
1.9 |
|
| 210 |
jmc |
1.12 |
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 211 |
jmc |
1.9 |
|
| 212 |
|
|
#- test restart: |
| 213 |
|
|
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 214 |
jmc |
1.17 |
../tools/do_tst_2+2 -mpi -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 215 |
jmc |
1.9 |
;; |
| 216 |
|
|
|
| 217 |
|
|
'gmpi') |
| 218 |
|
|
|
| 219 |
jmc |
1.19 |
./testreport -MPI 3 -of ../tools/build_options/linux_amd64_gfortran \ |
| 220 |
jmc |
1.17 |
-devel -nc -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 221 |
jmc |
1.9 |
|
| 222 |
jmc |
1.12 |
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 223 |
jmc |
1.9 |
|
| 224 |
|
|
#- test restart: |
| 225 |
|
|
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 226 |
jmc |
1.17 |
../tools/do_tst_2+2 -mpi -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 227 |
jmc |
1.9 |
;; |
| 228 |
jmc |
1.1 |
|
| 229 |
jmc |
1.15 |
'gmp4') |
| 230 |
|
|
|
| 231 |
jmc |
1.19 |
./testreport -MPI 3 -ur4 -of ../tools/build_options/linux_amd64_gfortran \ |
| 232 |
jmc |
1.17 |
-devel -nc -match 5 -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 233 |
jmc |
1.15 |
|
| 234 |
|
|
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 235 |
|
|
|
| 236 |
|
|
#- test restart: |
| 237 |
|
|
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 238 |
jmc |
1.17 |
../tools/do_tst_2+2 -mpi -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 239 |
jmc |
1.15 |
;; |
| 240 |
|
|
|
| 241 |
jmc |
1.9 |
'gfo') |
| 242 |
|
|
|
| 243 |
jmc |
1.19 |
./testreport -of ../tools/build_options/linux_amd64_gfortran \ |
| 244 |
jmc |
1.9 |
-devel -nc -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 245 |
|
|
|
| 246 |
jmc |
1.12 |
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 247 |
jmc |
1.9 |
|
| 248 |
|
|
#- test restart: |
| 249 |
|
|
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 250 |
|
|
../tools/do_tst_2+2 -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 251 |
|
|
;; |
| 252 |
|
|
|
| 253 |
jmc |
1.15 |
'gfo4') |
| 254 |
|
|
|
| 255 |
jmc |
1.19 |
./testreport -ur4 -of ../tools/build_options/linux_amd64_gfortran \ |
| 256 |
jmc |
1.17 |
-devel -nc -match 5 -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 257 |
jmc |
1.15 |
|
| 258 |
|
|
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 259 |
|
|
|
| 260 |
|
|
#- test restart: |
| 261 |
|
|
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 262 |
|
|
../tools/do_tst_2+2 -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 263 |
|
|
;; |
| 264 |
|
|
|
| 265 |
jmc |
1.9 |
'g77') |
| 266 |
|
|
|
| 267 |
jmc |
1.19 |
./testreport -of ../tools/build_options/linux_amd64_g77 \ |
| 268 |
jmc |
1.9 |
-skd 'fizhi-cs-32x32x40 fizhi-cs-aqualev20' \ |
| 269 |
|
|
-nc -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 270 |
|
|
|
| 271 |
jmc |
1.12 |
sed -n "/ email /,/^======== End of testreport / p" ../../tr_run_$tt.log |
| 272 |
jmc |
1.9 |
|
| 273 |
|
|
#- test restart: |
| 274 |
|
|
echo '' >> ../../tr_run_$tt.log 2>&1 |
| 275 |
|
|
../tools/do_tst_2+2 -a jmc@mitgcm.org >> ../../tr_run_$tt.log 2>&1 |
| 276 |
|
|
;; |
| 277 |
|
|
|
| 278 |
|
|
*) echo "unrecognized test suffix '$tt' <== skipped" ;; |
| 279 |
|
|
esac |
| 280 |
jmc |
1.1 |
|
| 281 |
|
|
set +x |
| 282 |
|
|
cd ../.. |
| 283 |
|
|
|
| 284 |
jmc |
1.21 |
else |
| 285 |
|
|
echo "error: missing dir MITgcm_$tt/verification" |
| 286 |
|
|
fi |
| 287 |
|
|
|
| 288 |
jmc |
1.1 |
done |