/[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.21 by jmc, Mon Mar 22 14:45:20 2010 UTC revision 1.38 by jmc, Fri Apr 5 21:15:52 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"
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\""
# Line 22  usage() Line 23  usage()
23      echo "                         [def=\"$FIRSTDAY\"]"      echo "                         [def=\"$FIRSTDAY\"]"
24      echo "  (-u |-upto )LASTDAY   until last day=\"YYYYMMDD\" (=selected period)"      echo "  (-u |-upto )LASTDAY   until last day=\"YYYYMMDD\" (=selected period)"
25      echo "                         [def=\"FIRSTDAY\"]"      echo "                         [def=\"FIRSTDAY\"]"
26        echo "  (-b |-before)BEFORE   compare with output from before \"YYYYMMDD\""
27        echo "                         (=previous period) [def=\"FIRSTDAY\"]"
28      echo "  (-o |-outp )OUTPFIL   output file (-1 removed when exit)"      echo "  (-o |-outp )OUTPFIL   output file (-1 removed when exit)"
29      echo "                         [def=\"$OUTPFIL\"]"      echo "                         [def=\"$OUTPFIL\"]"
30      echo "  (-n |-nldf )NBLDIFF   max number of diff lines to echo"      echo "  (-n |-nldf )NBLDIFF   max number of diff lines to echo"
31      echo "                         [def=\"$NBLDIFF\"]"      echo "                         [def=\"$NBLDIFF\"]"
32      echo "  (-a |-addr )ADDRESS   send summary to mail ADDRESS list"      echo "  (-a |-addr )ADDRESS   send summary to mail ADDRESS list"
33      echo "                         [def=\"$ADDRESS\"]"      echo "                         [def=\"$ADDRESS\"]"
34      echo      echo
35      exit 1      exit 1
36  }  }
37    
# Line 36  usage() Line 39  usage()
39  make_resdir_list()  make_resdir_list()
40  {  {
41        if test $monthDir == 1 ; then        if test $monthDir == 1 ; then
42          dir_list=`grep $mname ./dir_all`          dir_list=`grep '.._'$mname ./dir_all`
43        else        else
44          dir_list=`( cd $INDIR ; ls -1 -t ../$PREV_P/*${mname}*/summary.txt 2> /dev/null | sed 's/\/summary.txt//' )`          dir_list=`( cd $INDIR ; ls -1 -t ../$PREV_P/??_*${mname}*/summary.txt 2> /dev/null | sed 's/\/summary.txt//' )`
45          #echo "dir_list='$dir_list'"          #echo "dir_list='$dir_list'"
46        fi        fi
47          for i in $dir_list ; do          for i in $dir_list ; do
48    
49              dir=$INDIR"/"$i              dir=$INDIR"/"$i
50                #--- get the opfile used to run testreport
51              OPTFILE=              OPTFILE=
52              if test -r $dir/summary.txt ; then              if test -r $dir/summary.txt ; then
53                  comm=`grep 'OPTFILE=' $dir/summary.txt`                  comm=`grep 'OPTFILE=' $dir/summary.txt`
54                  eval $comm                  eval $comm
                 OPTFILE=${OPTFILE##*/}  
55              fi              fi
56              if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then              if test "x$OPTFILE" = x -a -r "$dir/genmake_state" ; then
57                  comm=`grep 'OPTFILE=' $dir/genmake_state 2>/dev/null`                  comm=`grep 'OPTFILE=' $dir/genmake_state 2>/dev/null`
58                  eval $comm                  eval $comm
                 OPTFILE=${OPTFILE##*/}  
59              fi              fi
60              if test "x$OPTFILE" = x ; then              if test "x$OPTFILE" = x ; then
61                  comm=`grep '^# OPTFILE=' $dir/*/Makefile* 2>/dev/null | head -1`                  comm=`grep '^# OPTFILE=' $dir/*/Makefile* 2>/dev/null | head -1`
62                  comm=${comm##*#}                  comm=${comm##*#}
63                  eval $comm                  eval $comm
                 OPTFILE=${OPTFILE##*/}  
64              fi              fi
65              if test "x$OPTFILE" = x ; then              if test "x$OPTFILE" = x ; then
66                  OPTFILE="not_explicitly_specified"                  OPTFILE="not_explicitly_specified"
67                else
68                    OPTFILE=${OPTFILE##*/}
69                fi
70                #--- case select test run by 1 user: get user who did run testreport
71                if test "x$sUser" != x ; then
72                    tUser=
73                    if test -f $dir/genmake_state ; then
74                       nn=`sed -n '/^# executed by:/=' $dir/genmake_state`
75                       if test "x$nn" != x ; then
76                         nn=`expr $nn + 1`
77                         tUser=`sed -n "$nn s/^# *// p" $dir/genmake_state | sed 's/@.*$//'`
78                       fi
79                    fi
80                    if test "x$tUser" = "x" ; then
81                       mkfile=`ls $dir/*/Makefile* 2>/dev/null | head -1`
82                       if test "x$mkfile" = 'x' ; then
83                         echo "no Makefile => discard test from: $i" | tee -a $OUTPFIL
84                         continue
85                       fi
86                       nn=`sed -n '/^# executed by:/=' $mkfile`
87                       if test "x$nn" != x ; then
88                         nn=`expr $nn + 1`
89                         tUser=`sed -n "$nn s/^# *// p" $mkfile | sed 's/@.*$//'`
90                       fi
91                    fi
92                    if test "x$tUser" = x ; then
93                         echo "no User found => discard test from: $i" | tee -a $OUTPFIL
94                         continue
95                    fi
96                    if test $tUser != $sUser ; then
97                       if test $dBug = 't' ; then
98                            echo "  discard test from: $i" | tee -a $OUTPFIL
99                       fi
100                       continue
101                    fi
102              fi              fi
103    
104              ADJOINT=              ADJOINT=0
105                TANGLIN=0
106                OPENAD=0
107              RESTART=0              RESTART=0
108              NOI3E=0              EXTRA=
109                FAST=0
110                DVLP=0
111                MPI=0
112              MTH=0              MTH=0
113                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                      OPENAD=`grep -c '^Adjoint .* OpenAD' $dir/summary.txt`
118                    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                  NOI3E=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt`                  comm=`grep '^run: .*testreport.* ' $dir/summary.txt`
125                  MTH=`grep -c "^run: .*testreport.* -mth" $dir/summary.txt`                  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
141                       FAST=`echo "$comm" | grep -c " '*-noieee'*"`
142                    fi
143                    DVLP=`echo "$comm" | grep -c " -*-devel\>"`
144                    MPI=`echo "$comm" | grep -c " -*-mpi\>"`
145                    if test "x$MPI" = x0 ; then
146                       MPI=`echo "$comm" | grep -c " -*-MPI\>"`
147                    fi
148                    MTH=`echo "$comm" | grep -c " -*-mth\>"`
149                    UR4=`echo "$comm" | grep -c " -*-use_r4\>"`
150                    if test "x$UR4" = x0 ; then
151                       UR4=`echo "$comm" | grep -c " -*-ur4\>"`
152                    fi
153              fi              fi
154              if test "x$RESTART" = x0 ; then              if test "x$ADJOINT" = x1 ; then
155                  kind="forward"                  kind="adm-TAF" ; order=0
156                  test "x$ADJOINT" = xtrue  &&  kind="adjoint"                  if test "x$OPENAD" = x1 ; then kind="adm-OAD" ; order=2 ; fi
157                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
161                    kind="forward" ; order=4
162              else              else
163                  kind="restart"                  kind="restart" ; order=5
164                fi
165                order=`expr $order + 10 \* $EXTRA`
166                order=`printf '%3.3i' $order`
167                if test "x$UR4" = x1 ; then
168                    OPTFILE="${OPTFILE}.use_r4"
169                fi
170                if test "x$MPI" = x1 ; then
171                    yy=`echo $OPTFILE | grep -c '+mpi'`
172                    if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi
173              fi              fi
174              if test "x$MTH" = x1 ; then              if test "x$MTH" = x1 ; then
175                  yy=`echo $OPTFILE | grep -c '+mth$'`                  yy=`echo $OPTFILE | grep -c '+mth$'`
176                  if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi                  if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi
177              fi              fi
178              if test "x$NOI3E" = x1 ; then              if test "x$FAST" = x1 ; then
179                  OPTFILE="${OPTFILE}.noieee"                  OPTFILE="${OPTFILE}.fast"
180                fi
181                if test "x$DVLP" = x1 ; then
182                    OPTFILE="${OPTFILE}.dvlp"
183              fi              fi
184              day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`              day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`
185              ttt=`echo $day | 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]$//'`
186              day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`              day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`
187    
188              if [ $day -lt $FIRSTDAY ] ; then              if [ $day -lt $BEFORE ] ; then
189                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./plist                  echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./plist
190              elif [ $day -le $LASTDAY ] ; then              elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then
191                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./slist                  echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./slist
192              else              else
193                  if test $dBug = 't' ; then                  if test $dBug = 't' ; then
194                     echo "discard day='$day' from: $i" | tee -a $OUTPFIL                     echo "discard day='$day' from: $i" | tee -a $OUTPFIL
# Line 123  make_resdir_list() Line 215  make_resdir_list()
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
222  LASTDAY="30000000"  LASTDAY="30000000"
223    BEFORE="30000000"
224  OUTPFIL=`basename $0`'.log'  OUTPFIL=`basename $0`'.log'
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"
# Line 141  for ac_option ; do Line 236  for ac_option ; do
236    
237      # If the previous option needs an argument, assign it.      # If the previous option needs an argument, assign it.
238      if test -n "$ac_prev"; then      if test -n "$ac_prev"; then
239          eval "$ac_prev=\$ac_option"          eval "$ac_prev=\$ac_option"
240          ac_prev=          ac_prev=
241          continue          continue
242      fi      fi
243    
244      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
245    
246      case $ac_option in      case $ac_option in
247                    
248          -help | --help | -h | --h)          -help | --help | -h | --h) usage ;;
249              usage ;;          -verbose | --verbose | -v | --v) dBug=t ;;
250          -verbose | --verbose | -v | --v)          -test4update | --test4update | -t | --t) t4update=1 ;;
             dBug=t ;;  
251                    
252          -list  | --list  | -l | --l)          -list  | --list  | -l | --l) ac_prev=MACHINES ;;
253              ac_prev=MACHINES ;;          -list=* | --list=*) MACHINES=$ac_optarg ;;
254          -list=* | --list=*)  
255              MACHINES=$ac_optarg ;;          -day  | --day  | -d | --d) ac_prev=FIRSTDAY ;;
256            -day=* | --day=*) FIRSTDAY=$ac_optarg ;;
257          -day  | --day  | -d | --d)  
258              ac_prev=FIRSTDAY ;;          -upto | --upto | -u | --u) ac_prev=LASTDAY ;;
259          -day=* | --day=*)          -upto=* | --upto=*) LASTDAY=$ac_optarg ;;
260              FIRSTDAY=$ac_optarg ;;  
261            -before | --before | -b | --b) ac_prev=BEFORE ;;
262          -upto | --upto | -u | --u)          -before=* | --before=*) BEFORE=$ac_optarg ;;
263              ac_prev=LASTDAY ;;  
264          -upto=* | --upto=*)          -outp | --outp | -o | --o) ac_prev=OUTPFIL ;;
265              LASTDAY=$ac_optarg ;;          -outp=* | --outp=*) OUTPFIL=$ac_optarg ;;
266    
267          -outp | --outp | -o | --o)          -nldf | --nldf | -n | --n) ac_prev=NBLDIFF ;;
268              ac_prev=OUTPFIL ;;          -nldf=* | --nldf=*) NBLDIFF=$ac_optarg ;;
269          -outp=* | --outp=*)  
270              OUTPFIL=$ac_optarg ;;          -addr | --addr | -a | --a) ac_prev=ADDRESS ;;
271            -addr=* | --addr=*) ADDRESS=$ac_optarg ;;
272          -nldf | --nldf | -n | --n)  
273              ac_prev=NBLDIFF ;;          *) echo "Error: don't understand argument \"$ac_option\""
274          -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  
             ;;  
275    
276       esac       esac
277    
# Line 204  if test "x$ttt" != 'xyz' ; then Line 287  if test "x$ttt" != 'xyz' ; then
287    exit 2    exit 2
288  fi  fi
289  if test $LASTDAY = "30000000" ; then LASTDAY=$FIRSTDAY ; fi  if test $LASTDAY = "30000000" ; then LASTDAY=$FIRSTDAY ; fi
290    if test  $BEFORE = "30000000" ; then  BEFORE=$FIRSTDAY ; fi
291  CMDLINE=$0  CMDLINE=$0
292  for xx in "$@" ; do nw=`echo $xx | wc -w`  for xx in "$@" ; do nw=`echo $xx | wc -w`
293    if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"    if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"
294                        else CMDLINE="$CMDLINE '$xx'" ; fi                        else CMDLINE="$CMDLINE '$xx'" ; fi
295  done  done
296    
297  PERIOD=`echo $FIRSTDAY | sed 's/[0-9][0-9]$//'`  PERIOD=`echo $LASTDAY | sed 's/[0-9][0-9]$//'`
298  PP=`expr $PERIOD - 1`  PP=`expr $PERIOD - 1`
299  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]//'`
300  PY=`echo $PP | sed 's/[0-9][0-9]$//'`  PY=`echo $PP | sed 's/[0-9][0-9]$//'`
# Line 222  PERIOD=`echo $PERIOD | sed 's/^[0-9][0-9 Line 306  PERIOD=`echo $PERIOD | sed 's/^[0-9][0-9
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="/export/export-7/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
343    echo "  versus latest from before $BEFORE" >> $OUTPFIL
344    
345  if test $dBug = 't' ; then  if test $dBug = 't' ; then
346    echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'"    echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'"
347    echo "FIRSTDAY='$FIRSTDAY' , LASTDAY='$LASTDAY'"    echo "FIRSTDAY='$FIRSTDAY' , LASTDAY='$LASTDAY' , BEFORE='$BEFORE'"
348  fi  fi
349  if test -d $INDIR ; then  if test -d $INDIR ; then
350    dirP=`echo $INDIR | sed "s/$PERIOD/$PREV_P/"`    dirP=`echo $INDIR | sed "s/$PERIOD/$PREV_P/"`
# Line 249  else Line 359  else
359    exit 3    exit 3
360  fi  fi
361    
 #- a short summary of this checking :  
 OUTPSUM=`echo $FIRSTDAY | 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
365    echo -n "Checking latest output from $FIRSTDAY until $LASTDAY" | tee -a $OUTPSUM    echo -n "Checking latest output from $FIRSTDAY until $LASTDAY" | tee -a $OUTPSUM
366  fi  fi
367  echo " versus latest prior to this period" | tee -a $OUTPSUM  if test $FIRSTDAY = $BEFORE ; then
368      echo " versus latest prior to this period" | tee -a $OUTPSUM
369    else
370      echo " versus latest from before $BEFORE" | tee -a $OUTPSUM
371    fi
372  echo "    Machine   Tot. Nb.   no    Nb with  Nb diff" >> $OUTPSUM  echo "    Machine   Tot. Nb.   no    Nb with  Nb diff" >> $OUTPSUM
373  echo "     name     checked   comp    Diff    lines"  >> $OUTPSUM  echo "     name     checked   comp    Diff    lines"  >> $OUTPSUM
374    
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 lagoon aces dickens danton beagle harbor"    MACHINES="aces- acesgrid baudelaire dickens danton beagle"
379    MACHINES="$MACHINES columbia pleiades iblade rays solssrv solasrv sx8"    MACHINES="$MACHINES pleiades iblade sx8 uv100 solasrv stomp weber"
   MACHINES="$MACHINES trane dodongo dokdo 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
383      present=0      present=0
384      for m in $MACHINES ; do      for m in $MACHINES ; do
385          echo $madd | grep $m > /dev/null 2>&1          mm=`echo $m | sed 's/\./ /g' | awk '{print $1}'`
386          RETVAL=$?          echo $madd | grep $mm > /dev/null 2>&1
387          test $RETVAL = 0  &&  present=1          RETVAL=$?
388          continue          test $RETVAL = 0  &&  present=1
389            continue
390      done      done
391      test $present = 0  &&  MACHINES="$MACHINES $madd"      test $present = 0  &&  MACHINES="$MACHINES $madd"
392    done    done
393  fi  fi
394    #echo "MACHINES=$MACHINES" ; exit
395    
396  for mname in $MACHINES ; do  for pname in $MACHINES ; do
397    
398      if test $dBug = 't' ; then echo "  $mname" ; fi      sname=`echo $pname | sed 's/-$//'`
399      echo " name='$mname'" >> $OUTPFIL      mname=`echo $pname | sed 's/\./ /g' | awk '{print $1}'`
400        sUser=
401        if test $mname != $pname ; then
402          # to select results from user "sUser"
403          sUser=`echo $pname | sed 's/\./ /g' | awk '{print $2}'`
404        fi
405    
406        if test $dBug = 't' ; then echo "  $pname" ; fi
407        echo " name='$pname'" >> $OUTPFIL
408      ctot=0 ; cmis=0 ; cdif=0      ctot=0 ; cmis=0 ; cdif=0
409    
410      # put results from selected period in "slist",      # put results from selected period in "slist",
411      #     results from previous period in "plist"      #     results from previous period in "plist"
412      rm -f ./plist ./slist ; touch ./plist ./slist      rm -f ./plist ./slist ; touch ./plist ./slist
413    
# Line 307  for mname in $MACHINES ; do Line 424  for mname in $MACHINES ; do
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`
429            optf=`echo $sline | cut -d " " -f 3`            optf=`echo $sline | cut -d " " -f 3`
430            num=`grep -c "^$key" ./plist`            num=`grep -c "^$key" ./plist`
431            if test $num = 0 -a $monthDir = 1 ; then            if test $num = 0 -a $monthDir = 1 ; then
432            #- add results from previous month directory to "plist".            #- add results from previous month directory to "plist".
433              monthDir=2              monthDir=2
434              make_resdir_list              make_resdir_list
435              num=`grep -c "^$key" ./plist`              num=`grep -c "^$key" ./plist`
436            fi            fi
437            #- discard unsafe test:            #- discard unsafe test:
438            dd=`echo $optf | grep -c 'gfortran+mth'`            dd=`echo $optf | grep -c 'gfortran+mth'`
439            #if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi            if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi
440            #if test $mname = 'harbor' -a $dd = 1 ; then num=-1 ; fi            if test $mname = 'harbor' -a $dd = 1 ; then num=-1 ; fi
441            #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
442            #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
443            dd=`echo $optf | grep -c 'bigred.*+mth'`            dd=`echo $optf | grep -c 'bigred.*noieee'`
444            #if test $mname = 'bigred' -a $dd = 1 ; then num=-1 ; fi            #if test $mname = 'bigred' -a $dd = 1 ; then num=-1 ; fi
445            if test $num -lt 0 ; then            if test $num -lt 0 ; then
446              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL
447              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
448            elif test $num = '0' ; then            elif test $num = '0' ; then
449              echo "no previous test for:" $key | tee -a $OUTPFIL              echo "no previous test for:" $key | tee -a $OUTPFIL
450              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
451            else            else
452              pline=`grep "^$key " ./plist | head -1`              pline=`grep "^$key " ./plist | head -1`
453              if test $dBug = 't' ; then              if test $dBug = 't' ; then
454                  echo "s='$sline'" | tee -a $OUTPFIL                  echo "s='$sline'" | tee -a $OUTPFIL
455                  echo "p='$pline'" | tee -a $OUTPFIL                  echo "p='$pline'" | tee -a $OUTPFIL
456              fi              fi
457              pdir=`echo $pline | cut -d " " -f 5`              pdir=`echo $pline | cut -d " " -f 5`
458              outs="$INDIR/$sdir/summary.txt"              outs="$INDIR/$sdir/summary.txt"
459              sed -n "5,$ p" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outs ) | tail -1`
460                                   | sed 's/ OPTFILE=.*\// OPTFILE=/g' \              sed "1,$xx d" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
461                                   | grep -v '^[A-S][a-t]* time:  ' > tmpfs                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfs
462              outp="$INDIR/$pdir/summary.txt"              outp="$INDIR/$pdir/summary.txt"
463              sed -n "5,$ p" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outp ) | tail -1`
464                                   | sed 's/ OPTFILE=.*\// OPTFILE=/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)              #-- re-order list of exp (according to local "sort" order)
467              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`
468              for xx in $listD              for xx in $listD
# Line 365  for mname in $MACHINES ; do Line 482  for mname in $MACHINES ; do
482              diff tmpfs tmpfp > tmpdf              diff tmpfs tmpfp > tmpdf
483              yy=$?              yy=$?
484              if test $yy != '0' ; then              if test $yy != '0' ; then
485                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
486                  #grep '^run: ' $outp                  #grep '^run: ' $outp
487                  #grep '^run: ' $outs                  #grep '^run: ' $outs
488                  #-- score for each test:                  #-- score for each test:
# Line 383  for mname in $MACHINES ; do Line 500  for mname in $MACHINES ; do
500                  ndf=`expr $ndf / 2`                  ndf=`expr $ndf / 2`
501                  nn=`grep -c '^---' tmpdf`                  nn=`grep -c '^---' tmpdf`
502                  ndf=`expr $ndf - $nn`                  ndf=`expr $ndf - $nn`
503                  if [ $ndf -le $NBLDIFF ] ; then                  if [ $ndf -le $NBLDIFF ] ; then
504                    cat tmpdf                    cat tmpdf
505                  else                  else
506                    echo " $ndf lines differ ( $score_s , $score_p )"                    echo " $ndf lines differ ( $score_s , $score_p )"
# Line 391  for mname in $MACHINES ; do Line 508  for mname in $MACHINES ; do
508                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL
509                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL
510                  cat tmpdf >> $OUTPFIL                  cat tmpdf >> $OUTPFIL
511                  if [ $cdif -eq 0 ] ; then                  if [ $cdif -eq 0 ] ; then
512                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
513                  else                  else
514                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
515                  fi                  fi
516                  cdif=`expr $cdif + 1`                  cdif=`expr $cdif + 1`
517                  echo '----------------------------------------' | tee -a $OUTPFIL                  echo '----------------------------------------' | tee -a $OUTPFIL
518              else              else
519                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
520              fi              fi
521              rm -f tmpfs tmpfp tmpdf              rm -f tmpfs tmpfp tmpdf
522            fi            fi
523          done          done
524          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi
525          printf '%11s :  %3i      %4s   %3i  ' $mname $ctot $tmis $cdif >> $OUTPSUM          printf '%11s :  %3i      %4s   %3i  ' $sname $ctot $tmis $cdif >> $OUTPSUM
526          if [ $cdif -gt 0 ] ; then          if [ $cdif -gt 0 ] ; then
527            echo "   $clin" >> $OUTPSUM            echo "   $clin" >> $OUTPSUM
528         else echo "" >> $OUTPSUM ; fi          else echo "" >> $OUTPSUM ; fi
529      fi      fi
530    
531  done  done

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.38

  ViewVC Help
Powered by ViewVC 1.1.22