1 |
jmc |
1.1 |
#! /usr/bin/env bash |
2 |
|
|
|
3 |
jmc |
1.16 |
# $Header: /u/gcmpack/MITgcm_contrib/test_scripts/ref_machine/test_villon,v 1.15 2019/12/22 17:24:42 jmc Exp $ |
4 |
jmc |
1.1 |
|
5 |
|
|
# Test script for MITgcm that should work on most of the x86_64 Linux machines. |
6 |
|
|
|
7 |
|
|
tst_grp=0 ; if test $# = 1 ; then tst_grp=$1 ; fi |
8 |
|
|
if test $tst_grp != 'a' -a $tst_grp != 'b' ; then |
9 |
|
|
echo "missing or invalid argument (expect: 'a' or 'b') ==> exit" |
10 |
|
|
exit 1 |
11 |
|
|
fi |
12 |
|
|
|
13 |
|
|
#- defaults |
14 |
|
|
#export PATH="$PATH:/usr/local/bin" |
15 |
|
|
if [ -d ~/bin ]; then export PATH=$PATH:~/bin ; fi |
16 |
|
|
#- to get case insensitive "ls" (and order of tested experiments) |
17 |
|
|
export LC_ALL="en_US.UTF-8" |
18 |
|
|
# Turn off stack limit for FIZHI & AD-tests |
19 |
|
|
ulimit -s unlimited |
20 |
|
|
# MPI test (for now, only with gfortran) |
21 |
jmc |
1.9 |
# source $HOME/bin/openmpi.sh |
22 |
jmc |
1.1 |
|
23 |
jmc |
1.3 |
#- method to access CVS: |
24 |
jmc |
1.7 |
cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack' |
25 |
jmc |
1.1 |
# cmdCVS='cvs -d /u/gcmpack' |
26 |
jmc |
1.7 |
# export CVS_RSH=ssh |
27 |
|
|
# cmdCVS='cvs -q -d :ext:jmc@mitgcm.org:/u/gcmpack' |
28 |
jmc |
1.1 |
|
29 |
jmc |
1.3 |
#- which GitHub repository to use and how to access it: |
30 |
jmc |
1.5 |
git_repo='MITgcm'; git_code='MITgcm' ; git_other='verification_other' |
31 |
jmc |
1.1 |
#git_repo='altMITgcm'; #git_code='MITgcm66h' |
32 |
jmc |
1.3 |
#-- |
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 |
jmc |
1.7 |
#------------------------------------------------------------------- |
38 |
jmc |
1.1 |
# checkOut=3 : clone from GitHub and make a new copy (if sepDir) |
39 |
jmc |
1.7 |
# =2 : update (git pull) repo and make a new copy code (switch to 3 if no repo) |
40 |
jmc |
1.1 |
# =1 : skip update but use a new copy (if sepDir) |
41 |
|
|
# =0 : use existing test code ( switch to 1 if missing test code ) |
42 |
|
|
dInWeek=`date +%a` |
43 |
|
|
|
44 |
|
|
dNam=`hostname -s | tr '[:upper:]' '[:lower:]'` |
45 |
|
|
TESTDIR="$HOME/test_${dNam}" |
46 |
|
|
#TESTDIR="/scratch/jmc/test_${dNam}" |
47 |
jmc |
1.9 |
MC=13 ; outDir="${dNam}-${tst_grp}" |
48 |
jmc |
1.12 |
#MC=11 ;#outDir=$dNam |
49 |
jmc |
1.1 |
sepDir=1 |
50 |
|
|
option= |
51 |
|
|
|
52 |
|
|
if test $tst_grp = 'a' ; then |
53 |
|
|
checkOut=2 |
54 |
jmc |
1.8 |
tst_list='mpa mpi mp2+rs mth' |
55 |
jmc |
1.1 |
else |
56 |
|
|
checkOut=1 |
57 |
jmc |
1.11 |
tst_list='adm tlm gfo+rs' |
58 |
jmc |
1.8 |
#tst_list="$tst_list oad" |
59 |
jmc |
1.11 |
#if test "x$dInWeek" = xSun ; then tst_list="$tst_list tlm" ; fi |
60 |
jmc |
1.1 |
fi |
61 |
|
|
echo " test: $outDir ; list='$tst_list'" |
62 |
|
|
|
63 |
|
|
#option="-nc" ; checkOut=0 |
64 |
|
|
#option="-q" ; checkOut=0 |
65 |
|
|
|
66 |
|
|
TODAY=`date +%d` |
67 |
|
|
tmpFil="/tmp/"`basename $0`".$$" |
68 |
|
|
tdir=$TESTDIR |
69 |
|
|
updFile='updated_code' ; today=`date +%Y%m%d` |
70 |
|
|
|
71 |
|
|
if [ $checkOut -le 1 ] ; then |
72 |
|
|
if test -e $tdir/MITgcm_today/doc ; then |
73 |
|
|
echo $tdir/MITgcm_today/doc 'exist' |
74 |
|
|
else |
75 |
|
|
echo -n $tdir/MITgcm_today 'missing ; ' |
76 |
|
|
checkOut=2 |
77 |
|
|
echo "will make a new copy ( checkOut=$checkOut )" |
78 |
|
|
fi |
79 |
|
|
fi |
80 |
|
|
|
81 |
|
|
if [ $checkOut -ge 2 ] ; then |
82 |
|
|
#---- cleaning: |
83 |
|
|
if test -e $tdir ; then |
84 |
|
|
#- remove date/lock-file: |
85 |
|
|
if test -f $tdir/$updFile ; then rm -f $tdir/$updFile ; sleep 2 ; fi |
86 |
|
|
echo -n "Removing working copy: $tdir/MITgcm_today ..." |
87 |
|
|
test -e $tdir/MITgcm_today && rm -rf $tdir/MITgcm_today |
88 |
|
|
else |
89 |
|
|
echo -n "Creating a working dir: $tdir ..." |
90 |
|
|
mkdir $tdir |
91 |
|
|
fi |
92 |
|
|
echo " done" |
93 |
|
|
cd $tdir |
94 |
|
|
|
95 |
|
|
#---- Making a new clone or updating existing one: |
96 |
jmc |
1.2 |
if [ $checkOut -eq 2 ] ; then |
97 |
jmc |
1.5 |
if test -e $git_code/.git/config ; then |
98 |
|
|
echo $git_code/.git/config 'exist' |
99 |
jmc |
1.2 |
else |
100 |
jmc |
1.5 |
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 |
jmc |
1.2 |
checkOut=3 |
109 |
|
|
echo "will get new clone ( checkOut=$checkOut )" |
110 |
|
|
fi |
111 |
jmc |
1.1 |
fi |
112 |
|
|
if [ $checkOut -eq 3 ] ; then |
113 |
jmc |
1.2 |
test -e $git_code && rm -rf $git_code |
114 |
jmc |
1.5 |
echo "Make a clone of $git_code from repo: $git_repo ..." |
115 |
jmc |
1.3 |
git clone $git_repo/${git_code}.git 2> $tmpFil |
116 |
jmc |
1.1 |
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 |
jmc |
1.5 |
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=$? |
130 |
|
|
if test $retVal = 0 ; then |
131 |
|
|
echo ' --> done!' |
132 |
|
|
rm -f $tmpFil |
133 |
|
|
else |
134 |
|
|
echo " Error: 'git clone' returned: $retVal" |
135 |
|
|
cat $tmpFil |
136 |
|
|
rm -f $tmpFil |
137 |
|
|
exit 2 |
138 |
|
|
fi |
139 |
jmc |
1.1 |
else |
140 |
|
|
echo "Updating current clone ( $git_code ) ..." |
141 |
|
|
( cd $git_code ; git pull ) |
142 |
jmc |
1.2 |
retVal=$? |
143 |
|
|
if test $retVal = 0 ; then |
144 |
|
|
echo ' --> done!' |
145 |
|
|
else |
146 |
|
|
echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit" |
147 |
|
|
exit 3 |
148 |
|
|
fi |
149 |
jmc |
1.6 |
( cd $git_code ; git checkout master -- . ) |
150 |
jmc |
1.5 |
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 |
jmc |
1.6 |
( cd $git_other ; git checkout master -- . ) |
160 |
jmc |
1.1 |
fi |
161 |
|
|
#---- making a new working copy: MITgcm_today |
162 |
|
|
rsync -a $git_code/ MITgcm_today --exclude '.git' |
163 |
jmc |
1.5 |
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 |
jmc |
1.1 |
#---- updating "other_input" dir |
170 |
|
|
if test -d other_input ; then |
171 |
|
|
list_dirs=`(cd other_input ; ls 2> /dev/null )` |
172 |
|
|
echo "Updating ( $cmdCVS update -P -d ) 'other_input' extra dirs:" |
173 |
|
|
for exd in $list_dirs ; do |
174 |
|
|
if test -d other_input/$exd/CVS ; then echo " $exd" |
175 |
|
|
( cd other_input/$exd ; $cmdCVS update -P -d ) |
176 |
|
|
fi |
177 |
|
|
done |
178 |
|
|
echo " <-- update of 'other_input' dirs done" |
179 |
|
|
fi |
180 |
|
|
#---- update date/lock-file: |
181 |
|
|
echo $today > $updFile ; sleep 2 ; ls -l $updFile |
182 |
|
|
else |
183 |
|
|
cd $tdir |
184 |
|
|
fi |
185 |
|
|
|
186 |
|
|
#------------------------------------------------------------------------ |
187 |
|
|
|
188 |
|
|
firstTst=`echo $tst_list | awk '{print $1}'` |
189 |
|
|
last_Tst=`echo $tst_list | awk '{print $NF}'` |
190 |
|
|
for tt in $tst_list |
191 |
|
|
do |
192 |
|
|
|
193 |
|
|
echo "================================================================" |
194 |
|
|
typ=`echo $tt | sed 's/+rs//'` |
195 |
|
|
#- define list of additional experiences to test: |
196 |
|
|
addExp='' |
197 |
|
|
if test $typ = 'mpi' ; then |
198 |
jmc |
1.7 |
addExp="offline_cheapaml atm_gray atm_strato" |
199 |
jmc |
1.13 |
addExp="$addExp global_oce_cs32" |
200 |
|
|
addExp="$addExp global_oce_llc90" |
201 |
jmc |
1.7 |
fi |
202 |
jmc |
1.1 |
if test $typ = 'gfo' -o $typ = 'ifc' ; then |
203 |
|
|
addExp="$addExp shelfice_remeshing" |
204 |
|
|
fi |
205 |
jmc |
1.13 |
if test $typ = 'gfo' ; then |
206 |
jmc |
1.1 |
addExp="$addExp global_ocean.gm_k3d" |
207 |
jmc |
1.12 |
addExp="$addExp global_ocean.gm_res" |
208 |
jmc |
1.1 |
fi |
209 |
|
|
#- check day and time: |
210 |
|
|
curDay=`date +%d` ; curHour=`date +%H` |
211 |
|
|
if [ $curDay -ne $TODAY ] ; then |
212 |
|
|
date ; echo "day is over => skip test $typ" |
213 |
|
|
continue |
214 |
|
|
fi |
215 |
|
|
if [ $curHour -ge 18 ] ; then |
216 |
|
|
date ; echo "too late to run test $typ" |
217 |
|
|
continue |
218 |
|
|
fi |
219 |
|
|
if test $sepDir = 0 -a "x$option" != x -a $tt != $last_Tst ; then |
220 |
|
|
echo "using option='$option' prevent multi-tests => skip test $typ" |
221 |
|
|
continue |
222 |
|
|
fi |
223 |
|
|
#- clean-up old output files |
224 |
|
|
if test -d $tdir/prev ; then |
225 |
|
|
mv -f $tdir/output_${typ}* $tdir/prev |
226 |
|
|
else |
227 |
|
|
rm -f $tdir/output_${typ}* |
228 |
|
|
fi |
229 |
|
|
touch $tdir/output_$tt |
230 |
|
|
echo -n "-- Starting test: $tt at: " >> $tdir/output_$tt |
231 |
|
|
date >> $tdir/output_$tt |
232 |
|
|
echo " typ='$typ', addExp='$addExp'" >> $tdir/output_$tt |
233 |
|
|
if test $sepDir = 1 ; then |
234 |
|
|
new_dir="MITgcm_$typ" |
235 |
|
|
reUse=0 ; if [ $checkOut -le 0 ] ; then reUse=1 ; fi |
236 |
jmc |
1.7 |
if test -d $new_dir/doc -a $reUse = 1 ; then |
237 |
jmc |
1.1 |
cd $tdir/$new_dir |
238 |
|
|
if test $tt != $typ ; then |
239 |
|
|
( cd verification ; ../tools/do_tst_2+2 -clean ) |
240 |
|
|
fi |
241 |
|
|
else |
242 |
|
|
if test -d prev ; then |
243 |
|
|
#-- save previous summary: |
244 |
|
|
oldS=`ls -t ${new_dir}/verification/tr_${outDir}_*/summary.txt 2> /dev/null | head -1` |
245 |
|
|
if test "x$oldS" != x ; then |
246 |
|
|
cat $oldS | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' > prev/tr_out.$typ |
247 |
|
|
touch -r $oldS prev/tr_out.$typ |
248 |
|
|
fi |
249 |
|
|
if test $tt != $typ ; then |
250 |
|
|
oldS=`ls -t ${new_dir}/verification/rs_${outDir}_*/summary.txt 2> /dev/null | head -1` |
251 |
|
|
if test "x$oldS" != x ; then cp -p -f $oldS prev/rs_out.$typ ; fi |
252 |
|
|
fi |
253 |
|
|
fi |
254 |
|
|
echo " remove dir: $new_dir and make new one" >> $tdir/output_$tt |
255 |
|
|
test -e $new_dir && rm -rf $new_dir |
256 |
|
|
mkdir $new_dir |
257 |
|
|
#- before making a copy, check that code has been updated |
258 |
|
|
nCount=0; today=`date +%Y%m%d` |
259 |
|
|
updDate=0 ; test -f $updFile && updDate=`cat $updFile` |
260 |
|
|
while [ $today -gt $updDate ] ; do |
261 |
|
|
nCount=`expr $nCount + 1` |
262 |
|
|
if [ $nCount -gt 40 ] ; then |
263 |
|
|
echo " waiting too long (nCount=$nCount) for updated code" |
264 |
|
|
echo " today=$today , updDate=$updDate " |
265 |
|
|
ls -l $updFile |
266 |
|
|
exit |
267 |
|
|
fi |
268 |
|
|
sleep 60 |
269 |
|
|
updDate=0 ; test -f $updFile && updDate=`cat $updFile` |
270 |
|
|
done |
271 |
|
|
ls -l $updFile | tee -a $tdir/output_$tt |
272 |
|
|
echo " waited nCount=$nCount for updated code ($updDate) to copy" | tee -a $tdir/output_$tt |
273 |
|
|
#----------------------------- |
274 |
|
|
if test -d MITgcm_today -a -d $new_dir ; then |
275 |
|
|
echo " copy main code from MITgcm_today to $new_dir" | tee -a $tdir/output_$tt |
276 |
|
|
cp -ra MITgcm_today/* $new_dir 2>&1 | tee -a $tdir/output_$tt |
277 |
|
|
else |
278 |
|
|
if test -d MITgcm_today ; then |
279 |
|
|
echo " missing dir $new_dir --> end test $tt" | tee -a $tdir/output_$tt |
280 |
|
|
else |
281 |
|
|
echo " missing dir MITgcm_today --> end test $tt" | tee -a $tdir/output_$tt |
282 |
|
|
fi |
283 |
|
|
continue |
284 |
|
|
fi |
285 |
|
|
echo -n " cd $tdir/$new_dir " | tee -a $tdir/output_$tt |
286 |
|
|
cd $tdir/$new_dir |
287 |
|
|
retVal=$? |
288 |
|
|
( echo "(retVal= $retVal )" ; pwd ) | tee -a $tdir/output_$tt |
289 |
|
|
if test -d verification ; then |
290 |
|
|
echo " check: dir verification exist" | tee -a $tdir/output_$tt |
291 |
|
|
else |
292 |
|
|
echo " missing dir verification --> end test $tt" | tee -a $tdir/output_$tt |
293 |
|
|
continue |
294 |
|
|
fi |
295 |
jmc |
1.5 |
if test "x$addExp" != x ; then |
296 |
|
|
echo -n " make a local copy of $git_other ..." | tee -a $tdir/output_$tt |
297 |
|
|
rsync -a $tdir/$git_other/ $git_other --exclude '.git' |
298 |
|
|
echo " done" | tee -a $tdir/output_$tt |
299 |
|
|
fi |
300 |
|
|
#-- add additional experience from $git_other |
301 |
jmc |
1.1 |
for exp2add in $addExp ; do |
302 |
jmc |
1.5 |
echo " add link: $exp2add (from $git_other )" | tee -a $tdir/output_$tt |
303 |
|
|
( cd verification ; ln -s ../$git_other/$exp2add . ) |
304 |
jmc |
1.1 |
if test $exp2add = 'global_oce_cs32' ; then |
305 |
jmc |
1.5 |
echo " link dir 'other_input/core2_cnyf' in here" | tee -a $tdir/output_$tt |
306 |
jmc |
1.10 |
( cd ${git_other}/${exp2add} |
307 |
jmc |
1.1 |
ln -s ../../../other_input/core2_cnyf . ) |
308 |
|
|
fi |
309 |
jmc |
1.10 |
if test $exp2add = 'global_oce_llc90' ; then |
310 |
|
|
echo " link dir 'other_input/gael_oce_llc90_input' to 'input_fields'" \ |
311 |
|
|
| tee -a $tdir/output_$tt |
312 |
|
|
( cd ${git_other}/${exp2add} |
313 |
|
|
test -L input_fields && /bin/rm -f input_fields |
314 |
|
|
ln -s ../../../other_input/gael_oce_llc90_input input_fields |
315 |
|
|
echo " link dirs: 'core2_cnyf' & 'global_oce_input_fields/*' in input_verifs" \ |
316 |
|
|
| tee -a $tdir/output_$tt |
317 |
|
|
test ! -e input_verifs && mkdir input_verifs |
318 |
|
|
( cd input_verifs ; /bin/rm -f * |
319 |
|
|
ln -s ../../../../other_input/core2_cnyf . |
320 |
|
|
ln -s ../../../../other_input/global_oce_input_fields/* . ) |
321 |
|
|
) |
322 |
|
|
fi |
323 |
jmc |
1.4 |
#if test $exp2add = 'shelfice_remeshing' ; then |
324 |
|
|
# echo " link dir 'other_input/remeshing_code' to 'extra_code'" | tee -a $tdir/output_$tt |
325 |
jmc |
1.10 |
# ( cd ${git_other}/${exp2add} |
326 |
jmc |
1.4 |
# ln -s ../../../other_input/remeshing_code extra_code ) |
327 |
|
|
#fi |
328 |
jmc |
1.1 |
done |
329 |
|
|
fi |
330 |
|
|
else |
331 |
|
|
cd $tdir/MITgcm_today |
332 |
|
|
fi |
333 |
|
|
cd verification |
334 |
|
|
|
335 |
|
|
#-- set the testreport command: |
336 |
|
|
comm="./testreport" |
337 |
|
|
if test $typ = 'g7a' -o $typ = 'adm' -o $typ = 'mpa' ; then |
338 |
|
|
comm="$comm -adm" |
339 |
|
|
elif test $typ = 'oad' ; then |
340 |
|
|
comm="$comm -oad" |
341 |
|
|
elif test $typ = 'tlm' ; then |
342 |
|
|
comm="$comm -tlm" |
343 |
|
|
elif test $typ = 'mth' -o $typ = 'mp2' ; then |
344 |
|
|
export GOMP_STACKSIZE=400m |
345 |
|
|
export OMP_NUM_THREADS=2 |
346 |
|
|
comm="$comm -mth" |
347 |
|
|
else |
348 |
|
|
comm="$comm -md cyrus-makedepend" |
349 |
|
|
fi |
350 |
|
|
comm="$comm -odir $outDir -a jm_c@mitgcm.org" |
351 |
|
|
#-- set the optfile (+ mpi & match-precision) |
352 |
|
|
MPI=0 |
353 |
|
|
case $typ in |
354 |
|
|
'g77'|'g7a') OPTFILE='../tools/build_options/linux_amd64_g77' ;; |
355 |
jmc |
1.15 |
'gfo'|'adm'|'oad'|'tlm'|'mth') comm="$comm -devel" |
356 |
|
|
comm="$comm -match $MC" |
357 |
jmc |
1.1 |
OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
358 |
|
|
'ifc') comm="$comm -devel" |
359 |
|
|
OPTFILE='../tools/build_options/linux_amd64_ifort11' ;; |
360 |
|
|
'pgi') OPTFILE='../tools/build_options/linux_amd64_pgf77' ;; |
361 |
jmc |
1.16 |
'mpa'|'mpi'|'mp2') comm="$comm -devel" ; MPI=8 |
362 |
|
|
comm="$comm -match $MC" |
363 |
jmc |
1.1 |
OPTFILE='../tools/build_options/linux_amd64_gfortran' ;; |
364 |
|
|
*) OPTFILE= ;; |
365 |
|
|
esac |
366 |
|
|
#-- set MPI command: |
367 |
|
|
if test $MPI != 0 ; then |
368 |
|
|
if test $typ = 'mp2' ; then MPI=3 ; fi |
369 |
|
|
if test $typ = 'mpa' ; then |
370 |
|
|
EXE="mpirun -np TR_NPROC ./mitgcmuv_ad" |
371 |
|
|
else |
372 |
|
|
EXE="mpirun -np TR_NPROC ./mitgcmuv" |
373 |
|
|
fi |
374 |
|
|
fi |
375 |
|
|
|
376 |
|
|
#-- set specific Env Vars: |
377 |
|
|
if test $typ = 'oad' ; then |
378 |
|
|
#- for some reasons, "source ScriptFile | tee -a LogFile" |
379 |
|
|
# does run the script but does not keep the env-var settings |
380 |
|
|
source $HOME/mitgcm/bin/setenv_OpenAD.sh >> $tdir/output_$tt |
381 |
|
|
fi |
382 |
|
|
if test $typ = 'ifc' ; then |
383 |
|
|
source /srv/software/intel/intel-11.1.073/bin/ifortvars.sh intel64 |
384 |
|
|
fi |
385 |
|
|
if test $typ = 'pgi' ; then |
386 |
|
|
#listT='fizhi-cs-32x32x40 fizhi-cs-aqualev20' |
387 |
|
|
export PGI=/srv/software/pgi/pgi-10.9 |
388 |
|
|
export PATH="$PATH:$PGI/linux86-64/10.9/bin" |
389 |
|
|
export LM_LICENSE_FILE=$PGI/license.dat |
390 |
|
|
fi |
391 |
|
|
|
392 |
|
|
if test $sepDir = 0 -a "x$option" = x -a $tt = $firstTst -a $checkOut = 0 ; then |
393 |
|
|
#-- cleaning: |
394 |
|
|
echo "======================" |
395 |
|
|
echo "Cleaning test directories:" | tee -a $tdir/output_$tt |
396 |
|
|
cmdCLN="./testreport -clean" |
397 |
|
|
echo " clean dir running: $cmdCLN" | tee -a $tdir/output_$tt |
398 |
|
|
$cmdCLN >> $tdir/output_$tt 2>&1 |
399 |
|
|
echo "======================" |
400 |
|
|
echo "" | tee -a $tdir/output_$tt |
401 |
|
|
fi |
402 |
|
|
|
403 |
|
|
#-- run the testreport command: |
404 |
|
|
echo -n "Running testreport using:" | tee -a $tdir/output_$tt |
405 |
|
|
if test "x$OPTFILE" != x ; then |
406 |
|
|
comm="$comm -of=$OPTFILE" |
407 |
|
|
fi |
408 |
|
|
if test $MPI = 0 ; then echo '' | tee -a $tdir/output_$tt |
409 |
|
|
else echo " (EXE='$EXE')" | tee -a $tdir/output_$tt |
410 |
|
|
comm="$comm -MPI $MPI -command \"\$EXE\"" |
411 |
|
|
fi |
412 |
|
|
if test "x$option" != x ; then comm="$comm $option" ; fi |
413 |
|
|
#if test $typ = 'pgi' ; then comm="$comm -t \"\$listT\"" ; fi |
414 |
|
|
echo " \"eval $comm\"" | tee -a $tdir/output_$tt |
415 |
|
|
echo "======================" |
416 |
|
|
eval $comm >> $tdir/output_$tt 2>&1 |
417 |
|
|
sed -n "/^An email /,/^======== End of testreport / p" $tdir/output_$tt |
418 |
|
|
echo "" | tee -a $tdir/output_$tt |
419 |
|
|
|
420 |
|
|
#-- also test restart (test 2+2=4) |
421 |
|
|
if test $tt != $typ |
422 |
|
|
then |
423 |
|
|
echo "testing restart using:" | tee -a $tdir/output_$tt |
424 |
|
|
comm="../tools/do_tst_2+2 -o $outDir -a jm_c@mitgcm.org" |
425 |
|
|
if test $MPI = 0 ; then |
426 |
|
|
echo " \"$comm\"" | tee -a $tdir/output_$tt |
427 |
|
|
echo "======================" |
428 |
|
|
$comm >> $tdir/output_$tt 2>&1 |
429 |
|
|
else |
430 |
|
|
echo " \"$comm -mpi -exe $EXE\"" | tee -a $tdir/output_$tt |
431 |
|
|
echo "======================" |
432 |
|
|
$comm -mpi -exe "$EXE" >> $tdir/output_$tt 2>&1 |
433 |
|
|
fi |
434 |
|
|
echo ; cat tst_2+2_out.txt |
435 |
|
|
echo |
436 |
|
|
fi |
437 |
|
|
export OMP_NUM_THREADS=1 |
438 |
|
|
|
439 |
|
|
if test $sepDir = 0 ; then |
440 |
|
|
#-- cleaning: |
441 |
|
|
echo "======================" |
442 |
|
|
echo "Cleaning test directories:" | tee -a $tdir/output_$tt |
443 |
|
|
if test $tt != $typ ; then |
444 |
|
|
cmdCLN="../tools/do_tst_2+2 -clean" |
445 |
|
|
echo " clean tst_2+2 running: $cmdCLN" | tee -a $tdir/output_$tt |
446 |
|
|
$cmdCLN >> $tdir/output_$tt 2>&1 |
447 |
|
|
fi |
448 |
|
|
if test $tt != $last_Tst ; then |
449 |
|
|
cmdCLN="./testreport -clean" |
450 |
|
|
echo " clean dir running: $cmdCLN" | tee -a $tdir/output_$tt |
451 |
|
|
$cmdCLN >> $tdir/output_$tt 2>&1 |
452 |
|
|
fi |
453 |
|
|
echo "======================" |
454 |
|
|
echo |
455 |
|
|
fi |
456 |
|
|
cd $tdir |
457 |
|
|
|
458 |
|
|
done |