/[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.25 by jmc, Fri Oct 29 20:18:55 2010 UTC revision 1.31 by jmc, Tue Aug 23 18:14:10 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 102  make_resdir_list() Line 102  make_resdir_list()
102    
103              ADJOINT=              ADJOINT=
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                  RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`                  RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt`
114                  NOI3E=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt`                  FAST=`grep -c "^run: .*testreport.* '*-fast'*" $dir/summary.txt`
115                    if test "x$FAST" = x0 ; then
116                       FAST=`grep -c "^run: .*testreport.* '*-noieee'*" $dir/summary.txt`
117                    fi
118                    DVLP=`grep -c "^run: .*testreport.* '*-devel'*" $dir/summary.txt`
119                    MPI=`grep -c "^run: .*testreport.* -mpi " $dir/summary.txt`
120                    if test "x$MPI" = x0 ; then
121                       MPI=`grep -c "^run: .*testreport.* -MPI " $dir/summary.txt`
122                    fi
123                  MTH=`grep -c "^run: .*testreport.* -mth" $dir/summary.txt`                  MTH=`grep -c "^run: .*testreport.* -mth" $dir/summary.txt`
124                    UR4=`grep -c "^run: .*testreport.* -use_r4 " $dir/summary.txt`
125                    if test "x$UR4" = x0 ; then
126                       UR4=`grep -c "^run: .*testreport.* -ur4 " $dir/summary.txt`
127                    fi
128              fi              fi
129              if test "x$RESTART" = x0 ; then              if test "x$ADJOINT" = xtrue ; then
130                  kind="forward"                  kind="adjoint" ; order='000'
131                  test "x$ADJOINT" = xtrue  &&  kind="adjoint"              elif test "x$RESTART" = x0 ; then
132                    kind="forward" ; order='001'
133              else              else
134                  kind="restart"                  kind="restart" ; order='002'
135                fi
136                if test "x$UR4" = x1 ; then
137                    OPTFILE="${OPTFILE}.use_r4"
138                fi
139                if test "x$MPI" = x1 ; then
140                    yy=`echo $OPTFILE | grep -c '+mpi'`
141                    if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi
142              fi              fi
143              if test "x$MTH" = x1 ; then              if test "x$MTH" = x1 ; then
144                  yy=`echo $OPTFILE | grep -c '+mth$'`                  yy=`echo $OPTFILE | grep -c '+mth$'`
145                  if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi                  if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi
146              fi              fi
147              if test "x$NOI3E" = x1 ; then              if test "x$FAST" = x1 ; then
148                  OPTFILE="${OPTFILE}.noieee"                  OPTFILE="${OPTFILE}.fast"
149              fi              fi
150              day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`              if test "x$DVLP" = x1 ; then
151              ttt=`echo $day | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`                  OPTFILE="${OPTFILE}.dvlp"
152              day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`              fi
153                day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`
154                ttt=`echo $day | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'`
155                day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'`
156    
157              if [ $day -lt $BEFORE ] ; then              if [ $day -lt $BEFORE ] ; then
158                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./plist                  echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./plist
159              elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then              elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then
160                  echo "$OPTFILE$kind $day $OPTFILE $kind $i" >> ./slist                  echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./slist
161              else              else
162                  if test $dBug = 't' ; then                  if test $dBug = 't' ; then
163                     echo "discard day='$day' from: $i" | tee -a $OUTPFIL                     echo "discard day='$day' from: $i" | tee -a $OUTPFIL
# Line 186  for ac_option ; do Line 212  for ac_option ; do
212    
213      case $ac_option in      case $ac_option in
214                    
215          -help | --help | -h | --h)          -help | --help | -h | --h) usage ;;
216              usage ;;          -verbose | --verbose | -v | --v) dBug=t ;;
         -verbose | --verbose | -v | --v)  
             dBug=t ;;  
217                    
218          -list  | --list  | -l | --l)          -list  | --list  | -l | --l) ac_prev=MACHINES ;;
219              ac_prev=MACHINES ;;          -list=* | --list=*) MACHINES=$ac_optarg ;;
220          -list=* | --list=*)  
221              MACHINES=$ac_optarg ;;          -day  | --day  | -d | --d) ac_prev=FIRSTDAY ;;
222            -day=* | --day=*) FIRSTDAY=$ac_optarg ;;
223          -day  | --day  | -d | --d)  
224              ac_prev=FIRSTDAY ;;          -upto | --upto | -u | --u) ac_prev=LASTDAY ;;
225          -day=* | --day=*)          -upto=* | --upto=*) LASTDAY=$ac_optarg ;;
226              FIRSTDAY=$ac_optarg ;;  
227            -before | --before | -b | --b) ac_prev=BEFORE ;;
228          -upto | --upto | -u | --u)          -before=* | --before=*) BEFORE=$ac_optarg ;;
229              ac_prev=LASTDAY ;;  
230          -upto=* | --upto=*)          -outp | --outp | -o | --o) ac_prev=OUTPFIL ;;
231              LASTDAY=$ac_optarg ;;          -outp=* | --outp=*) OUTPFIL=$ac_optarg ;;
232    
233          -before | --before | -b | --b)          -nldf | --nldf | -n | --n) ac_prev=NBLDIFF ;;
234              ac_prev=BEFORE ;;          -nldf=* | --nldf=*) NBLDIFF=$ac_optarg ;;
235          -before=* | --before=*)  
236              BEFORE=$ac_optarg ;;          -addr | --addr | -a | --a) ac_prev=ADDRESS ;;
237            -addr=* | --addr=*) ADDRESS=$ac_optarg ;;
238          -outp | --outp | -o | --o)  
239              ac_prev=OUTPFIL ;;          *) echo "Error: don't understand argument \"$ac_option\""
240          -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  
             ;;  
241    
242       esac       esac
243    
# Line 314  echo "     name     checked   comp    Di Line 322  echo "     name     checked   comp    Di
322  ( 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
323    
324  if test "x$MACHINES" = "x_All_" ; then  if test "x$MACHINES" = "x_All_" ; then
325    MACHINES="faulks meander aces.jmc aces.ce107 baudelaire dickens danton beagle harbor"    MACHINES="faulks meander aces- acesgrid baudelaire dickens danton beagle harbor"
326    MACHINES="$MACHINES columbia pleiades iblade rays solssrv solasrv sx8"    MACHINES="$MACHINES pleiades iblade rays solasrv sx8"
327    MACHINES="$MACHINES trane dodongo dokdo bigred"    MACHINES="$MACHINES trane dodongo dokdo stomp bigred"
328    
329    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`
330    for madd in $MALL ; do    for madd in $MALL ; do
331      present=0      present=0
332      for m in $MACHINES ; do      for m in $MACHINES ; do
333          mm=`echo $m | sed 's/\./ /g' | awk '{print $1}'`          mm=`echo $m | sed 's/\./ /g' | awk '{print $1}'`
334          echo $madd | grep $mm > /dev/null 2>&1          echo $madd | grep $mm > /dev/null 2>&1
335          RETVAL=$?          RETVAL=$?
336          test $RETVAL = 0  &&  present=1          test $RETVAL = 0  &&  present=1
337          continue          continue
338      done      done
339      test $present = 0  &&  MACHINES="$MACHINES $madd"      test $present = 0  &&  MACHINES="$MACHINES $madd"
340    done    done
# Line 335  fi Line 343  fi
343    
344  for pname in $MACHINES ; do  for pname in $MACHINES ; do
345    
346        sname=`echo $pname | sed 's/-$//'`
347      mname=`echo $pname | sed 's/\./ /g' | awk '{print $1}'`      mname=`echo $pname | sed 's/\./ /g' | awk '{print $1}'`
348      sUser=      sUser=
349      if test $mname != $pname ; then      if test $mname != $pname ; then
# Line 363  for pname in $MACHINES ; do Line 372  for pname in $MACHINES ; do
372          for key in $keys ; do          for key in $keys ; do
373            ctot=`expr $ctot + 1`            ctot=`expr $ctot + 1`
374            sline=`grep "^$key " ./slist | head -1`            sline=`grep "^$key " ./slist | head -1`
375            sdir=`echo $sline | cut -d " " -f 5`            sdir=`echo $sline | cut -d " " -f 5`
376            type=`echo $sline | cut -d " " -f 4`            type=`echo $sline | cut -d " " -f 4`
377            optf=`echo $sline | cut -d " " -f 3`            optf=`echo $sline | cut -d " " -f 3`
378            num=`grep -c "^$key" ./plist`            num=`grep -c "^$key" ./plist`
379            if test $num = 0 -a $monthDir = 1 ; then            if test $num = 0 -a $monthDir = 1 ; then
380            #- add results from previous month directory to "plist".            #- add results from previous month directory to "plist".
381              monthDir=2              monthDir=2
382              make_resdir_list              make_resdir_list
383              num=`grep -c "^$key" ./plist`              num=`grep -c "^$key" ./plist`
384            fi            fi
385            #- discard unsafe test:            #- discard unsafe test:
386            dd=`echo $optf | grep -c 'gfortran+mth'`            dd=`echo $optf | grep -c 'gfortran+mth'`
387            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 389  for pname in $MACHINES ; do
389            #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
390            #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
391            dd=`echo $optf | grep -c 'bigred.*noieee'`            dd=`echo $optf | grep -c 'bigred.*noieee'`
392            if test $mname = 'bigred' -a $dd = 1 ; then num=-1 ; fi            #if test $mname = 'bigred' -a $dd = 1 ; then num=-1 ; fi
393            if test $num -lt 0 ; then            if test $num -lt 0 ; then
394              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL              echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL
395              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
396            elif test $num = '0' ; then            elif test $num = '0' ; then
397              echo "no previous test for:" $key | tee -a $OUTPFIL              echo "no previous test for:" $key | tee -a $OUTPFIL
398              cmis=`expr $cmis + 1`              cmis=`expr $cmis + 1`
399            else            else
400              pline=`grep "^$key " ./plist | head -1`              pline=`grep "^$key " ./plist | head -1`
401              if test $dBug = 't' ; then              if test $dBug = 't' ; then
402                  echo "s='$sline'" | tee -a $OUTPFIL                  echo "s='$sline'" | tee -a $OUTPFIL
403                  echo "p='$pline'" | tee -a $OUTPFIL                  echo "p='$pline'" | tee -a $OUTPFIL
404              fi              fi
405              pdir=`echo $pline | cut -d " " -f 5`              pdir=`echo $pline | cut -d " " -f 5`
406              outs="$INDIR/$sdir/summary.txt"              outs="$INDIR/$sdir/summary.txt"
407              sed -n "5,$ p" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outs ) | tail -1`
408                                   | sed 's/ OPTFILE=.*\// OPTFILE=/g' \              sed "1,$xx d" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
409                                   | grep -v '^[A-S][a-t]* time:  ' > tmpfs                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfs
410              outp="$INDIR/$pdir/summary.txt"              outp="$INDIR/$pdir/summary.txt"
411              sed -n "5,$ p" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \              xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outp ) | tail -1`
412                                   | sed 's/ OPTFILE=.*\// OPTFILE=/g' \              sed "1,$xx d" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \
413                                   | grep -v '^[A-S][a-t]* time:  ' > tmpfp                                  | grep -v '^[A-S][a-t]* time:  ' > tmpfp
414              #-- re-order list of exp (according to local "sort" order)              #-- re-order list of exp (according to local "sort" order)
415              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`              listD=`grep '^[YN] [YN] [YN] [YN]' tmpfs | awk '{print $NF}' | sort`
416              for xx in $listD              for xx in $listD
# Line 421  for pname in $MACHINES ; do Line 430  for pname in $MACHINES ; do
430              diff tmpfs tmpfp > tmpdf              diff tmpfs tmpfp > tmpdf
431              yy=$?              yy=$?
432              if test $yy != '0' ; then              if test $yy != '0' ; then
433                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
434                  #grep '^run: ' $outp                  #grep '^run: ' $outp
435                  #grep '^run: ' $outs                  #grep '^run: ' $outs
436                  #-- score for each test:                  #-- score for each test:
# Line 439  for pname in $MACHINES ; do Line 448  for pname in $MACHINES ; do
448                  ndf=`expr $ndf / 2`                  ndf=`expr $ndf / 2`
449                  nn=`grep -c '^---' tmpdf`                  nn=`grep -c '^---' tmpdf`
450                  ndf=`expr $ndf - $nn`                  ndf=`expr $ndf - $nn`
451                  if [ $ndf -le $NBLDIFF ] ; then                  if [ $ndf -le $NBLDIFF ] ; then
452                    cat tmpdf                    cat tmpdf
453                  else                  else
454                    echo " $ndf lines differ ( $score_s , $score_p )"                    echo " $ndf lines differ ( $score_s , $score_p )"
# Line 447  for pname in $MACHINES ; do Line 456  for pname in $MACHINES ; do
456                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL                  echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL
457                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL                  echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL
458                  cat tmpdf >> $OUTPFIL                  cat tmpdf >> $OUTPFIL
459                  if [ $cdif -eq 0 ] ; then                  if [ $cdif -eq 0 ] ; then
460                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
461                  else                  else
462                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`                    clin="$clin,"`printf '%3i (%5s,%5s)' $ndf $score_s $score_p`
463                  fi                  fi
464                  cdif=`expr $cdif + 1`                  cdif=`expr $cdif + 1`
465                  echo '----------------------------------------' | tee -a $OUTPFIL                  echo '----------------------------------------' | tee -a $OUTPFIL
466              else              else
467                  echo " $type , of='$optf'" | tee -a $OUTPFIL                  echo " $type , of='$optf'" | tee -a $OUTPFIL
468              fi              fi
469              rm -f tmpfs tmpfp tmpdf              rm -f tmpfs tmpfp tmpdf
470            fi            fi
471          done          done
472          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi          if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi
473          printf '%11s :  %3i      %4s   %3i  ' $pname $ctot $tmis $cdif >> $OUTPSUM          printf '%11s :  %3i      %4s   %3i  ' $sname $ctot $tmis $cdif >> $OUTPSUM
474          if [ $cdif -gt 0 ] ; then          if [ $cdif -gt 0 ] ; then
475            echo "   $clin" >> $OUTPSUM            echo "   $clin" >> $OUTPSUM
476         else echo "" >> $OUTPSUM ; fi          else echo "" >> $OUTPSUM ; fi
477      fi      fi
478    
479  done  done

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.22