/[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.30 by jmc, Fri Aug 19 20:38:19 2011 UTC revision 1.45 by jmc, Wed Dec 16 23:29:11 2015 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
# Line 15  usage() Line 14  usage()
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 38  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 $TMP.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'"
# Line 100  make_resdir_list() Line 101  make_resdir_list()
101                  fi                  fi
102              fi              fi
103    
104              ADJOINT=              ADJOINT=0
105                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                      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                  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$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              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
# Line 153  make_resdir_list() Line 185  make_resdir_list()
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 $BEFORE ] ; then              if [ $day -lt $BEFORE ] ; then
189                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./plist                  echo "$OPTFILE$order $day $OPTFILE $kind $i" >> $TMP.plist
190              elif [ $day -ge $FIRSTDAY -a $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" >> $TMP.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 167  make_resdir_list() Line 199  make_resdir_list()
199          if test $dBug = 't' ; then          if test $dBug = 't' ; then
200            if test $monthDir == 1 ; then            if test $monthDir == 1 ; then
201              echo "---- current list (n=$monthDir) :" | tee -a $OUTPFIL              echo "---- current list (n=$monthDir) :" | tee -a $OUTPFIL
202                  cat ./slist | tee -a $OUTPFIL                  cat $TMP.slist | tee -a $OUTPFIL
203            fi            fi
204            num1=`wc -l ./slist | awk '{print $1}'`            num1=`wc -l $TMP.slist | awk '{print $1}'`
205            if test $num1 -gt 0 ; then            if test $num1 -gt 0 ; then
206            echo   ".... previous list (n=$monthDir):" | tee -a $OUTPFIL            echo   ".... previous list (n=$monthDir):" | tee -a $OUTPFIL
207                  cat ./plist | tee -a $OUTPFIL | head -20                  cat $TMP.plist | tee -a $OUTPFIL | head -20
208            fi            fi
209            echo "----" | tee -a $OUTPFIL            echo "----" | tee -a $OUTPFIL
210          fi          fi
# Line 183  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
# Line 192  OUTPFIL=`basename $0`'.log' Line 225  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 202  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      case $ac_option in      case $ac_option in
246                    
247          -help | --help | -h | --h) usage ;;          -help | --help | -h | --h) usage ;;
248          -verbose | --verbose | -v | --v) dBug=t ;;          -verbose | --verbose | -v | --v) dBug=t ;;
249            -test4update | --test4update | -t | --t) t4update=1 ;;
250                    
251          -list  | --list  | -l | --l) ac_prev=MACHINES ;;          -list  | --list  | -l | --l) ac_prev=MACHINES ;;
252          -list=* | --list=*) MACHINES=$ac_optarg ;;          -list=* | --list=*) MACHINES=$ac_optarg ;;
# Line 237  for ac_option ; do Line 271  for ac_option ; do
271    
272          *) echo "Error: don't understand argument \"$ac_option\""          *) echo "Error: don't understand argument \"$ac_option\""
273             usage ;;             usage ;;
   
274       esac       esac
275    
276  done  done
277    
278    #TMP=./chkoutp_$$
279    #- try to put temporary files in system-local /tmp dir
280    TMP=/tmp/chkoutp_$$
281    touch $TMP ; retVal=$?
282    if [ $retVal -eq 0 ] ; then
283      if test ! -r $TMP ; then TMP=./chkoutp_$$ ; fi
284    else
285      TMP=./chkoutp_$$
286    fi
287    rm -f $TMP
288    if test $dBug = 't' ; then echo "temp files: $TMP" ; fi
289    
290  #-- test FIRSTDAY content ; interpret as "date -d" arg. if not YYYYMMDD  #-- test FIRSTDAY content ; interpret as "date -d" arg. if not YYYYMMDD
291  ttt=`echo "y$FIRSTDAY" | sed 's/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/z/'`  ttt=`echo "y$FIRSTDAY" | sed 's/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/z/'`
292  if test "x$ttt" != 'xyz' ; then  if test "x$ttt" != 'xyz' ; then
# Line 269  PERIOD=`echo $PERIOD | sed 's/^[0-9][0-9 Line 315  PERIOD=`echo $PERIOD | sed 's/^[0-9][0-9
315    
316  #INDIR="/net/orwell/export/export-9/mitgcm-testing/results/$PERIOD"  #INDIR="/net/orwell/export/export-9/mitgcm-testing/results/$PERIOD"
317  INDIR="/u/u0/httpd/html/testing/results/$PERIOD"  INDIR="/u/u0/httpd/html/testing/results/$PERIOD"
318  #INDIR="/export/export-7/u/u2/jmc/mitgcm/test_web/results/$PERIOD"  #INDIR="/u/u2/jmc/mitgcm/test_web/results/$PERIOD"
319    
320    #- a short summary of this checking :
321    OUTPSUM=`echo $LASTDAY | sed 's/^20../_/'`
322    OUTPSUM=`basename $0`"$OUTPSUM.txt"
323    
324  if test $OUTPFIL = '-1' ; then  if test $OUTPFIL = '-1' ; then
325    OUTPFIL='TTT.'$$    OUTPFIL='TTT.'$$
326    fi
327    if test $t4update = 1 ; then
328      if test -f $PRC_MAILS -a -f $OUTPSUM -a $FIRSTDAY = $CURR_DAY ; then
329        #- if update-log-file is older than previous output summary, just return
330        if test $PRC_MAILS -ot $OUTPSUM ; then
331          echo ' '$CMDLINE | tee -a $OUTPSUM
332          echo " t4update: skip "`basename $0`" ( $PRC_MAILS older than $OUTPSUM )" | tee -a $OUTPSUM
333          echo " End  time:  "`date` | tee -a $OUTPSUM
334          exit 0
335        else
336          if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi
337          echo " t4update: run "`basename $0`" ( $PRC_MAILS newer than $OUTPSUM )" | tee $OUTPFIL
338        fi
339      else
340          if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi
341          echo " t4update ignored (not current day or $PRC_MAILS or $OUTPSUM missing)" | tee $OUTPFIL
342      fi
343  elif test -e $OUTPFIL ; then  elif test -e $OUTPFIL ; then
344    mv -f $OUTPFIL $OUTPFIL'_bak'    mv -f $OUTPFIL $OUTPFIL'_bak'
345      touch $OUTPFIL
346  fi  fi
347  echo "CMDLINE='$CMDLINE'" > $OUTPFIL  if test -e $OUTPSUM ; then mv -f $OUTPSUM $OUTPSUM'_bak' ; fi
348    echo ' '$CMDLINE > $OUTPSUM
349    
350    echo "CMDLINE='$CMDLINE'" >> $OUTPFIL
351  echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'" >> $OUTPFIL  echo "PERIOD='$PERIOD' , PREV_P='$PREV_P'" >> $OUTPFIL
352  echo "INDIR='$INDIR'" >> $OUTPFIL  echo "INDIR='$INDIR'" >> $OUTPFIL
353  echo "Checking latest output from $FIRSTDAY until $LASTDAY" >> $OUTPFIL  echo "Checking latest output from $FIRSTDAY until $LASTDAY" >> $OUTPFIL
# Line 299  else Line 370  else
370    exit 3    exit 3
371  fi  fi
372    
 #- 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  
   
373  if test $FIRSTDAY = $LASTDAY ; then  if test $FIRSTDAY = $LASTDAY ; then
374    echo -n "Checking latest output from $FIRSTDAY" | tee -a $OUTPSUM    echo -n "Checking latest output from $FIRSTDAY" | tee -a $OUTPSUM
375  else  else
# Line 318  fi Line 383  fi
383  echo "    Machine   Tot. Nb.   no    Nb with  Nb diff" >> $OUTPSUM  echo "    Machine   Tot. Nb.   no    Nb with  Nb diff" >> $OUTPSUM
384  echo "     name     checked   comp    Diff    lines"  >> $OUTPSUM  echo "     name     checked   comp    Diff    lines"  >> $OUTPSUM
385    
386  ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all  ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > $TMP.dir_all
387    
388  if test "x$MACHINES" = "x_All_" ; then  if test "x$MACHINES" = "x_All_" ; then
389    MACHINES="faulks meander aces- acesgrid baudelaire dickens danton beagle harbor"    MACHINES="aces- acesgrid baudelaire danton iblade sx8 uv100 pleiades"
390    MACHINES="$MACHINES pleiades iblade rays solasrv sx8"    MACHINES="$MACHINES stomp octopus engaging saramago svante glacier"
   MACHINES="$MACHINES trane dodongo dokdo stomp bigred"  
391    
392    MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq`    MALL=`cat $TMP.dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq`
393    for madd in $MALL ; do    for madd in $MALL ; do
394      present=0      present=0
395      for m in $MACHINES ; do      for m in $MACHINES ; do
# Line 354  for pname in $MACHINES ; do Line 418  for pname in $MACHINES ; do
418      echo " name='$pname'" >> $OUTPFIL      echo " name='$pname'" >> $OUTPFIL
419      ctot=0 ; cmis=0 ; cdif=0      ctot=0 ; cmis=0 ; cdif=0
420    
421      # put results from selected period in "slist",      # put results from selected period in "TMP.slist",
422      #     results from previous period in "plist"      #     results from previous period in "TMP.plist"
423      rm -f ./plist ./slist ; touch ./plist ./slist      rm -f $TMP.plist $TMP.slist ; touch $TMP.plist $TMP.slist
424    
425      #- create list of results (slist & plist) from current month directory      #- create list of results (slist & plist) from current month directory
426      monthDir=1      monthDir=1
427      make_resdir_list      make_resdir_list
428    
429      #  Do we have any data?  If so, create the latest pointer.      #  Do we have any data?  If so, create the latest pointer.
430      num=`wc -l ./slist | awk '{print $1}'`      num=`wc -l $TMP.slist | awk '{print $1}'`
431      if test $num -gt 0 ; then      if test $num -gt 0 ; then
432    
433          keys=`cat ./slist | cut -d " " -f 1 | sort | uniq`          keys=`cat $TMP.slist | cut -d " " -f 1 | sort | uniq`
434    
435          for key in $keys ; do          for key in $keys ; do
436            ctot=`expr $ctot + 1`            ctot=`expr $ctot + 1`
437            sline=`grep "^$key " ./slist | head -1`            sline=`grep "^$key " $TMP.slist | head -1`
438            sdir=`echo $sline | cut -d " " -f 5`            sdir=`echo $sline | cut -d " " -f 5`
439            type=`echo $sline | cut -d " " -f 4`            type=`echo $sline | cut -d " " -f 4`
440            optf=`echo $sline | cut -d " " -f 3`            optf=`echo $sline | cut -d " " -f 3`
441            num=`grep -c "^$key" ./plist`            num=`grep -c "^$key" $TMP.plist`
442            if test $num = 0 -a $monthDir = 1 ; then            if test $num = 0 -a $monthDir = 1 ; then
443            #- add results from previous month directory to "plist".            #- add results from previous month directory to "plist".
444              monthDir=2              monthDir=2
445              make_resdir_list              make_resdir_list
446              num=`grep -c "^$key" ./plist`              num=`grep -c "^$key" $TMP.plist`
447            fi            fi
448            #- discard unsafe test:            #- discard unsafe test:
449            dd=`echo $optf | grep -c 'gfortran+mth'`            dd=`echo $optf | grep -c 'gfortran+mth'`
# Line 393  for pname in $MACHINES ; do Line 457  for pname in $MACHINES ; do
457              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL
458              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
459            elif test $num = '0' ; then            elif test $num = '0' ; then
460              echo "no previous test for:" $key | tee -a $OUTPFIL              echo "  dir='$sdir', type='$type', of='$optf':" | tee -a $OUTPFIL
461                echo "  --> no previous test matching key='$key'" | tee -a $OUTPFIL
462              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
463            else            else
464              pline=`grep "^$key " ./plist | head -1`              pline=`grep "^$key " $TMP.plist | head -1`
465              if test $dBug = 't' ; then              if test $dBug = 't' ; then
466                  echo "s='$sline'" | tee -a $OUTPFIL                  echo "s='$sline'" | tee -a $OUTPFIL
467                  echo "p='$pline'" | tee -a $OUTPFIL                  echo "p='$pline'" | tee -a $OUTPFIL
# Line 405  for pname in $MACHINES ; do Line 470  for pname in $MACHINES ; do
470              outs="$INDIR/$sdir/summary.txt"              outs="$INDIR/$sdir/summary.txt"
471              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outs ) | tail -1`              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outs ) | tail -1`
472              sed "1,$xx d" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              sed "1,$xx d" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
473                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfs                                  | grep -v '^[A-S][a-t]* time:  ' > $TMP.fs
474              outp="$INDIR/$pdir/summary.txt"              outp="$INDIR/$pdir/summary.txt"
475              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outp ) | tail -1`              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outp ) | tail -1`
476              sed "1,$xx d" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              sed "1,$xx d" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
477                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfp                                  | grep -v '^[A-S][a-t]* time:  ' > $TMP.fp
478              #-- re-order list of exp (according to local "sort" order)              #-- check if list of exp are the same (and in the same order)
479              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`              sed 's/  (e=.*, w=.*)$//' $TMP.fs > $TMP.fn
480              for xx in $listD              listDs=`grep '^[YN] [YN] [YN] [YN]' $TMP.fn | awk '{print $NF}'`
481              do              #mv -f $TMP.fn $TMP.fs
482                  sed "/ $xx\$/d" tmpfs > tmpfn              rm -f $TMP.fn
483                  sed -n "/ $xx\$/p" tmpfs >> tmpfn              sed 's/  (e=.*, w=.*)$//' $TMP.fp > $TMP.fn
484                  mv tmpfn tmpfs              listDp=`grep '^[YN] [YN] [YN] [YN]' $TMP.fn | awk '{print $NF}'`
485              done              #mv -f $TMP.fn $TMP.fp
486              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfp | awk '{print $NF}' | sort`              rm -f $TMP.fn
487              for xx in $listD              #echo "listDs='$listDs'" ;  echo "listDp='$listDp'"
488              do              if test "$listDs" != "$listDp" ; then
489                  sed "/ $xx\$/d" tmpfp > tmpfn                  if test $dBug = 't' ; then echo ' -> re-order list of exp' ; fi
490                  sed -n "/ $xx\$/p" tmpfp >> tmpfn                  #-- re-order list of exp (according to local "sort" order)
491                  mv tmpfn tmpfp                  listDs=`echo "$listDs" | sort`
492              done                  for xx in $listDs ; do
493                        sed -e "/ $xx\$/d" -e "/ $xx /d" $TMP.fs > $TMP.fn
494                        sed -n -e "/ $xx\$/p" -e "/ $xx /p" $TMP.fs >> $TMP.fn
495                        mv -f $TMP.fn $TMP.fs
496                    done
497                    listDp=`echo "$listDp" | sort`
498                    for xx in $listDp ; do
499                        sed -e "/ $xx\$/d" -e "/ $xx /d" $TMP.fp > $TMP.fn
500                        sed -n -e "/ $xx\$/p" -e "/ $xx /p" $TMP.fp >> $TMP.fn
501                        mv -f $TMP.fn $TMP.fp
502                    done
503                #else
504                #   echo 'same list of exp => skip re-ordering'
505                fi
506              echo -n "=== diff $sdir $pdir :" | tee -a $OUTPFIL              echo -n "=== diff $sdir $pdir :" | tee -a $OUTPFIL
507              diff tmpfs tmpfp > tmpdf              diff $TMP.fs $TMP.fp > $TMP.dif
508              yy=$?              yy=$?
509              if test $yy != '0' ; then              if test $yy != '0' ; then
510                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
511                  #grep '^run: ' $outp                  #grep '^run: ' $outp
512                  #grep '^run: ' $outs                  #grep '^run: ' $outs
513                  #-- score for each test:                  #-- score for each test:
514                  grep '^[YN] [YN] [YN] [YN]' tmpfs > tmploc 2>/dev/null                  grep '^[YN] [YN] [YN] [YN]' $TMP.fs > tmploc 2>/dev/null
515                  t_tot=`cat tmploc | wc -l | sed -e 's| ||g'`                  t_tot=`cat tmploc | wc -l | sed -e 's| ||g'`
516                  t_pass=`grep '^Y Y Y Y' tmploc | grep 'pass ' | wc -l | sed -e 's| ||g'`                  t_pass=`grep '^Y Y Y Y' tmploc | grep 'pass ' | wc -l | sed -e 's| ||g'`
517                  score_s=`printf '%2i' $t_pass`":$t_tot"                  score_s=`printf '%2i' $t_pass`":$t_tot"
518                  grep '^[YN] [YN] [YN] [YN]' tmpfp > tmploc 2>/dev/null                  grep '^[YN] [YN] [YN] [YN]' $TMP.fp > tmploc 2>/dev/null
519                  t_tot=`cat tmploc | wc -l | sed -e 's| ||g'`                  t_tot=`cat tmploc | wc -l | sed -e 's| ||g'`
520                  t_pass=`grep '^Y Y Y Y' tmploc | grep 'pass ' | wc -l | sed -e 's| ||g'`                  t_pass=`grep '^Y Y Y Y' tmploc | grep 'pass ' | wc -l | sed -e 's| ||g'`
521                  score_p=`printf '%2i' $t_pass`":$t_tot"                  score_p=`printf '%2i' $t_pass`":$t_tot"
522                  rm -f tmploc                  rm -f tmploc
523                  #-- count Nb of different lines                  #-- count Nb of different lines
524                  ndf=`wc -l tmpdf | awk '{print $1}'`                  ndf=`wc -l $TMP.dif | awk '{print $1}'`
525                  ndf=`expr $ndf / 2`                  ndf=`expr $ndf / 2`
526                  nn=`grep -c '^---' tmpdf`                  nn=`grep -c '^---' $TMP.dif`
527                  ndf=`expr $ndf - $nn`                  ndf=`expr $ndf - $nn`
528                  if [ $ndf -le $NBLDIFF ] ; then                  if [ $ndf -le $NBLDIFF ] ; then
529                    cat tmpdf                    cat $TMP.dif
530                  else                  else
531                    echo " $ndf lines differ ( $score_s , $score_p )"                    echo " $ndf lines differ ( $score_s , $score_p )"
532                  fi                  fi
533                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL
534                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL
535                  cat tmpdf >> $OUTPFIL                  cat $TMP.dif >> $OUTPFIL
536                  if [ $cdif -eq 0 ] ; then                  if [ $cdif -eq 0 ] ; then
537                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
538                  else                  else
# Line 465  for pname in $MACHINES ; do Line 543  for pname in $MACHINES ; do
543              else              else
544                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
545              fi              fi
546              rm -f tmpfs tmpfp tmpdf              rm -f $TMP.fs $TMP.fp $TMP.dif
547            fi            fi
548          done          done
549          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi
# Line 478  for pname in $MACHINES ; do Line 556  for pname in $MACHINES ; do
556  done  done
557    
558  echo "Start time:  $sTime" | tee -a $OUTPFIL  echo "Start time:  $sTime" | tee -a $OUTPFIL
559  echo "End  time:   "`date` | tee -a $OUTPFIL | tee -a $OUTPSUM  echo "End time:    "`date` | tee -a $OUTPFIL | tee -a $OUTPSUM
560    
561  rm -f ./dir_all ./slist ./plist  rm -f $TMP.dir_all $TMP.slist $TMP.plist
562  if test $OUTPFIL = "TTT.$$" ; then rm -f $OUTPFIL ; fi  if test $OUTPFIL = "TTT.$$" ; then rm -f $OUTPFIL ; fi
563  if test "x$ADDRESS" != 'xnone' ; then  if test "x$ADDRESS" != 'xnone' ; then
564    echo ".. send $OUTPSUM to $ADDRESS"    echo ".. send $OUTPSUM to $ADDRESS"
565    mail -s $OUTPSUM $ADDRESS < $OUTPSUM    mail -s 'check_outp summary' $ADDRESS < $OUTPSUM
566  fi  fi
567  echo ".. cat $OUTPSUM"  echo ".. cat $OUTPSUM"
568  cat $OUTPSUM  cat $OUTPSUM

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.45

  ViewVC Help
Powered by ViewVC 1.1.22