--- mitgcm.org/scripts/check_outp 2008/08/29 18:12:15 1.2 +++ mitgcm.org/scripts/check_outp 2009/07/07 23:32:02 1.15 @@ -1,6 +1,6 @@ #! /usr/bin/env bash -# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/scripts/check_outp,v 1.2 2008/08/29 18:12:15 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/scripts/check_outp,v 1.15 2009/07/07 23:32:02 jmc Exp $ # # The purpose of this script is to compare # the latest output with the previous one (from the same platform with @@ -18,6 +18,7 @@ echo " (-l |-list )MACHINES check platforms from this list" echo " [def=\"$MACHINES\"]" echo " (-d |-day )FIRSTDAY select output from day=\"YYYYMMDD\"" + echo " (argument of \"date -d\" is allowed)" echo " [def=\"$FIRSTDAY\"]" echo " (-u |-upto )LASTDAY until last day=\"YYYYMMDD\" (=selected period)" echo " [def=\"FIRSTDAY\"]" @@ -42,6 +43,8 @@ ADDRESS='none' dBug=f sTime=`date` +#- to get case insensitive "ls" (and order of tested experiments) +export LC_ALL="en_US.UTF-8" # Parse options ac_prev= @@ -101,6 +104,16 @@ esac done +#-- test FIRSTDAY content ; interpret as "date -d" arg. if not YYYYMMDD +ttt=`echo "y$FIRSTDAY" | sed 's/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/z/'` +if test "x$ttt" != 'xyz' ; then + FIRSTDAY=`date -d "$FIRSTDAY" +%Y%m%d` +fi +ttt=`echo "y$FIRSTDAY" | sed 's/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/z/'` +if test "x$ttt" != 'xyz' ; then + echo "Error: FIRSTDAY='$FIRSDAY' not recognized" + exit 2 +fi if test $LASTDAY = "30000000" ; then LASTDAY=$FIRSTDAY ; fi CMDLINE=$0 for xx in "$@" ; do nw=`echo $xx | wc -w` @@ -144,7 +157,7 @@ fi else echo "$INDIR is not a directory" - exit + exit 3 fi #- a short summary of this checking : @@ -165,9 +178,9 @@ ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all if test "x$MACHINES" = "x_All_" ; then - MACHINES="faulks aces eddy bay meander lagoon hugo" - MACHINES="$MACHINES columbia edvir rays sx8 xd1" - MACHINES="$MACHINES beagle batsi starp" + MACHINES="faulks meander lagoon harbor dickens danton aces" + MACHINES="$MACHINES beagle columbia edvir rays solasrv sx8 xd1" + MACHINES="$MACHINES bigred starp" MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq` for madd in $MALL ; do @@ -198,7 +211,7 @@ if test $n == 2 ; then num2=`expr $num1 \* $n` if [ $num0 -lt $num2 ] ; then - dir_list=`( cd $INDIR ; ls -1 -t ../$PREV_P/*${mname}*/summary.txt | sed 's/\/summary.txt//' )` + dir_list=`( cd $INDIR ; ls -1 -t ../$PREV_P/*${mname}*/summary.txt 2> /dev/null | sed 's/\/summary.txt//' )` #echo "dir_list='$dir_list'" fi else @@ -233,11 +246,13 @@ ADJOINT= RESTART=0 NOI3E=0 + MTH=0 if test -r $dir/summary.txt ; then comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null` eval $comm RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt` - NOI3E=`grep -c "^run: .*testreport .* '*-noieee'* " $dir/summary.txt` + NOI3E=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt` + MTH=`grep -c "^run: .*testreport.* -mth" $dir/summary.txt` fi if test "x$RESTART" = x0 ; then kind="forward" @@ -245,6 +260,10 @@ else kind="restart" fi + if test "x$MTH" = x1 ; then + yy=`echo $OPTFILE | grep -c '+mth$'` + if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi + fi if test "x$NOI3E" = x1 ; then OPTFILE="${OPTFILE}.noieee" fi @@ -269,7 +288,7 @@ cat ./slist | tee -a $OUTPFIL fi echo ".... previous list (n=$n):" | tee -a $OUTPFIL - cat ./plist | tee -a $OUTPFIL + cat ./plist | tee -a $OUTPFIL | head -20 fi fi @@ -291,7 +310,10 @@ num=`grep -c "^$key" ./plist` #- discard unsafe test: dd=`echo $optf | grep -c 'gfortran.*mth'` - if [ $dd -ge 1 ] ; then num=-1 ; fi + #if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi + #if test $mname = 'harbor' -a $dd = 1 ; then num=-1 ; fi + #if test $mname = 'aces' -a $optf = 'linux_ia32_open64' ; then num=-1 ; fi + #if test $mname = 'aces' -a $optf = 'linux_ia32_g95' ; then num=-1 ; fi if test $num -gt 0 ; then pline=`grep "^$key " ./plist | head -1` if test $dBug = 't' ; then @@ -301,10 +323,31 @@ pdir=`echo $pline | cut -d " " -f 5` outs="$INDIR/$sdir/summary.txt" sed -n "5,$ p" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \ + | sed 's/ OPTFILE=.*\// OPTFILE=/g' \ | grep -v '^[A-S][a-t]* time: ' > tmpfs outp="$INDIR/$pdir/summary.txt" sed -n "5,$ p" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \ + | sed 's/ OPTFILE=.*\// OPTFILE=/g' \ | grep -v '^[A-S][a-t]* time: ' > tmpfp + #-- re-order list of exp (according to local "sort" order) + listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs \ + | sed 's/^[YN] .*pass //' | sed 's/^[YN] .*FAIL //' \ + | sed 's/^[YN] .*N\/O //' | sort` + for xx in $listD + do + sed "/ $xx\$/d" tmpfs > tmpfn + sed -n "/ $xx\$/p" tmpfs >> tmpfn + mv tmpfn tmpfs + done + listD=`grep '^[YN] [YN] [YN] [YN]' tmpfp \ + | sed 's/^[YN] .*pass //' | sed 's/^[YN] .*FAIL //' \ + | sed 's/^[YN] .*N\/O //' | sort` + for xx in $listD + do + sed "/ $xx\$/d" tmpfp > tmpfn + sed -n "/ $xx\$/p" tmpfp >> tmpfn + mv tmpfn tmpfp + done echo -n "=== diff $sdir $pdir :" | tee -a $OUTPFIL diff tmpfs tmpfp > tmpdf yy=$? @@ -373,4 +416,4 @@ fi echo ".. cat $OUTPSUM" cat $OUTPSUM - +exit 0