/[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.26 by jmc, Wed Nov 24 16:22:08 2010 UTC revision 1.27 by jmc, Fri Jan 21 19:45:01 2011 UTC
# Line 70  make_resdir_list() Line 70  make_resdir_list()
70              if test "x$sUser" != x ; then              if test "x$sUser" != x ; then
71                  tUser=                  tUser=
72                  if test -f $dir/genmake_state ; then                  if test -f $dir/genmake_state ; then
73                     nn=`sed -n '/^# executed by:/=' $dir/genmake_state`                     nn=`sed -n '/^# executed by:/=' $dir/genmake_state`
74                     if test "x$nn" != x ; then                     if test "x$nn" != x ; then
75                       nn=`expr $nn + 1`                       nn=`expr $nn + 1`
76                       tUser=`sed -n "$nn s/^# *// p" $dir/genmake_state | sed 's/@.*$//'`                       tUser=`sed -n "$nn s/^# *// p" $dir/genmake_state | sed 's/@.*$//'`
# Line 124  make_resdir_list() Line 124  make_resdir_list()
124              if test "x$NOI3E" = x1 ; then              if test "x$NOI3E" = x1 ; then
125                  OPTFILE="${OPTFILE}.noieee"                  OPTFILE="${OPTFILE}.noieee"
126              fi              fi
127              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]$//'`
128              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]$//'`
129              day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`              day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`
130    
131              if [ $day -lt $BEFORE ] ; then              if [ $day -lt $BEFORE ] ; then
132                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./plist                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./plist
133              elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then              elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then
134                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./slist                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./slist
135              else              else
136                  if test $dBug = 't' ; then                  if test $dBug = 't' ; then
# Line 186  for ac_option ; do Line 186  for ac_option ; do
186    
187      case $ac_option in      case $ac_option in
188                    
189          -help | --help | -h | --h)          -help | --help | -h | --h) usage ;;
190              usage ;;          -verbose | --verbose | -v | --v) dBug=t ;;
         -verbose | --verbose | -v | --v)  
             dBug=t ;;  
191                    
192          -list  | --list  | -l | --l)          -list  | --list  | -l | --l) ac_prev=MACHINES ;;
193              ac_prev=MACHINES ;;          -list=* | --list=*) MACHINES=$ac_optarg ;;
194          -list=* | --list=*)  
195              MACHINES=$ac_optarg ;;          -day  | --day  | -d | --d) ac_prev=FIRSTDAY ;;
196            -day=* | --day=*) FIRSTDAY=$ac_optarg ;;
197          -day  | --day  | -d | --d)  
198              ac_prev=FIRSTDAY ;;          -upto | --upto | -u | --u) ac_prev=LASTDAY ;;
199          -day=* | --day=*)          -upto=* | --upto=*) LASTDAY=$ac_optarg ;;
200              FIRSTDAY=$ac_optarg ;;  
201            -before | --before | -b | --b) ac_prev=BEFORE ;;
202          -upto | --upto | -u | --u)          -before=* | --before=*) BEFORE=$ac_optarg ;;
203              ac_prev=LASTDAY ;;  
204          -upto=* | --upto=*)          -outp | --outp | -o | --o) ac_prev=OUTPFIL ;;
205              LASTDAY=$ac_optarg ;;          -outp=* | --outp=*) OUTPFIL=$ac_optarg ;;
206    
207          -before | --before | -b | --b)          -nldf | --nldf | -n | --n) ac_prev=NBLDIFF ;;
208              ac_prev=BEFORE ;;          -nldf=* | --nldf=*) NBLDIFF=$ac_optarg ;;
209          -before=* | --before=*)  
210              BEFORE=$ac_optarg ;;          -addr | --addr | -a | --a) ac_prev=ADDRESS ;;
211            -addr=* | --addr=*) ADDRESS=$ac_optarg ;;
212          -outp | --outp | -o | --o)  
213              ac_prev=OUTPFIL ;;          *) echo "Error: don't understand argument \"$ac_option\""
214          -outp=* | --outp=*)             usage ;;
             OUTPFIL=$ac_optarg ;;  
   
         -nldf | --nldf | -n | --n)  
             ac_prev=NBLDIFF ;;  
         -nldf=* | --nldf=*)  
             NBLDIFF=$ac_optarg ;;  
   
         -addr | --addr | -a | --a)  
             ac_prev=ADDRESS ;;  
         -addr=* | --addr=*)  
             ADDRESS=$ac_optarg ;;  
   
         *)  
             echo "Error: don't understand argument \"$ac_option\""  
             usage  
             ;;  
215    
216       esac       esac
217    
# Line 322  if test "x$MACHINES" = "x_All_" ; then Line 304  if test "x$MACHINES" = "x_All_" ; then
304    for madd in $MALL ; do    for madd in $MALL ; do
305      present=0      present=0
306      for m in $MACHINES ; do      for m in $MACHINES ; do
307          mm=`echo $m | sed 's/\./ /g' | awk '{print $1}'`          mm=`echo $m | sed 's/\./ /g' | awk '{print $1}'`
308          echo $madd | grep $mm > /dev/null 2>&1          echo $madd | grep $mm > /dev/null 2>&1
309          RETVAL=$?          RETVAL=$?
310          test $RETVAL = 0  &&  present=1          test $RETVAL = 0  &&  present=1
311          continue          continue
312      done      done
313      test $present = 0  &&  MACHINES="$MACHINES $madd"      test $present = 0  &&  MACHINES="$MACHINES $madd"
314    done    done
# Line 363  for pname in $MACHINES ; do Line 345  for pname in $MACHINES ; do
345          for key in $keys ; do          for key in $keys ; do
346            ctot=`expr $ctot + 1`            ctot=`expr $ctot + 1`
347            sline=`grep "^$key " ./slist | head -1`            sline=`grep "^$key " ./slist | head -1`
348            sdir=`echo $sline | cut -d " " -f 5`            sdir=`echo $sline | cut -d " " -f 5`
349            type=`echo $sline | cut -d " " -f 4`            type=`echo $sline | cut -d " " -f 4`
350            optf=`echo $sline | cut -d " " -f 3`            optf=`echo $sline | cut -d " " -f 3`
351            num=`grep -c "^$key" ./plist`            num=`grep -c "^$key" ./plist`
352            if test $num = 0 -a $monthDir = 1 ; then            if test $num = 0 -a $monthDir = 1 ; then
353            #- add results from previous month directory to "plist".            #- add results from previous month directory to "plist".
354              monthDir=2              monthDir=2
355              make_resdir_list              make_resdir_list
356              num=`grep -c "^$key" ./plist`              num=`grep -c "^$key" ./plist`
357            fi            fi
358            #- discard unsafe test:            #- discard unsafe test:
359            dd=`echo $optf | grep -c 'gfortran+mth'`            dd=`echo $optf | grep -c 'gfortran+mth'`
360            if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi            if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi
# Line 383  for pname in $MACHINES ; do Line 365  for pname in $MACHINES ; do
365            if test $mname = 'bigred' -a $dd = 1 ; then num=-1 ; fi            if test $mname = 'bigred' -a $dd = 1 ; then num=-1 ; fi
366            if test $num -lt 0 ; then            if test $num -lt 0 ; then
367              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL
368              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
369            elif test $num = '0' ; then            elif test $num = '0' ; then
370              echo "no previous test for:" $key | tee -a $OUTPFIL              echo "no previous test for:" $key | tee -a $OUTPFIL
371              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
372            else            else
373              pline=`grep "^$key " ./plist | head -1`              pline=`grep "^$key " ./plist | head -1`
374              if test $dBug = 't' ; then              if test $dBug = 't' ; then
375                  echo "s='$sline'" | tee -a $OUTPFIL                  echo "s='$sline'" | tee -a $OUTPFIL
376                  echo "p='$pline'" | tee -a $OUTPFIL                  echo "p='$pline'" | tee -a $OUTPFIL
377              fi              fi
378              pdir=`echo $pline | cut -d " " -f 5`              pdir=`echo $pline | cut -d " " -f 5`
379              outs="$INDIR/$sdir/summary.txt"              outs="$INDIR/$sdir/summary.txt"
380              sed -n "5,$ p" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outs ) | tail -1`
381                                   | sed 's/ OPTFILE=.*\// OPTFILE=/g' \              sed "1,$xx d" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
382                                   | grep -v '^[A-S][a-t]* time:  ' > tmpfs                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfs
383              outp="$INDIR/$pdir/summary.txt"              outp="$INDIR/$pdir/summary.txt"
384              sed -n "5,$ p" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outp ) | tail -1`
385                                   | sed 's/ OPTFILE=.*\// OPTFILE=/g' \              sed "1,$xx d" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
386                                   | grep -v '^[A-S][a-t]* time:  ' > tmpfp                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfp
387              #-- re-order list of exp (according to local "sort" order)              #-- re-order list of exp (according to local "sort" order)
388              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`
389              for xx in $listD              for xx in $listD
# Line 421  for pname in $MACHINES ; do Line 403  for pname in $MACHINES ; do
403              diff tmpfs tmpfp > tmpdf              diff tmpfs tmpfp > tmpdf
404              yy=$?              yy=$?
405              if test $yy != '0' ; then              if test $yy != '0' ; then
406                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
407                  #grep '^run: ' $outp                  #grep '^run: ' $outp
408                  #grep '^run: ' $outs                  #grep '^run: ' $outs
409                  #-- score for each test:                  #-- score for each test:
# Line 439  for pname in $MACHINES ; do Line 421  for pname in $MACHINES ; do
421                  ndf=`expr $ndf / 2`                  ndf=`expr $ndf / 2`
422                  nn=`grep -c '^---' tmpdf`                  nn=`grep -c '^---' tmpdf`
423                  ndf=`expr $ndf - $nn`                  ndf=`expr $ndf - $nn`
424                  if [ $ndf -le $NBLDIFF ] ; then                  if [ $ndf -le $NBLDIFF ] ; then
425                    cat tmpdf                    cat tmpdf
426                  else                  else
427                    echo " $ndf lines differ ( $score_s , $score_p )"                    echo " $ndf lines differ ( $score_s , $score_p )"
# Line 447  for pname in $MACHINES ; do Line 429  for pname in $MACHINES ; do
429                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL
430                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL
431                  cat tmpdf >> $OUTPFIL                  cat tmpdf >> $OUTPFIL
432                  if [ $cdif -eq 0 ] ; then                  if [ $cdif -eq 0 ] ; then
433                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
434                  else                  else
435                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
436                  fi                  fi
437                  cdif=`expr $cdif + 1`                  cdif=`expr $cdif + 1`
438                  echo '----------------------------------------' | tee -a $OUTPFIL                  echo '----------------------------------------' | tee -a $OUTPFIL
439              else              else
440                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
441              fi              fi
442              rm -f tmpfs tmpfp tmpdf              rm -f tmpfs tmpfp tmpdf
443            fi            fi
444          done          done
445          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi
446          printf '%11s :  %3i      %4s   %3i  ' $pname $ctot $tmis $cdif >> $OUTPSUM          printf '%11s :  %3i      %4s   %3i  ' $pname $ctot $tmis $cdif >> $OUTPSUM
447          if [ $cdif -gt 0 ] ; then          if [ $cdif -gt 0 ] ; then
448            echo "   $clin" >> $OUTPSUM            echo "   $clin" >> $OUTPSUM
449         else echo "" >> $OUTPSUM ; fi          else echo "" >> $OUTPSUM ; fi
450      fi      fi
451    
452  done  done

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.22