/[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.34 by jmc, Sat Sep 8 14:25:13 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              EXTRA=
106                FAST=0
107                DVLP=0
108                MPI=0
109              MTH=0              MTH=0
110                UR4=0
111              if test -r $dir/summary.txt ; then              if test -r $dir/summary.txt ; then
112                  comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null`                  comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null`
113                  eval $comm                  eval $comm
114                    comm=`grep 'TANGLIN=true' $dir/summary.txt 2>/dev/null`
115                    eval $comm
116                  RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`                  RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
117                  NOI3E=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt`                  comm=`grep '^run: .*testreport.* ' $dir/summary.txt`
118                  MTH=`grep -c "^run: .*testreport.* -mth" $dir/summary.txt`                  EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"`
119                    if test "x$EXTRA" = x ; then
120                        EXTRA=`echo "$comm" | grep " -*-t\>" | sed -e "s/^.*-*-t\>//" -e "s/ -.*$//"`
121                    fi
122                    if test "x$EXTRA" = x ; then EXTRA=0 ; else
123                        #echo -n "EXTRA=$EXTRA"
124                        nn0=`echo $EXTRA | sed "s/ *' *//g" | wc -w`
125                        nn1=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<monod_"`
126                        nn2=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<darwin_"`
127                        EXTRA=1
128                        if [ $nn1 -ge 2 ] ; then EXTRA=2 ; fi
129                        if [ $nn2 -ge 2 ] ; then EXTRA=3 ; fi
130                        #echo " : nn0=$nn0 ; nn1=$nn1 ; nn2=$nn2"
131                    fi
132                    FAST=`echo "$comm" | grep -c " -*-fast\>"`
133                    if test "x$FAST" = x0 ; then
134                       FAST=`echo "$comm" | grep -c " '*-noieee'*"`
135                    fi
136                    DVLP=`echo "$comm" | grep -c " -*-devel\>"`
137                    MPI=`echo "$comm" | grep -c " -*-mpi\>"`
138                    if test "x$MPI" = x0 ; then
139                       MPI=`echo "$comm" | grep -c " -*-MPI\>"`
140                    fi
141                    MTH=`echo "$comm" | grep -c " -*-mth\>"`
142                    UR4=`echo "$comm" | grep -c " -*-use_r4\>"`
143                    if test "x$UR4" = x0 ; then
144                       UR4=`echo "$comm" | grep -c " -*-ur4\>"`
145                    fi
146              fi              fi
147              if test "x$RESTART" = x0 ; then              if test "x$ADJOINT" = xtrue ; then
148                  kind="forward"                  kind="adjoint" ; order=0
149                  test "x$ADJOINT" = xtrue  &&  kind="adjoint"              elif test "x$TANGLIN" = xtrue ; then
150                    kind="tanglin" ; order=1
151                elif test "x$RESTART" = x0 ; then
152                    kind="forward" ; order=2
153              else              else
154                  kind="restart"                  kind="restart" ; order=3
155                fi
156                order=`expr $order + 10 \* $EXTRA`
157                order=`printf '%3.3i' $order`
158                if test "x$UR4" = x1 ; then
159                    OPTFILE="${OPTFILE}.use_r4"
160                fi
161                if test "x$MPI" = x1 ; then
162                    yy=`echo $OPTFILE | grep -c '+mpi'`
163                    if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi
164              fi              fi
165              if test "x$MTH" = x1 ; then              if test "x$MTH" = x1 ; then
166                  yy=`echo $OPTFILE | grep -c '+mth$'`                  yy=`echo $OPTFILE | grep -c '+mth$'`
167                  if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi                  if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi
168              fi              fi
169              if test "x$NOI3E" = x1 ; then              if test "x$FAST" = x1 ; then
170                  OPTFILE="${OPTFILE}.noieee"                  OPTFILE="${OPTFILE}.fast"
171              fi              fi
172              day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`              if test "x$DVLP" = x1 ; then
173              ttt=`echo $day | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`                  OPTFILE="${OPTFILE}.dvlp"
174              day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`              fi
175                day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`
176              if [ $day -lt $BEFORE ] ; then              ttt=`echo $day | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`
177                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./plist              day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`
178              elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then  
179                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./slist              if [ $day -lt $BEFORE ] ; then
180                    echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./plist
181                elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then
182                    echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./slist
183              else              else
184                  if test $dBug = 't' ; then                  if test $dBug = 't' ; then
185                     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 225  for ac_option ; do
225    
226      # If the previous option needs an argument, assign it.      # If the previous option needs an argument, assign it.
227      if test -n "$ac_prev"; then      if test -n "$ac_prev"; then
228          eval "$ac_prev=\$ac_option"          eval "$ac_prev=\$ac_option"
229          ac_prev=          ac_prev=
230          continue          continue
231      fi      fi
232    
233      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
234    
235      case $ac_option in      case $ac_option in
236                    
237          -help | --help | -h | --h)          -help | --help | -h | --h) usage ;;
238              usage ;;          -verbose | --verbose | -v | --v) dBug=t ;;
         -verbose | --verbose | -v | --v)  
             dBug=t ;;  
239                    
240          -list  | --list  | -l | --l)          -list  | --list  | -l | --l) ac_prev=MACHINES ;;
241              ac_prev=MACHINES ;;          -list=* | --list=*) MACHINES=$ac_optarg ;;
242          -list=* | --list=*)  
243              MACHINES=$ac_optarg ;;          -day  | --day  | -d | --d) ac_prev=FIRSTDAY ;;
244            -day=* | --day=*) FIRSTDAY=$ac_optarg ;;
245          -day  | --day  | -d | --d)  
246              ac_prev=FIRSTDAY ;;          -upto | --upto | -u | --u) ac_prev=LASTDAY ;;
247          -day=* | --day=*)          -upto=* | --upto=*) LASTDAY=$ac_optarg ;;
248              FIRSTDAY=$ac_optarg ;;  
249            -before | --before | -b | --b) ac_prev=BEFORE ;;
250          -upto | --upto | -u | --u)          -before=* | --before=*) BEFORE=$ac_optarg ;;
251              ac_prev=LASTDAY ;;  
252          -upto=* | --upto=*)          -outp | --outp | -o | --o) ac_prev=OUTPFIL ;;
253              LASTDAY=$ac_optarg ;;          -outp=* | --outp=*) OUTPFIL=$ac_optarg ;;
254    
255          -before | --before | -b | --b)          -nldf | --nldf | -n | --n) ac_prev=NBLDIFF ;;
256              ac_prev=BEFORE ;;          -nldf=* | --nldf=*) NBLDIFF=$ac_optarg ;;
257          -before=* | --before=*)  
258              BEFORE=$ac_optarg ;;          -addr | --addr | -a | --a) ac_prev=ADDRESS ;;
259            -addr=* | --addr=*) ADDRESS=$ac_optarg ;;
260          -outp | --outp | -o | --o)  
261              ac_prev=OUTPFIL ;;          *) echo "Error: don't understand argument \"$ac_option\""
262          -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  
             ;;  
263    
264       esac       esac
265    
# Line 314  echo "     name     checked   comp    Di Line 344  echo "     name     checked   comp    Di
344  ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all  ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all
345    
346  if test "x$MACHINES" = "x_All_" ; then  if test "x$MACHINES" = "x_All_" ; then
347    MACHINES="faulks meander aces.jmc aces.ce107 baudelaire dickens danton beagle harbor"    MACHINES="faulks meander aces- acesgrid baudelaire dickens danton beagle harbor"
348    MACHINES="$MACHINES pleiades iblade rays solasrv sx8"    MACHINES="$MACHINES pleiades iblade rays solasrv sx8"
349    MACHINES="$MACHINES trane dodongo dokdo stomp bigred"    MACHINES="$MACHINES trane dodongo dokdo stomp bigred"
350    
# Line 322  if test "x$MACHINES" = "x_All_" ; then Line 352  if test "x$MACHINES" = "x_All_" ; then
352    for madd in $MALL ; do    for madd in $MALL ; do
353      present=0      present=0
354      for m in $MACHINES ; do      for m in $MACHINES ; do
355          mm=`echo $m | sed 's/\./ /g' | awk '{print $1}'`          mm=`echo $m | sed 's/\./ /g' | awk '{print $1}'`
356          echo $madd | grep $mm > /dev/null 2>&1          echo $madd | grep $mm > /dev/null 2>&1
357          RETVAL=$?          RETVAL=$?
358          test $RETVAL = 0  &&  present=1          test $RETVAL = 0  &&  present=1
359          continue          continue
360      done      done
361      test $present = 0  &&  MACHINES="$MACHINES $madd"      test $present = 0  &&  MACHINES="$MACHINES $madd"
362    done    done
# Line 335  fi Line 365  fi
365    
366  for pname in $MACHINES ; do  for pname in $MACHINES ; do
367    
368        sname=`echo $pname | sed 's/-$//'`
369      mname=`echo $pname | sed 's/\./ /g' | awk '{print $1}'`      mname=`echo $pname | sed 's/\./ /g' | awk '{print $1}'`
370      sUser=      sUser=
371      if test $mname != $pname ; then      if test $mname != $pname ; then
# Line 363  for pname in $MACHINES ; do Line 394  for pname in $MACHINES ; do
394          for key in $keys ; do          for key in $keys ; do
395            ctot=`expr $ctot + 1`            ctot=`expr $ctot + 1`
396            sline=`grep "^$key " ./slist | head -1`            sline=`grep "^$key " ./slist | head -1`
397            sdir=`echo $sline | cut -d " " -f 5`            sdir=`echo $sline | cut -d " " -f 5`
398            type=`echo $sline | cut -d " " -f 4`            type=`echo $sline | cut -d " " -f 4`
399            optf=`echo $sline | cut -d " " -f 3`            optf=`echo $sline | cut -d " " -f 3`
400            num=`grep -c "^$key" ./plist`            num=`grep -c "^$key" ./plist`
401            if test $num = 0 -a $monthDir = 1 ; then            if test $num = 0 -a $monthDir = 1 ; then
402            #- add results from previous month directory to "plist".            #- add results from previous month directory to "plist".
403              monthDir=2              monthDir=2
404              make_resdir_list              make_resdir_list
405              num=`grep -c "^$key" ./plist`              num=`grep -c "^$key" ./plist`
406            fi            fi
407            #- discard unsafe test:            #- discard unsafe test:
408            dd=`echo $optf | grep -c 'gfortran+mth'`            dd=`echo $optf | grep -c 'gfortran+mth'`
409            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 411  for pname in $MACHINES ; do
411            #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
412            #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
413            dd=`echo $optf | grep -c 'bigred.*noieee'`            dd=`echo $optf | grep -c 'bigred.*noieee'`
414            if test $mname = 'bigred' -a $dd = 1 ; then num=-1 ; fi            #if test $mname = 'bigred' -a $dd = 1 ; then num=-1 ; fi
415            if test $num -lt 0 ; then            if test $num -lt 0 ; then
416              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL
417              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
418            elif test $num = '0' ; then            elif test $num = '0' ; then
419              echo "no previous test for:" $key | tee -a $OUTPFIL              echo "no previous test for:" $key | tee -a $OUTPFIL
420              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
421            else            else
422              pline=`grep "^$key " ./plist | head -1`              pline=`grep "^$key " ./plist | head -1`
423              if test $dBug = 't' ; then              if test $dBug = 't' ; then
424                  echo "s='$sline'" | tee -a $OUTPFIL                  echo "s='$sline'" | tee -a $OUTPFIL
425                  echo "p='$pline'" | tee -a $OUTPFIL                  echo "p='$pline'" | tee -a $OUTPFIL
426              fi              fi
427              pdir=`echo $pline | cut -d " " -f 5`              pdir=`echo $pline | cut -d " " -f 5`
428              outs="$INDIR/$sdir/summary.txt"              outs="$INDIR/$sdir/summary.txt"
429              sed -n "5,$ p" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outs ) | tail -1`
430                                   | sed 's/ OPTFILE=.*\// OPTFILE=/g' \              sed "1,$xx d" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
431                                   | grep -v '^[A-S][a-t]* time:  ' > tmpfs                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfs
432              outp="$INDIR/$pdir/summary.txt"              outp="$INDIR/$pdir/summary.txt"
433              sed -n "5,$ p" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outp ) | tail -1`
434                                   | sed 's/ OPTFILE=.*\// OPTFILE=/g' \              sed "1,$xx d" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
435                                   | grep -v '^[A-S][a-t]* time:  ' > tmpfp                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfp
436              #-- re-order list of exp (according to local "sort" order)              #-- re-order list of exp (according to local "sort" order)
437              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`
438              for xx in $listD              for xx in $listD
# Line 421  for pname in $MACHINES ; do Line 452  for pname in $MACHINES ; do
452              diff tmpfs tmpfp > tmpdf              diff tmpfs tmpfp > tmpdf
453              yy=$?              yy=$?
454              if test $yy != '0' ; then              if test $yy != '0' ; then
455                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
456                  #grep '^run: ' $outp                  #grep '^run: ' $outp
457                  #grep '^run: ' $outs                  #grep '^run: ' $outs
458                  #-- score for each test:                  #-- score for each test:
# Line 439  for pname in $MACHINES ; do Line 470  for pname in $MACHINES ; do
470                  ndf=`expr $ndf / 2`                  ndf=`expr $ndf / 2`
471                  nn=`grep -c '^---' tmpdf`                  nn=`grep -c '^---' tmpdf`
472                  ndf=`expr $ndf - $nn`                  ndf=`expr $ndf - $nn`
473                  if [ $ndf -le $NBLDIFF ] ; then                  if [ $ndf -le $NBLDIFF ] ; then
474                    cat tmpdf                    cat tmpdf
475                  else                  else
476                    echo " $ndf lines differ ( $score_s , $score_p )"                    echo " $ndf lines differ ( $score_s , $score_p )"
# Line 447  for pname in $MACHINES ; do Line 478  for pname in $MACHINES ; do
478                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL
479                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL
480                  cat tmpdf >> $OUTPFIL                  cat tmpdf >> $OUTPFIL
481                  if [ $cdif -eq 0 ] ; then                  if [ $cdif -eq 0 ] ; then
482                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
483                  else                  else
484                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
485                  fi                  fi
486                  cdif=`expr $cdif + 1`                  cdif=`expr $cdif + 1`
487                  echo '----------------------------------------' | tee -a $OUTPFIL                  echo '----------------------------------------' | tee -a $OUTPFIL
488              else              else
489                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
490              fi              fi
491              rm -f tmpfs tmpfp tmpdf              rm -f tmpfs tmpfp tmpdf
492            fi            fi
493          done          done
494          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi
495          printf '%11s :  %3i      %4s   %3i  ' $pname $ctot $tmis $cdif >> $OUTPSUM          printf '%11s :  %3i      %4s   %3i  ' $sname $ctot $tmis $cdif >> $OUTPSUM
496          if [ $cdif -gt 0 ] ; then          if [ $cdif -gt 0 ] ; then
497            echo "   $clin" >> $OUTPSUM            echo "   $clin" >> $OUTPSUM
498         else echo "" >> $OUTPSUM ; fi          else echo "" >> $OUTPSUM ; fi
499      fi      fi
500    
501  done  done

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

  ViewVC Help
Powered by ViewVC 1.1.22