18 |
# Turn off stack limit for FIZHI & AD-tests |
# Turn off stack limit for FIZHI & AD-tests |
19 |
ulimit -s unlimited |
ulimit -s unlimited |
20 |
# MPI test (for now, only with gfortran) |
# MPI test (for now, only with gfortran) |
21 |
source $HOME/bin/openmpi.sh |
# source $HOME/bin/openmpi.sh |
22 |
|
|
23 |
#- method to acces CVS: |
#- method to access CVS: |
24 |
# cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack' |
cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack' |
25 |
# cmdCVS='cvs -d /u/gcmpack' |
# cmdCVS='cvs -d /u/gcmpack' |
26 |
export CVS_RSH=ssh |
# export CVS_RSH=ssh |
27 |
cmdCVS='cvs -q -d :ext:jmc@mitgcm.org:/u/gcmpack' |
# cmdCVS='cvs -q -d :ext:jmc@mitgcm.org:/u/gcmpack' |
28 |
|
|
29 |
#- and which GitHub repository to use: |
#- which GitHub repository to use and how to access it: |
30 |
git_repo='MITgcm'; git_code='MITgcm' |
git_repo='MITgcm'; git_code='MITgcm' ; git_other='verification_other' |
31 |
#git_repo='altMITgcm'; #git_code='MITgcm66h' |
#git_repo='altMITgcm'; #git_code='MITgcm66h' |
32 |
|
#-- |
33 |
|
git_repo="https://github.com/$git_repo" |
34 |
|
#git_repo="git://github.com/$git_repo" |
35 |
|
#git_repo="git@github.com:$git_repo" |
36 |
|
|
37 |
|
#------------------------------------------------------------------- |
38 |
# checkOut=3 : clone from GitHub and make a new copy (if sepDir) |
# checkOut=3 : clone from GitHub and make a new copy (if sepDir) |
39 |
# =2 : update (git pull) repo and make a new copy code (switch to 2 if no repo) |
# =2 : update (git pull) repo and make a new copy code (switch to 3 if no repo) |
40 |
# =1 : skip update but use a new copy (if sepDir) |
# =1 : skip update but use a new copy (if sepDir) |
41 |
# =0 : use existing test code ( switch to 1 if missing test code ) |
# =0 : use existing test code ( switch to 1 if missing test code ) |
42 |
dInWeek=`date +%a` |
dInWeek=`date +%a` |
43 |
|
|
44 |
dNam=`hostname -s | tr '[:upper:]' '[:lower:]'` |
dNam=`hostname -s | tr '[:upper:]' '[:lower:]'` |
45 |
TESTDIR="$HOME/test_${dNam}" |
TESTDIR="$HOME/test_${dNam}" |
|
outDir=$dNam |
|
|
MC=11 |
|
46 |
#TESTDIR="/scratch/jmc/test_${dNam}" |
#TESTDIR="/scratch/jmc/test_${dNam}" |
47 |
#outDir="${dNam}-${tst_grp}" |
MC=13 ; outDir="${dNam}-${tst_grp}" |
48 |
#MC=13 |
#MC=11 ;#outDir=$dNam |
49 |
sepDir=1 |
sepDir=1 |
50 |
option= |
option= |
51 |
|
|
52 |
if test $tst_grp = 'a' ; then |
if test $tst_grp = 'a' ; then |
53 |
checkOut=2 |
checkOut=2 |
54 |
#tst_list='g7a mpa mth mp2+rs mpi oad' |
tst_list='mpa mpi mp2+rs mth' |
|
tst_list='mpa adm mpi gfo+rs mth+rs' |
|
|
tst_list="$tst_list oad" |
|
55 |
else |
else |
56 |
checkOut=1 |
checkOut=1 |
57 |
tst_list='adm g77 gfo+rs ifc' |
tst_list='adm tlm gfo+rs' |
58 |
if test "x$dInWeek" = xSun ; then tst_list="$tst_list tlm" ; fi |
#tst_list="$tst_list oad" |
59 |
|
#if test "x$dInWeek" = xSun ; then tst_list="$tst_list tlm" ; fi |
60 |
fi |
fi |
61 |
echo " test: $outDir ; list='$tst_list'" |
echo " test: $outDir ; list='$tst_list'" |
62 |
|
|
94 |
|
|
95 |
#---- Making a new clone or updating existing one: |
#---- Making a new clone or updating existing one: |
96 |
if [ $checkOut -eq 2 ] ; then |
if [ $checkOut -eq 2 ] ; then |
97 |
if test -e MITgcm/.git/config ; then |
if test -e $git_code/.git/config ; then |
98 |
echo MITgcm/.git/config 'exist' |
echo $git_code/.git/config 'exist' |
99 |
else |
else |
100 |
echo -n MITgcm/.git/config 'missing ; ' |
echo -n $git_code/.git/config 'missing ; ' |
101 |
|
checkOut=3 |
102 |
|
echo "will get new clone ( checkOut=$checkOut )" |
103 |
|
fi |
104 |
|
if test -e $git_other/.git/config ; then |
105 |
|
echo $git_other/.git/config 'exist' |
106 |
|
else |
107 |
|
echo -n $git_other/.git/config 'missing ; ' |
108 |
checkOut=3 |
checkOut=3 |
109 |
echo "will get new clone ( checkOut=$checkOut )" |
echo "will get new clone ( checkOut=$checkOut )" |
110 |
fi |
fi |
111 |
fi |
fi |
112 |
if [ $checkOut -eq 3 ] ; then |
if [ $checkOut -eq 3 ] ; then |
113 |
test -e $git_code && rm -rf $git_code |
test -e $git_code && rm -rf $git_code |
114 |
echo -n "Make a clone of $git_code from repo: $git_repo ..." |
echo "Make a clone of $git_code from repo: $git_repo ..." |
115 |
git clone https://github.com/$git_repo/${git_code}.git 2> $tmpFil |
git clone $git_repo/${git_code}.git 2> $tmpFil |
116 |
|
retVal=$? |
117 |
|
if test $retVal = 0 ; then |
118 |
|
echo ' --> done!' |
119 |
|
rm -f $tmpFil |
120 |
|
else |
121 |
|
echo " Error: 'git clone' returned: $retVal" |
122 |
|
cat $tmpFil |
123 |
|
rm -f $tmpFil |
124 |
|
exit 2 |
125 |
|
fi |
126 |
|
test -e $git_other && rm -rf $git_other |
127 |
|
echo "Make a clone of $git_other from repo: $git_repo ..." |
128 |
|
git clone $git_repo/${git_other}.git 2> $tmpFil |
129 |
retVal=$? |
retVal=$? |
130 |
if test $retVal = 0 ; then |
if test $retVal = 0 ; then |
131 |
echo ' --> done!' |
echo ' --> done!' |
146 |
echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit" |
echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit" |
147 |
exit 3 |
exit 3 |
148 |
fi |
fi |
149 |
|
( cd $git_code ; git checkout master -- . ) |
150 |
|
echo "Updating current clone ( $git_other ) ..." |
151 |
|
( cd $git_other ; git pull ) |
152 |
|
retVal=$? |
153 |
|
if test $retVal = 0 ; then |
154 |
|
echo ' --> done!' |
155 |
|
else |
156 |
|
echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit" |
157 |
|
exit 3 |
158 |
|
fi |
159 |
|
( cd $git_other ; git checkout master -- . ) |
160 |
fi |
fi |
|
|
|
161 |
#---- making a new working copy: MITgcm_today |
#---- making a new working copy: MITgcm_today |
|
( cd $git_code ; git checkout master ) |
|
|
# mkdir MITgcm_today |
|
|
# cp -p -ra $git_code/* MITgcm_today |
|
162 |
rsync -a $git_code/ MITgcm_today --exclude '.git' |
rsync -a $git_code/ MITgcm_today --exclude '.git' |
163 |
|
if test $sepDir = 0 ; then |
164 |
|
echo -n " make a local copy of $git_other in MITgcm_today ..." | tee -a $tdir/output_$tt |
165 |
|
( cd MITgcm_today |
166 |
|
rsync -a ../$git_other/ $git_other --exclude '.git' ) |
167 |
|
echo " done" | tee -a $tdir/output_$tt |
168 |
|
fi |
169 |
#---- updating "other_input" dir |
#---- updating "other_input" dir |
170 |
if test -d other_input ; then |
if test -d other_input ; then |
171 |
list_dirs=`(cd other_input ; ls 2> /dev/null )` |
list_dirs=`(cd other_input ; ls 2> /dev/null )` |
195 |
#- define list of additional experiences to test: |
#- define list of additional experiences to test: |
196 |
addExp='' |
addExp='' |
197 |
if test $typ = 'mpi' ; then |
if test $typ = 'mpi' ; then |
198 |
addExp="offline_cheapaml atm_gray" |
addExp="offline_cheapaml atm_gray atm_strato" |
199 |
|
addExp="$addExp global_oce_cs32" |
200 |
|
addExp="$addExp global_oce_llc90" |
201 |
|
fi |
202 |
|
if test $typ = 'mpa' ; then |
203 |
|
addExp="$addExp global_oce_cs32" |
204 |
fi |
fi |
205 |
if test $typ = 'gfo' -o $typ = 'ifc' ; then |
if test $typ = 'gfo' -o $typ = 'ifc' ; then |
|
addExp="$addExp global_oce_biogeo_bling" |
|
206 |
addExp="$addExp shelfice_remeshing" |
addExp="$addExp shelfice_remeshing" |
207 |
fi |
fi |
208 |
if test $typ = 'mpi' ; then |
if test $typ = 'gfo' ; then |
209 |
addExp="$addExp global_ocean.gm_k3d" |
addExp="$addExp global_ocean.gm_k3d" |
210 |
addExp="$addExp global_oce_cs32" |
addExp="$addExp global_ocean.gm_res" |
211 |
fi |
fi |
212 |
#- check day and time: |
#- check day and time: |
213 |
curDay=`date +%d` ; curHour=`date +%H` |
curDay=`date +%d` ; curHour=`date +%H` |
236 |
if test $sepDir = 1 ; then |
if test $sepDir = 1 ; then |
237 |
new_dir="MITgcm_$typ" |
new_dir="MITgcm_$typ" |
238 |
reUse=0 ; if [ $checkOut -le 0 ] ; then reUse=1 ; fi |
reUse=0 ; if [ $checkOut -le 0 ] ; then reUse=1 ; fi |
239 |
if test -d $new_dir/CVS -a $reUse = 1 ; then |
if test -d $new_dir/doc -a $reUse = 1 ; then |
240 |
cd $tdir/$new_dir |
cd $tdir/$new_dir |
241 |
if test $tt != $typ ; then |
if test $tt != $typ ; then |
242 |
( cd verification ; ../tools/do_tst_2+2 -clean ) |
( cd verification ; ../tools/do_tst_2+2 -clean ) |
295 |
echo " missing dir verification --> end test $tt" | tee -a $tdir/output_$tt |
echo " missing dir verification --> end test $tt" | tee -a $tdir/output_$tt |
296 |
continue |
continue |
297 |
fi |
fi |
298 |
#-- download additional experience from Contrib: |
if test "x$addExp" != x ; then |
299 |
|
echo -n " make a local copy of $git_other ..." | tee -a $tdir/output_$tt |
300 |
|
rsync -a $tdir/$git_other/ $git_other --exclude '.git' |
301 |
|
echo " done" | tee -a $tdir/output_$tt |
302 |
|
fi |
303 |
|
#-- add additional experience from $git_other |
304 |
for exp2add in $addExp ; do |
for exp2add in $addExp ; do |
305 |
echo " add dir: $exp2add (from Contrib:verification_other)" | tee -a $tdir/output_$tt |
echo " add link: $exp2add (from $git_other )" | tee -a $tdir/output_$tt |
306 |
( cd verification ; $cmdCVS co -P -d $exp2add \ |
( cd verification ; ln -s ../$git_other/$exp2add . ) |
|
MITgcm_contrib/verification_other/$exp2add > /dev/null ) |
|
307 |
if test $exp2add = 'global_oce_cs32' ; then |
if test $exp2add = 'global_oce_cs32' ; then |
308 |
echo " link dir 'other_input/core2_cnyf' in here" | tee -a $tdir/output_$tt |
echo " link dir 'other_input/core2_cnyf' in here" | tee -a $tdir/output_$tt |
309 |
( cd verification/${exp2add} |
( cd ${git_other}/${exp2add} |
310 |
ln -s ../../../other_input/core2_cnyf . ) |
ln -s ../../../other_input/core2_cnyf . ) |
311 |
fi |
fi |
312 |
if test $exp2add = 'shelfice_remeshing' ; then |
if test $exp2add = 'global_oce_llc90' ; then |
313 |
echo " link dir 'other_input/remeshing_code' to 'extra_code'" | tee -a $tdir/output_$tt |
echo " link dir 'other_input/gael_oce_llc90_input' to 'input_fields'" \ |
314 |
( cd verification/${exp2add} |
| tee -a $tdir/output_$tt |
315 |
ln -s ../../../other_input/remeshing_code extra_code ) |
( cd ${git_other}/${exp2add} |
316 |
|
test -L input_fields && /bin/rm -f input_fields |
317 |
|
ln -s ../../../other_input/gael_oce_llc90_input input_fields |
318 |
|
echo " link dirs: 'core2_cnyf' & 'global_oce_input_fields/*' in input_verifs" \ |
319 |
|
| tee -a $tdir/output_$tt |
320 |
|
test ! -e input_verifs && mkdir input_verifs |
321 |
|
( cd input_verifs ; /bin/rm -f * |
322 |
|
ln -s ../../../../other_input/core2_cnyf . |
323 |
|
ln -s ../../../../other_input/global_oce_input_fields/* . ) |
324 |
|
) |
325 |
fi |
fi |
326 |
|
#if test $exp2add = 'shelfice_remeshing' ; then |
327 |
|
# echo " link dir 'other_input/remeshing_code' to 'extra_code'" | tee -a $tdir/output_$tt |
328 |
|
# ( cd ${git_other}/${exp2add} |
329 |
|
# ln -s ../../../other_input/remeshing_code extra_code ) |
330 |
|
#fi |
331 |
done |
done |
332 |
fi |
fi |
333 |
else |
else |
355 |
MPI=0 |
MPI=0 |
356 |
case $typ in |
case $typ in |
357 |
'g77'|'g7a') OPTFILE='../tools/build_options/linux_amd64_g77' ;; |
'g77'|'g7a') OPTFILE='../tools/build_options/linux_amd64_g77' ;; |
358 |
'gfo'|'adm'|'oad'|'tlm'|'mth') comm="$comm -match $MC -devel" |
'gfo'|'adm'|'oad'|'tlm'|'mth') comm="$comm -devel" |
359 |
|
comm="$comm -match $MC" |
360 |
OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
361 |
'ifc') comm="$comm -devel" |
'ifc') comm="$comm -devel" |
362 |
OPTFILE='../tools/build_options/linux_amd64_ifort11' ;; |
OPTFILE='../tools/build_options/linux_amd64_ifort11' ;; |
363 |
'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; |
'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; |
364 |
'mpa'|'mpi'|'mp2') comm="$comm -match $MC -devel" ; MPI=8 |
'mpa'|'mpi'|'mp2') comm="$comm -devel" |
365 |
|
if test $typ = 'mp2' ; then MPI=3 ; else MPI=8 ; fi |
366 |
|
comm="$comm -match $MC" |
367 |
OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
368 |
*) OPTFILE= ;; |
*) OPTFILE= ;; |
369 |
esac |
esac |
370 |
#-- set MPI command: |
#-- set MPI command: Use default (Dec 2020) which is the same since testreport update on Sep 2013 |
|
if test $MPI != 0 ; then |
|
|
if test $typ = 'mp2' ; then MPI=3 ; fi |
|
|
if test $typ = 'mpa' ; then |
|
|
EXE="mpirun -np TR_NPROC ./mitgcmuv_ad" |
|
|
else |
|
|
EXE="mpirun -np TR_NPROC ./mitgcmuv" |
|
|
fi |
|
|
fi |
|
|
|
|
371 |
#-- set specific Env Vars: |
#-- set specific Env Vars: |
372 |
if test $typ = 'oad' ; then |
if test $typ = 'oad' ; then |
373 |
#- for some reasons, "source ScriptFile | tee -a LogFile" |
#- for some reasons, "source ScriptFile | tee -a LogFile" |
400 |
if test "x$OPTFILE" != x ; then |
if test "x$OPTFILE" != x ; then |
401 |
comm="$comm -of=$OPTFILE" |
comm="$comm -of=$OPTFILE" |
402 |
fi |
fi |
403 |
if test $MPI = 0 ; then echo '' | tee -a $tdir/output_$tt |
echo '' | tee -a $tdir/output_$tt |
404 |
else echo " (EXE='$EXE')" | tee -a $tdir/output_$tt |
if test $MPI != 0 ; then comm="$comm -MPI $MPI" ; fi |
|
comm="$comm -MPI $MPI -command \"\$EXE\"" |
|
|
fi |
|
405 |
if test "x$option" != x ; then comm="$comm $option" ; fi |
if test "x$option" != x ; then comm="$comm $option" ; fi |
406 |
#if test $typ = 'pgi' ; then comm="$comm -t \"\$listT\"" ; fi |
#if test $typ = 'pgi' ; then comm="$comm -t \"\$listT\"" ; fi |
407 |
echo " \"eval $comm\"" | tee -a $tdir/output_$tt |
echo " \"eval $comm\"" | tee -a $tdir/output_$tt |
420 |
echo "======================" |
echo "======================" |
421 |
$comm >> $tdir/output_$tt 2>&1 |
$comm >> $tdir/output_$tt 2>&1 |
422 |
else |
else |
423 |
echo " \"$comm -mpi -exe $EXE\"" | tee -a $tdir/output_$tt |
echo " \"$comm -mpi\"" | tee -a $tdir/output_$tt |
424 |
echo "======================" |
echo "======================" |
425 |
$comm -mpi -exe "$EXE" >> $tdir/output_$tt 2>&1 |
$comm -mpi >> $tdir/output_$tt 2>&1 |
426 |
fi |
fi |
427 |
echo ; cat tst_2+2_out.txt |
echo ; cat tst_2+2_out.txt |
428 |
echo |
echo |