14 |
echo "where possible OPTIONS are:" |
echo "where possible OPTIONS are:" |
15 |
echo " (-h|-help) print usage" |
echo " (-h|-help) print usage" |
16 |
echo " (-v|-verbose) verbose mode" |
echo " (-v|-verbose) verbose mode" |
17 |
|
echo " (-t|-test4update) do nothing if previous output newer than" |
18 |
|
echo " emails-processing log-file '$PRC_MAILS'" |
19 |
echo " (-l |-list )MACHINES check platforms from this list" |
echo " (-l |-list )MACHINES check platforms from this list" |
20 |
echo " [def=\"$MACHINES\"]" |
echo " [def=\"$MACHINES\"]" |
21 |
echo " (-d |-day )FIRSTDAY select output from day=\"YYYYMMDD\"" |
echo " (-d |-day )FIRSTDAY select output from day=\"YYYYMMDD\"" |
101 |
fi |
fi |
102 |
fi |
fi |
103 |
|
|
104 |
ADJOINT= |
ADJOINT=0 |
105 |
TANGLIN= |
TANGLIN=0 |
106 |
|
OPENAD=0 |
107 |
RESTART=0 |
RESTART=0 |
108 |
|
EXTRA= |
109 |
FAST=0 |
FAST=0 |
110 |
DVLP=0 |
DVLP=0 |
111 |
MPI=0 |
MPI=0 |
112 |
MTH=0 |
MTH=0 |
113 |
UR4=0 |
UR4=0 |
114 |
if test -r $dir/summary.txt ; then |
if test -r $dir/summary.txt ; then |
115 |
comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null` |
ADJOINT=`grep -c -i '^ADJOINT' $dir/summary.txt` |
116 |
eval $comm |
if test "x$ADJOINT" = x1 ; then |
117 |
comm=`grep 'TANGLIN=true' $dir/summary.txt 2>/dev/null` |
OPENAD=`grep -c '^Adjoint .* OpenAD' $dir/summary.txt` |
118 |
eval $comm |
fi |
119 |
|
TANGLIN=`grep -c -i '^TANGLIN' $dir/summary.txt` |
120 |
|
if test "x$TANGLIN" = x1 ; then |
121 |
|
OPENAD=`grep -c '^TangLin .* OpenAD' $dir/summary.txt` |
122 |
|
fi |
123 |
RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt` |
RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt` |
124 |
FAST=`grep -c "^run: .*testreport.* '*-fast'*" $dir/summary.txt` |
comm=`grep '^run: .*testreport.* ' $dir/summary.txt` |
125 |
|
EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"` |
126 |
|
if test "x$EXTRA" = x ; then |
127 |
|
EXTRA=`echo "$comm" | grep " -*-t\>" | sed -e "s/^.*-*-t\>//" -e "s/ -.*$//"` |
128 |
|
fi |
129 |
|
if test "x$EXTRA" = x ; then EXTRA=0 ; else |
130 |
|
#echo -n "EXTRA=$EXTRA" |
131 |
|
nn0=`echo $EXTRA | sed "s/ *' *//g" | wc -w` |
132 |
|
nn1=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<monod_"` |
133 |
|
nn2=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<darwin_"` |
134 |
|
EXTRA=1 |
135 |
|
if [ $nn1 -ge 2 ] ; then EXTRA=2 ; fi |
136 |
|
if [ $nn2 -ge 2 ] ; then EXTRA=3 ; fi |
137 |
|
#echo " : nn0=$nn0 ; nn1=$nn1 ; nn2=$nn2" |
138 |
|
fi |
139 |
|
FAST=`echo "$comm" | grep -c " -*-fast\>"` |
140 |
if test "x$FAST" = x0 ; then |
if test "x$FAST" = x0 ; then |
141 |
FAST=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt` |
FAST=`echo "$comm" | grep -c " '*-noieee'*"` |
142 |
fi |
fi |
143 |
DVLP=`grep -c "^run: .*testreport.* '*-devel'*" $dir/summary.txt` |
DVLP=`echo "$comm" | grep -c " -*-devel\>"` |
144 |
MPI=`grep -c "^run: .*testreport.* -mpi " $dir/summary.txt` |
MPI=`echo "$comm" | grep -c " -*-mpi\>"` |
145 |
if test "x$MPI" = x0 ; then |
if test "x$MPI" = x0 ; then |
146 |
MPI=`grep -c "^run: .*testreport.* -MPI " $dir/summary.txt` |
MPI=`echo "$comm" | grep -c " -*-MPI\>"` |
147 |
fi |
fi |
148 |
MTH=`grep -c "^run: .*testreport.* -mth" $dir/summary.txt` |
MTH=`echo "$comm" | grep -c " -*-mth\>"` |
149 |
UR4=`grep -c "^run: .*testreport.* -use_r4 " $dir/summary.txt` |
UR4=`echo "$comm" | grep -c " -*-use_r4\>"` |
150 |
if test "x$UR4" = x0 ; then |
if test "x$UR4" = x0 ; then |
151 |
UR4=`grep -c "^run: .*testreport.* -ur4 " $dir/summary.txt` |
UR4=`echo "$comm" | grep -c " -*-ur4\>"` |
152 |
fi |
fi |
153 |
fi |
fi |
154 |
if test "x$ADJOINT" = xtrue ; then |
if test "x$ADJOINT" = x1 ; then |
155 |
kind="adjoint" ; order='000' |
kind="adm-TAF" ; order=0 |
156 |
elif test "x$TANGLIN" = xtrue ; then |
if test "x$OPENAD" = x1 ; then kind="adm-OAD" ; order=2 ; fi |
157 |
kind="tanglin" ; order='001' |
elif test "x$TANGLIN" = x1 ; then |
158 |
|
kind="tlm-TAF" ; order=1 |
159 |
|
if test "x$OPENAD" = x1 ; then kind="tlm-OAD" ; order=3 ; fi |
160 |
elif test "x$RESTART" = x0 ; then |
elif test "x$RESTART" = x0 ; then |
161 |
kind="forward" ; order='002' |
kind="forward" ; order=4 |
162 |
else |
else |
163 |
kind="restart" ; order='003' |
kind="restart" ; order=5 |
164 |
fi |
fi |
165 |
|
order=`expr $order + 10 \* $EXTRA` |
166 |
|
order=`printf '%3.3i' $order` |
167 |
if test "x$UR4" = x1 ; then |
if test "x$UR4" = x1 ; then |
168 |
OPTFILE="${OPTFILE}.use_r4" |
OPTFILE="${OPTFILE}.use_r4" |
169 |
fi |
fi |
215 |
|
|
216 |
#CURR_PER=`date +%Y`"_"`date +%m` |
#CURR_PER=`date +%Y`"_"`date +%m` |
217 |
CURR_DAY=`date +%Y%m%d` |
CURR_DAY=`date +%Y%m%d` |
218 |
|
PRC_MAILS='prc_emails_'`date +%m%d` |
219 |
# defaults |
# defaults |
220 |
MACHINES='_All_' |
MACHINES='_All_' |
221 |
FIRSTDAY=$CURR_DAY |
FIRSTDAY=$CURR_DAY |
225 |
NBLDIFF=5 |
NBLDIFF=5 |
226 |
ADDRESS='none' |
ADDRESS='none' |
227 |
dBug=f |
dBug=f |
228 |
|
t4update=0 |
229 |
sTime=`date` |
sTime=`date` |
230 |
#- to get case insensitive "ls" (and order of tested experiments) |
#- to get case insensitive "ls" (and order of tested experiments) |
231 |
export LC_ALL="en_US.UTF-8" |
export LC_ALL="en_US.UTF-8" |
247 |
|
|
248 |
-help | --help | -h | --h) usage ;; |
-help | --help | -h | --h) usage ;; |
249 |
-verbose | --verbose | -v | --v) dBug=t ;; |
-verbose | --verbose | -v | --v) dBug=t ;; |
250 |
|
-test4update | --test4update | -t | --t) t4update=1 ;; |
251 |
|
|
252 |
-list | --list | -l | --l) ac_prev=MACHINES ;; |
-list | --list | -l | --l) ac_prev=MACHINES ;; |
253 |
-list=* | --list=*) MACHINES=$ac_optarg ;; |
-list=* | --list=*) MACHINES=$ac_optarg ;; |
304 |
|
|
305 |
#INDIR="/net/orwell/export/export-9/mitgcm-testing/results/$PERIOD" |
#INDIR="/net/orwell/export/export-9/mitgcm-testing/results/$PERIOD" |
306 |
INDIR="/u/u0/httpd/html/testing/results/$PERIOD" |
INDIR="/u/u0/httpd/html/testing/results/$PERIOD" |
307 |
#INDIR="/export/export-7/u/u2/jmc/mitgcm/test_web/results/$PERIOD" |
#INDIR="/u/u2/jmc/mitgcm/test_web/results/$PERIOD" |
308 |
|
|
309 |
|
#- a short summary of this checking : |
310 |
|
OUTPSUM=`echo $LASTDAY | sed 's/^20../_/'` |
311 |
|
OUTPSUM=`basename $0`"$OUTPSUM.txt" |
312 |
|
|
313 |
if test $OUTPFIL = '-1' ; then |
if test $OUTPFIL = '-1' ; then |
314 |
OUTPFIL='TTT.'$$ |
OUTPFIL='TTT.'$$ |
315 |
|
fi |
316 |
|
if test $t4update = 1 ; then |
317 |
|
if test -f $PRC_MAILS -a -f $OUTPSUM -a $FIRSTDAY = $CURR_DAY ; then |
318 |
|
#- if update-log-file is older than previous output summary, just return |
319 |
|
if test $PRC_MAILS -ot $OUTPSUM ; then |
320 |
|
echo ' '$CMDLINE | tee -a $OUTPSUM |
321 |
|
echo " t4update: skip "`basename $0`" ( $PRC_MAILS older than $OUTPSUM )" | tee -a $OUTPSUM |
322 |
|
echo "End time: "`date` | tee -a $OUTPSUM |
323 |
|
exit 0 |
324 |
|
else |
325 |
|
if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi |
326 |
|
echo " t4update: run "`basename $0`" ( $PRC_MAILS newer than $OUTPSUM )" | tee $OUTPFIL |
327 |
|
fi |
328 |
|
else |
329 |
|
if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi |
330 |
|
echo " t4update ignored (not current day or $PRC_MAILS or $OUTPSUM missing)" | tee $OUTPFIL |
331 |
|
fi |
332 |
elif test -e $OUTPFIL ; then |
elif test -e $OUTPFIL ; then |
333 |
mv -f $OUTPFIL $OUTPFIL'_bak' |
mv -f $OUTPFIL $OUTPFIL'_bak' |
334 |
|
touch $OUTPFIL |
335 |
fi |
fi |
336 |
echo "CMDLINE='$CMDLINE'" > $OUTPFIL |
if test -e $OUTPSUM ; then mv -f $OUTPSUM $OUTPSUM'_bak' ; fi |
337 |
|
echo ' '$CMDLINE > $OUTPSUM |
338 |
|
|
339 |
|
echo "CMDLINE='$CMDLINE'" >> $OUTPFIL |
340 |
echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'" >> $OUTPFIL |
echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'" >> $OUTPFIL |
341 |
echo "INDIR='$INDIR'" >> $OUTPFIL |
echo "INDIR='$INDIR'" >> $OUTPFIL |
342 |
echo "Checking latest output from $FIRSTDAY until $LASTDAY" >> $OUTPFIL |
echo "Checking latest output from $FIRSTDAY until $LASTDAY" >> $OUTPFIL |
359 |
exit 3 |
exit 3 |
360 |
fi |
fi |
361 |
|
|
|
#- a short summary of this checking : |
|
|
OUTPSUM=`echo $LASTDAY | sed 's/^20../_/'` |
|
|
OUTPSUM=`basename $0`"$OUTPSUM.txt" |
|
|
if test -e $OUTPSUM ; then mv -f $OUTPSUM $OUTPSUM'_bak' ; fi |
|
|
echo ' '$CMDLINE > $OUTPSUM |
|
|
|
|
362 |
if test $FIRSTDAY = $LASTDAY ; then |
if test $FIRSTDAY = $LASTDAY ; then |
363 |
echo -n "Checking latest output from $FIRSTDAY" | tee -a $OUTPSUM |
echo -n "Checking latest output from $FIRSTDAY" | tee -a $OUTPSUM |
364 |
else |
else |
375 |
( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all |
( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all |
376 |
|
|
377 |
if test "x$MACHINES" = "x_All_" ; then |
if test "x$MACHINES" = "x_All_" ; then |
378 |
MACHINES="faulks meander aces- acesgrid baudelaire dickens danton beagle harbor" |
MACHINES="aces- acesgrid baudelaire dickens danton beagle" |
379 |
MACHINES="$MACHINES pleiades iblade rays solasrv sx8" |
MACHINES="$MACHINES pleiades iblade sx8 uv100 solasrv stomp weber" |
|
MACHINES="$MACHINES trane dodongo dokdo stomp bigred" |
|
380 |
|
|
381 |
MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq` |
MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq` |
382 |
for madd in $MALL ; do |
for madd in $MALL ; do |
422 |
keys=`cat ./slist | cut -d " " -f 1 | sort | uniq` |
keys=`cat ./slist | cut -d " " -f 1 | sort | uniq` |
423 |
|
|
424 |
for key in $keys ; do |
for key in $keys ; do |
425 |
ctot=`expr $ctot + 1` |
ctot=`expr $ctot + 1` |
426 |
sline=`grep "^$key " ./slist | head -1` |
sline=`grep "^$key " ./slist | head -1` |
427 |
sdir=`echo $sline | cut -d " " -f 5` |
sdir=`echo $sline | cut -d " " -f 5` |
428 |
type=`echo $sline | cut -d " " -f 4` |
type=`echo $sline | cut -d " " -f 4` |
463 |
xx=`( echo 5 ; sed -n '/^ OPTFILE=/=' $outp ) | tail -1` |
xx=`( echo 5 ; sed -n '/^ OPTFILE=/=' $outp ) | tail -1` |
464 |
sed "1,$xx d" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \ |
sed "1,$xx d" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \ |
465 |
| grep -v '^[A-S][a-t]* time: ' > tmpfp |
| grep -v '^[A-S][a-t]* time: ' > tmpfp |
466 |
#-- re-order list of exp (according to local "sort" order) |
#-- check if list of exp are the same (and in the same order) |
467 |
listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort` |
sed 's/ (e=.*, w=.*)$//' tmpfs > tmpfn |
468 |
for xx in $listD |
listDs=`grep '^[YN] [YN] [YN] [YN]' tmpfn | awk '{print $NF}'` |
469 |
do |
#mv -f tmpfn tmpfs |
470 |
sed "/ $xx\$/d" tmpfs > tmpfn |
rm -f tmpfn |
471 |
sed -n "/ $xx\$/p" tmpfs >> tmpfn |
sed 's/ (e=.*, w=.*)$//' tmpfp > tmpfn |
472 |
mv tmpfn tmpfs |
listDp=`grep '^[YN] [YN] [YN] [YN]' tmpfn | awk '{print $NF}'` |
473 |
done |
#mv -f tmpfn tmpfp |
474 |
listD=`grep '^[YN] [YN] [YN] [YN]' tmpfp | awk '{print $NF}' | sort` |
rm -f tmpfn |
475 |
for xx in $listD |
#echo "listDs='$listDs'" ; echo "listDp='$listDp'" |
476 |
do |
if test "$listDs" != "$listDp" ; then |
477 |
sed "/ $xx\$/d" tmpfp > tmpfn |
if test $dBug = 't' ; then echo ' -> re-order list of exp' ; fi |
478 |
sed -n "/ $xx\$/p" tmpfp >> tmpfn |
#-- re-order list of exp (according to local "sort" order) |
479 |
mv tmpfn tmpfp |
listDs=`echo "$listDs" | sort` |
480 |
done |
for xx in $listDs ; do |
481 |
|
sed -e "/ $xx\$/d" -e "/ $xx /d" tmpfs > tmpfn |
482 |
|
sed -n -e "/ $xx\$/p" -e "/ $xx /p" tmpfs >> tmpfn |
483 |
|
mv -f tmpfn tmpfs |
484 |
|
done |
485 |
|
listDp=`echo "$listDp" | sort` |
486 |
|
for xx in $listDp ; do |
487 |
|
sed -e "/ $xx\$/d" -e "/ $xx /d" tmpfp > tmpfn |
488 |
|
sed -n -e "/ $xx\$/p" -e "/ $xx /p" tmpfp >> tmpfn |
489 |
|
mv -f tmpfn tmpfp |
490 |
|
done |
491 |
|
#else |
492 |
|
# echo 'same list of exp => skip re-ordering' |
493 |
|
fi |
494 |
echo -n "=== diff $sdir $pdir :" | tee -a $OUTPFIL |
echo -n "=== diff $sdir $pdir :" | tee -a $OUTPFIL |
495 |
diff tmpfs tmpfp > tmpdf |
diff tmpfs tmpfp > tmpdf |
496 |
yy=$? |
yy=$? |