/[MITgcm]/mitgcm.org/scripts/check_outp
ViewVC logotype

Diff of /mitgcm.org/scripts/check_outp

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.11 by jmc, Tue Jun 16 20:27:39 2009 UTC revision 1.35 by jmc, Sun Feb 24 15:29:05 2013 UTC
# Line 6  Line 6 
6  #  the latest output with the previous one (from the same platform with  #  the latest output with the previous one (from the same platform with
7  #    same optfile)  #    same optfile)
8    
   
9  usage()  usage()
10  {  {
11      echo      echo
12      echo "Usage:  $0 [OPTIONS]"      echo "Usage:  $0 [OPTIONS]"
13      echo      echo
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"
# Line 22  usage() Line 21  usage()
21      echo "                         [def=\"$FIRSTDAY\"]"      echo "                         [def=\"$FIRSTDAY\"]"
22      echo "  (-u |-upto )LASTDAY   until last day=\"YYYYMMDD\" (=selected period)"      echo "  (-u |-upto )LASTDAY   until last day=\"YYYYMMDD\" (=selected period)"
23      echo "                         [def=\"FIRSTDAY\"]"      echo "                         [def=\"FIRSTDAY\"]"
24        echo "  (-b |-before)BEFORE   compare with output from before \"YYYYMMDD\""
25        echo "                         (=previous period) [def=\"FIRSTDAY\"]"
26      echo "  (-o |-outp )OUTPFIL   output file (-1 removed when exit)"      echo "  (-o |-outp )OUTPFIL   output file (-1 removed when exit)"
27      echo "                         [def=\"$OUTPFIL\"]"      echo "                         [def=\"$OUTPFIL\"]"
28      echo "  (-n |-nldf )NBLDIFF   max number of diff lines to echo"      echo "  (-n |-nldf )NBLDIFF   max number of diff lines to echo"
29      echo "                         [def=\"$NBLDIFF\"]"      echo "                         [def=\"$NBLDIFF\"]"
30      echo "  (-a |-addr )ADDRESS   send summary to mail ADDRESS list"      echo "  (-a |-addr )ADDRESS   send summary to mail ADDRESS list"
31      echo "                         [def=\"$ADDRESS\"]"      echo "                         [def=\"$ADDRESS\"]"
32      echo      echo
33      exit 1      exit 1
34  }  }
35    
36    #  create list of results dir for one platform:
37    make_resdir_list()
38    {
39          if test $monthDir == 1 ; then
40            dir_list=`grep '.._'$mname ./dir_all`
41          else
42            dir_list=`( cd $INDIR ; ls -1 -t ../$PREV_P/??_*${mname}*/summary.txt 2> /dev/null | sed 's/\/summary.txt//' )`
43            #echo "dir_list='$dir_list'"
44          fi
45            for i in $dir_list ; do
46    
47                dir=$INDIR"/"$i
48                #--- get the opfile used to run testreport
49                OPTFILE=
50                if test -r $dir/summary.txt ; then
51                    comm=`grep 'OPTFILE=' $dir/summary.txt`
52                    eval $comm
53                fi
54                if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then
55                    comm=`grep 'OPTFILE=' $dir/genmake_state 2>/dev/null`
56                    eval $comm
57                fi
58                if test "x$OPTFILE" = x ; then
59                    comm=`grep '^# OPTFILE=' $dir/*/Makefile* 2>/dev/null | head -1`
60                    comm=${comm##*#}
61                    eval $comm
62                fi
63                if test "x$OPTFILE" = x ; then
64                    OPTFILE="not_explicitly_specified"
65                else
66                    OPTFILE=${OPTFILE##*/}
67                fi
68                #--- case select test run by 1 user: get user who did run testreport
69                if test "x$sUser" != x ; then
70                    tUser=
71                    if test -f $dir/genmake_state ; then
72                       nn=`sed -n '/^# executed by:/=' $dir/genmake_state`
73                       if test "x$nn" != x ; then
74                         nn=`expr $nn + 1`
75                         tUser=`sed -n "$nn s/^# *// p" $dir/genmake_state | sed 's/@.*$//'`
76                       fi
77                    fi
78                    if test "x$tUser" = "x" ; then
79                       mkfile=`ls $dir/*/Makefile* 2>/dev/null | head -1`
80                       if test "x$mkfile" = 'x' ; then
81                         echo "no Makefile => discard test from: $i" | tee -a $OUTPFIL
82                         continue
83                       fi
84                       nn=`sed -n '/^# executed by:/=' $mkfile`
85                       if test "x$nn" != x ; then
86                         nn=`expr $nn + 1`
87                         tUser=`sed -n "$nn s/^# *// p" $mkfile | sed 's/@.*$//'`
88                       fi
89                    fi
90                    if test "x$tUser" = x ; then
91                         echo "no User found => discard test from: $i" | tee -a $OUTPFIL
92                         continue
93                    fi
94                    if test $tUser != $sUser ; then
95                       if test $dBug = 't' ; then
96                            echo "  discard test from: $i" | tee -a $OUTPFIL
97                       fi
98                       continue
99                    fi
100                fi
101    
102                ADJOINT=
103                TANGLIN=
104                RESTART=0
105                EXTRA=
106                FAST=0
107                DVLP=0
108                MPI=0
109                MTH=0
110                UR4=0
111                if test -r $dir/summary.txt ; then
112                    comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null`
113                    eval $comm
114                    comm=`grep 'TANGLIN=true' $dir/summary.txt 2>/dev/null`
115                    eval $comm
116                    RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
117                    comm=`grep '^run: .*testreport.* ' $dir/summary.txt`
118                    EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"`
119                    if test "x$EXTRA" = x ; then
120                        EXTRA=`echo "$comm" | grep " -*-t\>" | sed -e "s/^.*-*-t\>//" -e "s/ -.*$//"`
121                    fi
122                    if test "x$EXTRA" = x ; then EXTRA=0 ; else
123                        #echo -n "EXTRA=$EXTRA"
124                        nn0=`echo $EXTRA | sed "s/ *' *//g" | wc -w`
125                        nn1=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<monod_"`
126                        nn2=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<darwin_"`
127                        EXTRA=1
128                        if [ $nn1 -ge 2 ] ; then EXTRA=2 ; fi
129                        if [ $nn2 -ge 2 ] ; then EXTRA=3 ; fi
130                        #echo " : nn0=$nn0 ; nn1=$nn1 ; nn2=$nn2"
131                    fi
132                    FAST=`echo "$comm" | grep -c " -*-fast\>"`
133                    if test "x$FAST" = x0 ; then
134                       FAST=`echo "$comm" | grep -c " '*-noieee'*"`
135                    fi
136                    DVLP=`echo "$comm" | grep -c " -*-devel\>"`
137                    MPI=`echo "$comm" | grep -c " -*-mpi\>"`
138                    if test "x$MPI" = x0 ; then
139                       MPI=`echo "$comm" | grep -c " -*-MPI\>"`
140                    fi
141                    MTH=`echo "$comm" | grep -c " -*-mth\>"`
142                    UR4=`echo "$comm" | grep -c " -*-use_r4\>"`
143                    if test "x$UR4" = x0 ; then
144                       UR4=`echo "$comm" | grep -c " -*-ur4\>"`
145                    fi
146                fi
147                if test "x$ADJOINT" = xtrue ; then
148                    kind="adjoint" ; order=0
149                elif test "x$TANGLIN" = xtrue ; then
150                    kind="tanglin" ; order=1
151                elif test "x$RESTART" = x0 ; then
152                    kind="forward" ; order=2
153                else
154                    kind="restart" ; order=3
155                fi
156                order=`expr $order + 10 \* $EXTRA`
157                order=`printf '%3.3i' $order`
158                if test "x$UR4" = x1 ; then
159                    OPTFILE="${OPTFILE}.use_r4"
160                fi
161                if test "x$MPI" = x1 ; then
162                    yy=`echo $OPTFILE | grep -c '+mpi'`
163                    if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi
164                fi
165                if test "x$MTH" = x1 ; then
166                    yy=`echo $OPTFILE | grep -c '+mth$'`
167                    if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi
168                fi
169                if test "x$FAST" = x1 ; then
170                    OPTFILE="${OPTFILE}.fast"
171                fi
172                if test "x$DVLP" = x1 ; then
173                    OPTFILE="${OPTFILE}.dvlp"
174                fi
175                day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`
176                ttt=`echo $day | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`
177                day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`
178    
179                if [ $day -lt $BEFORE ] ; then
180                    echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./plist
181                elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then
182                    echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./slist
183                else
184                    if test $dBug = 't' ; then
185                       echo "discard day='$day' from: $i" | tee -a $OUTPFIL
186                    fi
187                fi
188    
189            done
190            if test $dBug = 't' ; then
191              if test $monthDir == 1 ; then
192                echo "---- current list (n=$monthDir) :" | tee -a $OUTPFIL
193                    cat ./slist | tee -a $OUTPFIL
194              fi
195              num1=`wc -l ./slist | awk '{print $1}'`
196              if test $num1 -gt 0 ; then
197              echo   ".... previous list (n=$monthDir):" | tee -a $OUTPFIL
198                    cat ./plist | tee -a $OUTPFIL | head -20
199              fi
200              echo "----" | tee -a $OUTPFIL
201            fi
202    }
203    
204    #--------------------------------------------------------------------------
205    # here starts the sequential part of the script:
206    
207  #CURR_PER=`date +%Y`"_"`date +%m`  #CURR_PER=`date +%Y`"_"`date +%m`
208  CURR_DAY=`date +%Y%m%d`  CURR_DAY=`date +%Y%m%d`
209  # defaults  # defaults
210  MACHINES='_All_'  MACHINES='_All_'
211  FIRSTDAY=$CURR_DAY  FIRSTDAY=$CURR_DAY
212  LASTDAY="30000000"  LASTDAY="30000000"
213    BEFORE="30000000"
214  OUTPFIL=`basename $0`'.log'  OUTPFIL=`basename $0`'.log'
215  NBLDIFF=5  NBLDIFF=5
216  ADDRESS='none'  ADDRESS='none'
217  dBug=f  dBug=f
218  sTime=`date`  sTime=`date`
219    #- to get case insensitive "ls" (and order of tested experiments)
220    export LC_ALL="en_US.UTF-8"
221    
222  #  Parse options  #  Parse options
223  ac_prev=  ac_prev=
# Line 50  for ac_option ; do Line 225  for ac_option ; do
225    
226      # If the previous option needs an argument, assign it.      # If the previous option needs an argument, assign it.
227      if test -n "$ac_prev"; then      if test -n "$ac_prev"; then
228          eval "$ac_prev=\$ac_option"          eval "$ac_prev=\$ac_option"
229          ac_prev=          ac_prev=
230          continue          continue
231      fi      fi
232    
233      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
234    
235      case $ac_option in      case $ac_option in
236                    
237          -help | --help | -h | --h)          -help | --help | -h | --h) usage ;;
238              usage ;;          -verbose | --verbose | -v | --v) dBug=t ;;
         -verbose | --verbose | -v | --v)  
             dBug=t ;;  
239                    
240          -list  | --list  | -l | --l)          -list  | --list  | -l | --l) ac_prev=MACHINES ;;
241              ac_prev=MACHINES ;;          -list=* | --list=*) MACHINES=$ac_optarg ;;
242          -list=* | --list=*)  
243              MACHINES=$ac_optarg ;;          -day  | --day  | -d | --d) ac_prev=FIRSTDAY ;;
244            -day=* | --day=*) FIRSTDAY=$ac_optarg ;;
245          -day  | --day  | -d | --d)  
246              ac_prev=FIRSTDAY ;;          -upto | --upto | -u | --u) ac_prev=LASTDAY ;;
247          -day=* | --day=*)          -upto=* | --upto=*) LASTDAY=$ac_optarg ;;
248              FIRSTDAY=$ac_optarg ;;  
249            -before | --before | -b | --b) ac_prev=BEFORE ;;
250          -upto | --upto | -u | --u)          -before=* | --before=*) BEFORE=$ac_optarg ;;
251              ac_prev=LASTDAY ;;  
252          -upto=* | --upto=*)          -outp | --outp | -o | --o) ac_prev=OUTPFIL ;;
253              LASTDAY=$ac_optarg ;;          -outp=* | --outp=*) OUTPFIL=$ac_optarg ;;
254    
255          -outp | --outp | -o | --o)          -nldf | --nldf | -n | --n) ac_prev=NBLDIFF ;;
256              ac_prev=OUTPFIL ;;          -nldf=* | --nldf=*) NBLDIFF=$ac_optarg ;;
257          -outp=* | --outp=*)  
258              OUTPFIL=$ac_optarg ;;          -addr | --addr | -a | --a) ac_prev=ADDRESS ;;
259            -addr=* | --addr=*) ADDRESS=$ac_optarg ;;
260          -nldf | --nldf | -n | --n)  
261              ac_prev=NBLDIFF ;;          *) echo "Error: don't understand argument \"$ac_option\""
262          -nldf=* | --nldf=*)             usage ;;
             NBLDIFF=$ac_optarg ;;  
   
         -addr | --addr | -a | --a)  
             ac_prev=ADDRESS ;;  
         -addr=* | --addr=*)  
             ADDRESS=$ac_optarg ;;  
   
         *)  
             echo "Error: don't understand argument \"$ac_option\""  
             usage  
             ;;  
263    
264       esac       esac
265    
# Line 113  if test "x$ttt" != 'xyz' ; then Line 275  if test "x$ttt" != 'xyz' ; then
275    exit 2    exit 2
276  fi  fi
277  if test $LASTDAY = "30000000" ; then LASTDAY=$FIRSTDAY ; fi  if test $LASTDAY = "30000000" ; then LASTDAY=$FIRSTDAY ; fi
278    if test  $BEFORE = "30000000" ; then  BEFORE=$FIRSTDAY ; fi
279  CMDLINE=$0  CMDLINE=$0
280  for xx in "$@" ; do nw=`echo $xx | wc -w`  for xx in "$@" ; do nw=`echo $xx | wc -w`
281    if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"    if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"
282                        else CMDLINE="$CMDLINE '$xx'" ; fi                        else CMDLINE="$CMDLINE '$xx'" ; fi
283  done  done
284    
285  PERIOD=`echo $FIRSTDAY | sed 's/[0-9][0-9]$//'`  PERIOD=`echo $LASTDAY | sed 's/[0-9][0-9]$//'`
286  PP=`expr $PERIOD - 1`  PP=`expr $PERIOD - 1`
287  PM=`echo $PP | sed 's/^[0-9][0-9][0-9][0-9]//'`  PM=`echo $PP | sed 's/^[0-9][0-9][0-9][0-9]//'`
288  PY=`echo $PP | sed 's/[0-9][0-9]$//'`  PY=`echo $PP | sed 's/[0-9][0-9]$//'`
# Line 140  echo "CMDLINE='$CMDLINE'" > $OUTPFIL Line 303  echo "CMDLINE='$CMDLINE'" > $OUTPFIL
303  echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'" >> $OUTPFIL  echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'" >> $OUTPFIL
304  echo "INDIR='$INDIR'" >> $OUTPFIL  echo "INDIR='$INDIR'" >> $OUTPFIL
305  echo "Checking latest output from $FIRSTDAY until $LASTDAY" >> $OUTPFIL  echo "Checking latest output from $FIRSTDAY until $LASTDAY" >> $OUTPFIL
306    echo "  versus latest from before $BEFORE" >> $OUTPFIL
307    
308  if test $dBug = 't' ; then  if test $dBug = 't' ; then
309    echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'"    echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'"
310    echo "FIRSTDAY='$FIRSTDAY' , LASTDAY='$LASTDAY'"    echo "FIRSTDAY='$FIRSTDAY' , LASTDAY='$LASTDAY' , BEFORE='$BEFORE'"
311  fi  fi
312  if test -d $INDIR ; then  if test -d $INDIR ; then
313    dirP=`echo $INDIR | sed "s/$PERIOD/$PREV_P/"`    dirP=`echo $INDIR | sed "s/$PERIOD/$PREV_P/"`
# Line 159  else Line 323  else
323  fi  fi
324    
325  #- a short summary of this checking :  #- a short summary of this checking :
326  OUTPSUM=`echo $FIRSTDAY | sed 's/^20../_/'`  OUTPSUM=`echo $LASTDAY | sed 's/^20../_/'`
327  OUTPSUM=`basename $0`"$OUTPSUM.txt"  OUTPSUM=`basename $0`"$OUTPSUM.txt"
328  if test -e $OUTPSUM ; then mv -f $OUTPSUM $OUTPSUM'_bak' ; fi  if test -e $OUTPSUM ; then mv -f $OUTPSUM $OUTPSUM'_bak' ; fi
329  echo ' '$CMDLINE > $OUTPSUM  echo ' '$CMDLINE > $OUTPSUM
# Line 169  if test $FIRSTDAY = $LASTDAY ; then Line 333  if test $FIRSTDAY = $LASTDAY ; then
333  else  else
334    echo -n "Checking latest output from $FIRSTDAY until $LASTDAY" | tee -a $OUTPSUM    echo -n "Checking latest output from $FIRSTDAY until $LASTDAY" | tee -a $OUTPSUM
335  fi  fi
336  echo " versus latest prior to this period" | tee -a $OUTPSUM  if test $FIRSTDAY = $BEFORE ; then
337      echo " versus latest prior to this period" | tee -a $OUTPSUM
338    else
339      echo " versus latest from before $BEFORE" | tee -a $OUTPSUM
340    fi
341  echo "    Machine   Tot. Nb.   no    Nb with  Nb diff" >> $OUTPSUM  echo "    Machine   Tot. Nb.   no    Nb with  Nb diff" >> $OUTPSUM
342  echo "     name     checked   comp    Diff    lines"  >> $OUTPSUM  echo "     name     checked   comp    Diff    lines"  >> $OUTPSUM
343    
344  ( 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
345    
346  if test "x$MACHINES" = "x_All_" ; then  if test "x$MACHINES" = "x_All_" ; then
347    MACHINES="faulks aces eddy bay meander lagoon hugo"    MACHINES="aces- acesgrid baudelaire dickens danton beagle"
348    MACHINES="$MACHINES columbia edvir rays solasrv sx8 xd1"    MACHINES="$MACHINES pleiades iblade sx8 uv100 solasrv stomp weber"
   MACHINES="$MACHINES beagle batsi starp"  
349    
350    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`
351    for madd in $MALL ; do    for madd in $MALL ; do
352      present=0      present=0
353      for m in $MACHINES ; do      for m in $MACHINES ; do
354          echo $madd | grep $m > /dev/null 2>&1          mm=`echo $m | sed 's/\./ /g' | awk '{print $1}'`
355          RETVAL=$?          echo $madd | grep $mm > /dev/null 2>&1
356          test $RETVAL = 0  &&  present=1          RETVAL=$?
357          continue          test $RETVAL = 0  &&  present=1
358            continue
359      done      done
360      test $present = 0  &&  MACHINES="$MACHINES $madd"      test $present = 0  &&  MACHINES="$MACHINES $madd"
361    done    done
362  fi  fi
363    #echo "MACHINES=$MACHINES" ; exit
364    
365  for mname in $MACHINES ; do  for pname in $MACHINES ; do
366    
367        sname=`echo $pname | sed 's/-$//'`
368        mname=`echo $pname | sed 's/\./ /g' | awk '{print $1}'`
369        sUser=
370        if test $mname != $pname ; then
371          # to select results from user "sUser"
372          sUser=`echo $pname | sed 's/\./ /g' | awk '{print $2}'`
373        fi
374    
375      if test $dBug = 't' ; then echo "  $mname" ; fi      if test $dBug = 't' ; then echo "  $pname" ; fi
376      echo " name='$mname'" >> $OUTPFIL      echo " name='$pname'" >> $OUTPFIL
377      ctot=0 ; cmis=0 ; cdif=0      ctot=0 ; cmis=0 ; cdif=0
378    
379      # put results from selected period in "slist",      # put results from selected period in "slist",
380      #     results from previous period in "plist"      #     results from previous period in "plist"
381      rm -f ./plist ./slist ; touch ./plist ./slist      rm -f ./plist ./slist ; touch ./plist ./slist
382    
383      for n in $listNum ; do      #- create list of results (slist & plist) from current month directory
384        num1=`wc -l ./slist | awk '{print $1}'`      monthDir=1
385        num0=`wc -l ./plist | awk '{print $1}'`      make_resdir_list
       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 2> /dev/null | sed 's/\/summary.txt//' )`  
           #echo "dir_list='$dir_list'"  
         fi  
       else  
         num2=$n  
         dir_list=`grep $mname ./dir_all`  
       fi  
       if [ $num0 -lt $num2 ] ; then  
         for i in $dir_list ; do  
   
             dir=$INDIR"/"$i  
             OPTFILE=  
             if test -r $dir/summary.txt ; then  
                 comm=`grep 'OPTFILE=' $dir/summary.txt`  
                 eval $comm  
                 OPTFILE=${OPTFILE##*/}  
             fi  
             if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then  
                 comm=`grep 'OPTFILE=' $dir/genmake_state 2>/dev/null`  
                 eval $comm  
                 OPTFILE=${OPTFILE##*/}  
             fi  
             if test "x$OPTFILE" = x ; then  
                 comm=`grep '^# OPTFILE=' $dir/*/Makefile* 2>/dev/null | head -1`  
                 comm=${comm##*#}  
                 eval $comm  
                 OPTFILE=${OPTFILE##*/}  
             fi  
             if test "x$OPTFILE" = x ; then  
                 OPTFILE="not_explicitly_specified"  
             fi  
   
             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`  
                 MTH=`grep -c "^run: .*testreport.* -mth " $dir/summary.txt`  
             fi  
             if test "x$RESTART" = x0 ; then  
                 kind="forward"  
                 test "x$ADJOINT" = xtrue  &&  kind="adjoint"  
             else  
                 kind="restart"  
             fi  
             if test "x$NOI3E" = x1 ; then  
                 OPTFILE="${OPTFILE}.noieee"  
             fi  
             if test "x$MTH" = x1 ; then  
                 yy=`echo $OPTFILE | grep -c 'mth$'`  
                 if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi  
             fi  
             day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`  
             ttt=`echo $day | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`  
             day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`  
   
             if [ $day -lt $FIRSTDAY ] ; then  
                 echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./plist  
             elif [ $day -le $LASTDAY ] ; then  
                 echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./slist  
             else  
                 if test $dBug = 't' ; then  
                    echo "discard day='$day' from: $i" | tee -a $OUTPFIL  
                 fi  
             fi  
   
         done  
         if test $dBug = 't' ; then  
           if test $n == 1 ; then  
             echo "---- current list (n=$n) :" | tee -a $OUTPFIL  
                 cat ./slist | tee -a $OUTPFIL  
           fi  
           echo   ".... previous list (n=$n):" | tee -a $OUTPFIL  
                 cat ./plist | tee -a $OUTPFIL | head -20  
         fi  
   
       fi  
     done  
     if test $dBug = 't' ; then echo "----" | tee -a $OUTPFIL ; fi  
386    
387      #  Do we have any data?  If so, create the latest pointer.      #  Do we have any data?  If so, create the latest pointer.
388      num=`wc -l ./slist | awk '{print $1}'`      num=`wc -l ./slist | awk '{print $1}'`
# Line 302  for mname in $MACHINES ; do Line 393  for mname in $MACHINES ; do
393          for key in $keys ; do          for key in $keys ; do
394            ctot=`expr $ctot + 1`            ctot=`expr $ctot + 1`
395            sline=`grep "^$key " ./slist | head -1`            sline=`grep "^$key " ./slist | head -1`
396            sdir=`echo $sline | cut -d " " -f 5`            sdir=`echo $sline | cut -d " " -f 5`
397            kind=`echo $sline | cut -d " " -f 4`            type=`echo $sline | cut -d " " -f 4`
398            optf=`echo $sline | cut -d " " -f 3`            optf=`echo $sline | cut -d " " -f 3`
399            num=`grep -c "^$key" ./plist`            num=`grep -c "^$key" ./plist`
400              if test $num = 0 -a $monthDir = 1 ; then
401              #- add results from previous month directory to "plist".
402                monthDir=2
403                make_resdir_list
404                num=`grep -c "^$key" ./plist`
405              fi
406            #- discard unsafe test:            #- discard unsafe test:
407            dd=`echo $optf | grep -c 'gfortran.*mth'`            dd=`echo $optf | grep -c 'gfortran+mth'`
408            if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi            if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi
409            if test $mname = 'harbor' -a $dd = 1 ; then num=-1 ; fi            if test $mname = 'harbor' -a $dd = 1 ; then num=-1 ; fi
410            if test $mname = 'aces' -a $optf = 'linux_ia32_open64' ; then num=-1 ; fi            #if test $mname = 'aces' -a $optf = 'linux_ia32_open64' ; then num=-1 ; fi
411            if test $mname = 'aces' -a $optf = 'linux_ia32_g95' ; then num=-1 ; fi            #if test $mname = 'aces' -a $optf = 'linux_ia32_g95' ; then num=-1 ; fi
412            if test $num -gt 0 ; then            dd=`echo $optf | grep -c 'bigred.*noieee'`
413              #if test $mname = 'bigred' -a $dd = 1 ; then num=-1 ; fi
414              if test $num -lt 0 ; then
415                echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL
416                cmis=`expr $cmis + 1`
417              elif test $num = '0' ; then
418                echo "no previous test for:" $key | tee -a $OUTPFIL
419                cmis=`expr $cmis + 1`
420              else
421              pline=`grep "^$key " ./plist | head -1`              pline=`grep "^$key " ./plist | head -1`
422              if test $dBug = 't' ; then              if test $dBug = 't' ; then
423                  echo "s='$sline'" | tee -a $OUTPFIL                  echo "s='$sline'" | tee -a $OUTPFIL
424                  echo "p='$pline'" | tee -a $OUTPFIL                  echo "p='$pline'" | tee -a $OUTPFIL
425              fi              fi
426              pdir=`echo $pline | cut -d " " -f 5`              pdir=`echo $pline | cut -d " " -f 5`
427              outs="$INDIR/$sdir/summary.txt"              outs="$INDIR/$sdir/summary.txt"
428              sed -n "5,$ p" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outs ) | tail -1`
429                                   | sed 's/ OPTFILE=.*\// OPTFILE=/g' \              sed "1,$xx d" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
430                                   | grep -v '^[A-S][a-t]* time:  ' > tmpfs                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfs
431              outp="$INDIR/$pdir/summary.txt"              outp="$INDIR/$pdir/summary.txt"
432              sed -n "5,$ p" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outp ) | tail -1`
433                                   | sed 's/ OPTFILE=.*\// OPTFILE=/g' \              sed "1,$xx d" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
434                                   | grep -v '^[A-S][a-t]* time:  ' > tmpfp                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfp
435              #-- re-order list of exp (according to local "sort" order)              #-- re-order list of exp (according to local "sort" order)
436              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs \              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`
                  | sed 's/^[YN] .*pass //' | sed 's/^[YN] .*FAIL //' \  
                  | sed 's/^[YN] .*N\/O  //' | sort`  
437              for xx in $listD              for xx in $listD
438              do              do
439                  sed "/ $xx\$/d" tmpfs > tmpfn                  sed "/ $xx\$/d" tmpfs > tmpfn
440                  sed -n "/ $xx\$/p" tmpfs >> tmpfn                  sed -n "/ $xx\$/p" tmpfs >> tmpfn
441                  mv tmpfn tmpfs                  mv tmpfn tmpfs
442              done              done
443              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfp \              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfp | awk '{print $NF}' | sort`
                  | sed 's/^[YN] .*pass //' | sed 's/^[YN] .*FAIL //' \  
                  | sed 's/^[YN] .*N\/O  //' | sort`  
444              for xx in $listD              for xx in $listD
445              do              do
446                  sed "/ $xx\$/d" tmpfp > tmpfn                  sed "/ $xx\$/d" tmpfp > tmpfn
# Line 350  for mname in $MACHINES ; do Line 451  for mname in $MACHINES ; do
451              diff tmpfs tmpfp > tmpdf              diff tmpfs tmpfp > tmpdf
452              yy=$?              yy=$?
453              if test $yy != '0' ; then              if test $yy != '0' ; then
454                  echo " $kind , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
455                  #grep '^run: ' $outp                  #grep '^run: ' $outp
456                  #grep '^run: ' $outs                  #grep '^run: ' $outs
457                  #-- score for each test:                  #-- score for each test:
# Line 368  for mname in $MACHINES ; do Line 469  for mname in $MACHINES ; do
469                  ndf=`expr $ndf / 2`                  ndf=`expr $ndf / 2`
470                  nn=`grep -c '^---' tmpdf`                  nn=`grep -c '^---' tmpdf`
471                  ndf=`expr $ndf - $nn`                  ndf=`expr $ndf - $nn`
472                  if [ $ndf -le $NBLDIFF ] ; then                  if [ $ndf -le $NBLDIFF ] ; then
473                    cat tmpdf                    cat tmpdf
474                  else                  else
475                    echo " $ndf lines differ ( $score_s , $score_p )"                    echo " $ndf lines differ ( $score_s , $score_p )"
# Line 376  for mname in $MACHINES ; do Line 477  for mname in $MACHINES ; do
477                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL
478                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL
479                  cat tmpdf >> $OUTPFIL                  cat tmpdf >> $OUTPFIL
480                  if [ $cdif -eq 0 ] ; then                  if [ $cdif -eq 0 ] ; then
481                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
482                  else                  else
483                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
484                  fi                  fi
485                  cdif=`expr $cdif + 1`                  cdif=`expr $cdif + 1`
486                  echo '----------------------------------------' | tee -a $OUTPFIL                  echo '----------------------------------------' | tee -a $OUTPFIL
487              else              else
488                  echo "" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
489              fi              fi
490              rm -f tmpfs tmpfp tmpdf              rm -f tmpfs tmpfp tmpdf
491            elif test $num = '0' ; then            fi
             echo "no previous test for:" $key | tee -a $OUTPFIL  
             cmis=`expr $cmis + 1`  
           else  
             cmis=`expr $cmis + 1`  
           fi  
492          done          done
493          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi
494          printf '%11s :  %3i      %4s   %3i  ' $mname $ctot $tmis $cdif >> $OUTPSUM          printf '%11s :  %3i      %4s   %3i  ' $sname $ctot $tmis $cdif >> $OUTPSUM
495          if [ $cdif -gt 0 ] ; then          if [ $cdif -gt 0 ] ; then
496            echo "   $clin" >> $OUTPSUM            echo "   $clin" >> $OUTPSUM
497         else echo "" >> $OUTPSUM ; fi          else echo "" >> $OUTPSUM ; fi
498      fi      fi
499    
500  done  done

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.35

  ViewVC Help
Powered by ViewVC 1.1.22