/[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.32 by jmc, Thu Aug 16 02:48:24 2012 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 70  make_resdir_list() Line 69  make_resdir_list()
69              if test "x$sUser" != x ; then              if test "x$sUser" != x ; then
70                  tUser=                  tUser=
71                  if test -f $dir/genmake_state ; then                  if test -f $dir/genmake_state ; then
72                     nn=`sed -n '/^# executed by:/=' $dir/genmake_state`                     nn=`sed -n '/^# executed by:/=' $dir/genmake_state`
73                     if test "x$nn" != x ; then                     if test "x$nn" != x ; then
74                       nn=`expr $nn + 1`                       nn=`expr $nn + 1`
75                       tUser=`sed -n "$nn s/^# *// p" $dir/genmake_state | sed 's/@.*$//'`                       tUser=`sed -n "$nn s/^# *// p" $dir/genmake_state | sed 's/@.*$//'`
# Line 101  make_resdir_list() Line 100  make_resdir_list()
100              fi              fi
101    
102              ADJOINT=              ADJOINT=
103                TANGLIN=
104              RESTART=0              RESTART=0
105              NOI3E=0              FAST=0
106                DVLP=0
107                MPI=0
108              MTH=0              MTH=0
109                UR4=0
110              if test -r $dir/summary.txt ; then              if test -r $dir/summary.txt ; then
111                  comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null`                  comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null`
112                  eval $comm                  eval $comm
113                    comm=`grep 'TANGLIN=true' $dir/summary.txt 2>/dev/null`
114                    eval $comm
115                  RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`                  RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
116                  NOI3E=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt`                  FAST=`grep -c "^run: .*testreport.* '*-fast'*" $dir/summary.txt`
117                    if test "x$FAST" = x0 ; then
118                       FAST=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt`
119                    fi
120                    DVLP=`grep -c "^run: .*testreport.* '*-devel'*" $dir/summary.txt`
121                    MPI=`grep -c "^run: .*testreport.* -mpi " $dir/summary.txt`
122                    if test "x$MPI" = x0 ; then
123                       MPI=`grep -c "^run: .*testreport.* -MPI " $dir/summary.txt`
124                    fi
125                  MTH=`grep -c "^run: .*testreport.* -mth" $dir/summary.txt`                  MTH=`grep -c "^run: .*testreport.* -mth" $dir/summary.txt`
126                    UR4=`grep -c "^run: .*testreport.* -use_r4 " $dir/summary.txt`
127                    if test "x$UR4" = x0 ; then
128                       UR4=`grep -c "^run: .*testreport.* -ur4 " $dir/summary.txt`
129                    fi
130              fi              fi
131              if test "x$RESTART" = x0 ; then              if test "x$ADJOINT" = xtrue ; then
132                  kind="forward"                  kind="adjoint" ; order='000'
133                  test "x$ADJOINT" = xtrue  &&  kind="adjoint"              elif test "x$TANGLIN" = xtrue ; then
134                    kind="tanglin" ; order='001'
135                elif test "x$RESTART" = x0 ; then
136                    kind="forward" ; order='002'
137              else              else
138                  kind="restart"                  kind="restart" ; order='003'
139                fi
140                if test "x$UR4" = x1 ; then
141                    OPTFILE="${OPTFILE}.use_r4"
142                fi
143                if test "x$MPI" = x1 ; then
144                    yy=`echo $OPTFILE | grep -c '+mpi'`
145                    if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi
146              fi              fi
147              if test "x$MTH" = x1 ; then              if test "x$MTH" = x1 ; then
148                  yy=`echo $OPTFILE | grep -c '+mth$'`                  yy=`echo $OPTFILE | grep -c '+mth$'`
149                  if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi                  if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi
150              fi              fi
151              if test "x$NOI3E" = x1 ; then              if test "x$FAST" = x1 ; then
152                  OPTFILE="${OPTFILE}.noieee"                  OPTFILE="${OPTFILE}.fast"
153              fi              fi
154              day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`              if test "x$DVLP" = x1 ; then
155              ttt=`echo $day | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`                  OPTFILE="${OPTFILE}.dvlp"
156              day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`              fi
157                day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`
158              if [ $day -lt $BEFORE ] ; then              ttt=`echo $day | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`
159                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./plist              day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`
160              elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then  
161                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./slist              if [ $day -lt $BEFORE ] ; then
162                    echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./plist
163                elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then
164                    echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./slist
165              else              else
166                  if test $dBug = 't' ; then                  if test $dBug = 't' ; then
167                     echo "discard day='$day' from: $i" | tee -a $OUTPFIL                     echo "discard day='$day' from: $i" | tee -a $OUTPFIL
# Line 177  for ac_option ; do Line 207  for ac_option ; do
207    
208      # If the previous option needs an argument, assign it.      # If the previous option needs an argument, assign it.
209      if test -n "$ac_prev"; then      if test -n "$ac_prev"; then
210          eval "$ac_prev=\$ac_option"          eval "$ac_prev=\$ac_option"
211          ac_prev=          ac_prev=
212          continue          continue
213      fi      fi
214    
215      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
216    
217      case $ac_option in      case $ac_option in
218                    
219          -help | --help | -h | --h)          -help | --help | -h | --h) usage ;;
220              usage ;;          -verbose | --verbose | -v | --v) dBug=t ;;
         -verbose | --verbose | -v | --v)  
             dBug=t ;;  
221                    
222          -list  | --list  | -l | --l)          -list  | --list  | -l | --l) ac_prev=MACHINES ;;
223              ac_prev=MACHINES ;;          -list=* | --list=*) MACHINES=$ac_optarg ;;
224          -list=* | --list=*)  
225              MACHINES=$ac_optarg ;;          -day  | --day  | -d | --d) ac_prev=FIRSTDAY ;;
226            -day=* | --day=*) FIRSTDAY=$ac_optarg ;;
227          -day  | --day  | -d | --d)  
228              ac_prev=FIRSTDAY ;;          -upto | --upto | -u | --u) ac_prev=LASTDAY ;;
229          -day=* | --day=*)          -upto=* | --upto=*) LASTDAY=$ac_optarg ;;
230              FIRSTDAY=$ac_optarg ;;  
231            -before | --before | -b | --b) ac_prev=BEFORE ;;
232          -upto | --upto | -u | --u)          -before=* | --before=*) BEFORE=$ac_optarg ;;
233              ac_prev=LASTDAY ;;  
234          -upto=* | --upto=*)          -outp | --outp | -o | --o) ac_prev=OUTPFIL ;;
235              LASTDAY=$ac_optarg ;;          -outp=* | --outp=*) OUTPFIL=$ac_optarg ;;
236    
237          -before | --before | -b | --b)          -nldf | --nldf | -n | --n) ac_prev=NBLDIFF ;;
238              ac_prev=BEFORE ;;          -nldf=* | --nldf=*) NBLDIFF=$ac_optarg ;;
239          -before=* | --before=*)  
240              BEFORE=$ac_optarg ;;          -addr | --addr | -a | --a) ac_prev=ADDRESS ;;
241            -addr=* | --addr=*) ADDRESS=$ac_optarg ;;
242          -outp | --outp | -o | --o)  
243              ac_prev=OUTPFIL ;;          *) echo "Error: don't understand argument \"$ac_option\""
244          -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  
             ;;  
245    
246       esac       esac
247    
# Line 314  echo "     name     checked   comp    Di Line 326  echo "     name     checked   comp    Di
326  ( 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
327    
328  if test "x$MACHINES" = "x_All_" ; then  if test "x$MACHINES" = "x_All_" ; then
329    MACHINES="faulks meander aces.jmc aces.ce107 baudelaire dickens danton beagle harbor"    MACHINES="faulks meander aces- acesgrid baudelaire dickens danton beagle harbor"
330    MACHINES="$MACHINES pleiades iblade rays solasrv sx8"    MACHINES="$MACHINES pleiades iblade rays solasrv sx8"
331    MACHINES="$MACHINES trane dodongo dokdo stomp bigred"    MACHINES="$MACHINES trane dodongo dokdo stomp bigred"
332    
# Line 322  if test "x$MACHINES" = "x_All_" ; then Line 334  if test "x$MACHINES" = "x_All_" ; then
334    for madd in $MALL ; do    for madd in $MALL ; do
335      present=0      present=0
336      for m in $MACHINES ; do      for m in $MACHINES ; do
337          mm=`echo $m | sed 's/\./ /g' | awk '{print $1}'`          mm=`echo $m | sed 's/\./ /g' | awk '{print $1}'`
338          echo $madd | grep $mm > /dev/null 2>&1          echo $madd | grep $mm > /dev/null 2>&1
339          RETVAL=$?          RETVAL=$?
340          test $RETVAL = 0  &&  present=1          test $RETVAL = 0  &&  present=1
341          continue          continue
342      done      done
343      test $present = 0  &&  MACHINES="$MACHINES $madd"      test $present = 0  &&  MACHINES="$MACHINES $madd"
344    done    done
# Line 335  fi Line 347  fi
347    
348  for pname in $MACHINES ; do  for pname in $MACHINES ; do
349    
350        sname=`echo $pname | sed 's/-$//'`
351      mname=`echo $pname | sed 's/\./ /g' | awk '{print $1}'`      mname=`echo $pname | sed 's/\./ /g' | awk '{print $1}'`
352      sUser=      sUser=
353      if test $mname != $pname ; then      if test $mname != $pname ; then
# Line 363  for pname in $MACHINES ; do Line 376  for pname in $MACHINES ; do
376          for key in $keys ; do          for key in $keys ; do
377            ctot=`expr $ctot + 1`            ctot=`expr $ctot + 1`
378            sline=`grep "^$key " ./slist | head -1`            sline=`grep "^$key " ./slist | head -1`
379            sdir=`echo $sline | cut -d " " -f 5`            sdir=`echo $sline | cut -d " " -f 5`
380            type=`echo $sline | cut -d " " -f 4`            type=`echo $sline | cut -d " " -f 4`
381            optf=`echo $sline | cut -d " " -f 3`            optf=`echo $sline | cut -d " " -f 3`
382            num=`grep -c "^$key" ./plist`            num=`grep -c "^$key" ./plist`
383            if test $num = 0 -a $monthDir = 1 ; then            if test $num = 0 -a $monthDir = 1 ; then
384            #- add results from previous month directory to "plist".            #- add results from previous month directory to "plist".
385              monthDir=2              monthDir=2
386              make_resdir_list              make_resdir_list
387              num=`grep -c "^$key" ./plist`              num=`grep -c "^$key" ./plist`
388            fi            fi
389            #- discard unsafe test:            #- discard unsafe test:
390            dd=`echo $optf | grep -c 'gfortran+mth'`            dd=`echo $optf | grep -c 'gfortran+mth'`
391            if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi            if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi
# Line 380  for pname in $MACHINES ; do Line 393  for pname in $MACHINES ; do
393            #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
394            #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
395            dd=`echo $optf | grep -c 'bigred.*noieee'`            dd=`echo $optf | grep -c 'bigred.*noieee'`
396            if test $mname = 'bigred' -a $dd = 1 ; then num=-1 ; fi            #if test $mname = 'bigred' -a $dd = 1 ; then num=-1 ; fi
397            if test $num -lt 0 ; then            if test $num -lt 0 ; then
398              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL
399              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
400            elif test $num = '0' ; then            elif test $num = '0' ; then
401              echo "no previous test for:" $key | tee -a $OUTPFIL              echo "no previous test for:" $key | tee -a $OUTPFIL
402              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
403            else            else
404              pline=`grep "^$key " ./plist | head -1`              pline=`grep "^$key " ./plist | head -1`
405              if test $dBug = 't' ; then              if test $dBug = 't' ; then
406                  echo "s='$sline'" | tee -a $OUTPFIL                  echo "s='$sline'" | tee -a $OUTPFIL
407                  echo "p='$pline'" | tee -a $OUTPFIL                  echo "p='$pline'" | tee -a $OUTPFIL
408              fi              fi
409              pdir=`echo $pline | cut -d " " -f 5`              pdir=`echo $pline | cut -d " " -f 5`
410              outs="$INDIR/$sdir/summary.txt"              outs="$INDIR/$sdir/summary.txt"
411              sed -n "5,$ p" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outs ) | tail -1`
412                                   | sed 's/ OPTFILE=.*\// OPTFILE=/g' \              sed "1,$xx d" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
413                                   | grep -v '^[A-S][a-t]* time:  ' > tmpfs                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfs
414              outp="$INDIR/$pdir/summary.txt"              outp="$INDIR/$pdir/summary.txt"
415              sed -n "5,$ p" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outp ) | tail -1`
416                                   | sed 's/ OPTFILE=.*\// OPTFILE=/g' \              sed "1,$xx d" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
417                                   | grep -v '^[A-S][a-t]* time:  ' > tmpfp                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfp
418              #-- re-order list of exp (according to local "sort" order)              #-- re-order list of exp (according to local "sort" order)
419              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`
420              for xx in $listD              for xx in $listD
# Line 421  for pname in $MACHINES ; do Line 434  for pname in $MACHINES ; do
434              diff tmpfs tmpfp > tmpdf              diff tmpfs tmpfp > tmpdf
435              yy=$?              yy=$?
436              if test $yy != '0' ; then              if test $yy != '0' ; then
437                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
438                  #grep '^run: ' $outp                  #grep '^run: ' $outp
439                  #grep '^run: ' $outs                  #grep '^run: ' $outs
440                  #-- score for each test:                  #-- score for each test:
# Line 439  for pname in $MACHINES ; do Line 452  for pname in $MACHINES ; do
452                  ndf=`expr $ndf / 2`                  ndf=`expr $ndf / 2`
453                  nn=`grep -c '^---' tmpdf`                  nn=`grep -c '^---' tmpdf`
454                  ndf=`expr $ndf - $nn`                  ndf=`expr $ndf - $nn`
455                  if [ $ndf -le $NBLDIFF ] ; then                  if [ $ndf -le $NBLDIFF ] ; then
456                    cat tmpdf                    cat tmpdf
457                  else                  else
458                    echo " $ndf lines differ ( $score_s , $score_p )"                    echo " $ndf lines differ ( $score_s , $score_p )"
# Line 447  for pname in $MACHINES ; do Line 460  for pname in $MACHINES ; do
460                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL
461                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL
462                  cat tmpdf >> $OUTPFIL                  cat tmpdf >> $OUTPFIL
463                  if [ $cdif -eq 0 ] ; then                  if [ $cdif -eq 0 ] ; then
464                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
465                  else                  else
466                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
467                  fi                  fi
468                  cdif=`expr $cdif + 1`                  cdif=`expr $cdif + 1`
469                  echo '----------------------------------------' | tee -a $OUTPFIL                  echo '----------------------------------------' | tee -a $OUTPFIL
470              else              else
471                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
472              fi              fi
473              rm -f tmpfs tmpfp tmpdf              rm -f tmpfs tmpfp tmpdf
474            fi            fi
475          done          done
476          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi
477          printf '%11s :  %3i      %4s   %3i  ' $pname $ctot $tmis $cdif >> $OUTPSUM          printf '%11s :  %3i      %4s   %3i  ' $sname $ctot $tmis $cdif >> $OUTPSUM
478          if [ $cdif -gt 0 ] ; then          if [ $cdif -gt 0 ] ; then
479            echo "   $clin" >> $OUTPSUM            echo "   $clin" >> $OUTPSUM
480         else echo "" >> $OUTPSUM ; fi          else echo "" >> $OUTPSUM ; fi
481      fi      fi
482    
483  done  done

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

  ViewVC Help
Powered by ViewVC 1.1.22