/[MITgcm]/MITgcm/verification/testreport
ViewVC logotype

Diff of /MITgcm/verification/testreport

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.115 by jmc, Sun Apr 6 19:19:47 2008 UTC revision 1.119 by jmc, Mon Jan 26 04:09:34 2009 UTC
# Line 179  testoutput_var() Line 179  testoutput_var()
179      return $digits_of_similarity      return $digits_of_similarity
180  }  }
181    
 check_for_add_mon_output()  
 {  
     # Check for additional types of monitor output  
     if test "x$1" = x ; then  
         return  
     fi  
   
     for ii in $PTRACERS_NUM ; do  
         eval "HAVE_PTR0"$ii"=f"  
     done  
   
     ptr_add="trcstat_ptracerXX_min trcstat_ptracerXX_max"  
     ptr_add="$ptr_add trcstat_ptracerXX_mean trcstat_ptracerXX_sd"  
     for ii in $PTRACERS_NUM ; do  
         for jj in $ptr_add ; do  
             name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"`  
             tst=`grep $name $1 | wc -l | awk '{print $1}'`  
             if test ! "x$tst" = x0 ; then  
                 eval "HAVE_PTR0"$ii"=t"  
             fi  
         done  
         #  eval 'echo "HAVE_PTR0'$ii' = $HAVE_PTR0'$ii'"'  
     done  
 }  
   
182  testoutput_run()  testoutput_run()
183  {  {
184      # testoutput_run directory subdir reference_output      # testoutput_run directory subdir reference_output
# Line 221  testoutput_run() Line 196  testoutput_run()
196          listVar=`echo $listChk | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' \          listVar=`echo $listChk | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' \
197                                 | sed 's/+//g' | sed "s/^$sVar//"`                                 | sed 's/+//g' | sed "s/^$sVar//"`
198          if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(I)='$listVar'" 1>&2 ; fi          if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(I)='$listVar'" 1>&2 ; fi
199          for ii in 1 2 3 4 5 6 7 8 9 ; do          # check for ptracer output in reference_output file :
200            tst=`eval 'echo "$HAVE_PTR0'$ii'"'`          outpref=$1/results/$3
201           #echo "-- ptr test=" $tst "number of var=" `echo $listVar | awk '{print NF}'` 1>&2          ptr_mon="trcstat_ptracerXX_min trcstat_ptracerXX_max"
202            if test "x$tst" != xt ; then listVar=`echo "$listVar" | sed "s/ pt$ii..//g"` ; fi          ptr_mon="$ptr_mon trcstat_ptracerXX_mean trcstat_ptracerXX_sd"
203          done          for ii in $PTRACERS_NUM ; do
204          tst=`echo $sVar $listVar | awk '{ for(i=2;i<=NF;i++){t+=($i==$1)}; print t }'`              ptrfound=0
205                for jj in $ptr_mon ; do
206                    name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"`
207                    tst=`grep $name $outpref | wc -l | awk '{print $1}'`
208                    if test ! "x$tst" = x0 ; then ptrfound=1 ; fi
209                done
210                if test $ptrfound = '1' ; then
211                    eval "HAVE_PTR0"$ii"=t"
212                else
213                    eval "HAVE_PTR0"$ii"=f"
214                  if test "x$ADM" = x ; then
215                  # remove this ptr from the list of output variable to check
216                  # echo "-- ptr test=" $tst "number of var=" `echo $listVar | awk '{print NF}'` 1>&2
217                    listVar=`echo "$listVar" | sed "s/ pt$ii..//g"`
218                  fi
219                fi
220            #   eval 'echo "HAVE_PTR0'$ii' = $HAVE_PTR0'$ii'"' 1>&2
221            done
222            tst=`echo $sVar $listVar | awk '{ for(i=2;i<=NF;i++){if($i==$1)t+=1}; print t }'`
223          if test $tst != 1 ; then          if test $tst != 1 ; then
224            if test $tst = 0 ; then echo "==> WARNING: selected var >$sVar< not found" 1>&2            if test $tst = 0 ; then echo "==> WARNING: selected var >$sVar< not found" 1>&2
225                   else echo "==> WARNING: found selected var >$sVar< $tst times" 1>&2 ; fi                   else echo "==> WARNING: found selected var >$sVar< $tst times" 1>&2 ; fi
# Line 573  runmodel() Line 566  runmodel()
566          echo          echo
567          if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then          if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
568              diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1              diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1
569              outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; rm -f run.log ; fi              outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi
570          fi          fi
571          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
572              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_00              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp
573              ln -sf "../"$builddir"/"$EXECUTABLE .              ln -sf "../"$builddir"/"$EXECUTABLE .
574          fi          fi
575          if test ! -x $EXECUTABLE ; then          if test ! -x $EXECUTABLE ; then
576                  rm -f run.log ; touch run.log                  rm -f $RUNLOG ; touch $RUNLOG
577                  if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi                  if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
578                  echo " no executable:" $EXECUTABLE >> run.log                  echo " no executable:" $EXECUTABLE >> $RUNLOG
579                  RETVAL=8                  RETVAL=8
580                  ENDVAL=-1                  ENDVAL=-1
581          else          else
582              if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then              if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then
583                # output do not exist or is older than executable:                # output do not exist or is older than executable:
584                  rm -f run.log ; touch run.log                  rm -f $RUNLOG ; touch $RUNLOG
585                  if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi                  if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
586                  ( eval $COMMAND ) >> run.log 2>&1                  ( eval $COMMAND ) >> $RUNLOG 2>&1
587                  RETVAL=$?                  RETVAL=$?
588              else              else
589                  RETVAL=0                  RETVAL=0
590                  if test -f run.log ; then                  if test -f $RUNLOG ; then
591                      if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi                      if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
592                      echo "---------->> $OUTPUTFILE is up to date " >> run.log 2>&1                      echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1
593                  else                  else
594                      touch run.log                      touch $RUNLOG
595                      if test -f run.log_00 ; then cat run.log_00 >> run.log ; fi                      if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
596                      echo "---------->> $OUTPUTFILE is up to date " >> run.log 2>&1                      echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1
597                      echo " no previous run.log: assume NORMAL END" >> run.log 2>&1                      echo " no previous $RUNLOG: assume NORMAL END" >> $RUNLOG 2>&1
598                  fi                  fi
599              fi              fi
600              ENDVAL=`cat run.log | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'`              ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'`
601          fi          fi
602          rm -f run.log_00          rm -f run.log_tmp
603          #if test "x$RETVAL" = x0 ; then          #if test "x$RETVAL" = x0 ; then
604          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
605              tail run.log              tail $RUNLOG
606              echo successful 1>&2              echo successful 1>&2
607              # === Reduce the size of the testing emails!              # === Reduce the size of the testing emails!
608              #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE              #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE
609              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
610              return 0              return 0
611          else          else
612              tail run.log              tail $RUNLOG
613              echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2              echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2
614              cp run.log $CDIR"/run.log"              cp $RUNLOG $CDIR"/"$RUNLOG
615              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
616              return 1              return 1
617          fi          fi
# Line 763  DELDIR= Line 756  DELDIR=
756    
757  ADM=  ADM=
758    
759  # Additional monitor types  # list of pTracers to check for monitor output
760  PTRACERS_NUM="1 2 3 4 5"  PTRACERS_NUM="1 2 3 4 5"
761    
762  MATCH_CRIT=13  MATCH_CRIT=13
# Line 957  if test "x$OPTFILE" = xNONE -a "x$MITGCM Line 950  if test "x$OPTFILE" = xNONE -a "x$MITGCM
950      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
951  fi  fi
952    
953    RUNLOG="run.log"
954  OUTPUTFILE=$ref_outp  OUTPUTFILE=$ref_outp
955  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
956      COMMAND="./$EXECUTABLE > $OUTPUTFILE"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
# Line 995  fi Line 989  fi
989    
990  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
991  CMDLINE=$0  CMDLINE=$0
992  for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done  for xx in "$@" ; do nw=`echo $xx | wc -w`
993        if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"
994                            else CMDLINE="$CMDLINE '$xx'" ; fi
995    done
996    #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done
997  MACH=`hostname`  MACH=`hostname`
998  UNAMEA=`uname -a`  UNAMEA=`uname -a`
999  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
# Line 1059  if test "x$ADM" = x ; then Line 1057  if test "x$ADM" = x ; then
1057      line_3="N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d"      line_3="N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d"
1058      line_4="2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  ."      line_4="2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  ."
1059      for ii in $PTRACERS_NUM ; do      for ii in $PTRACERS_NUM ; do
         #  tst=`eval 'echo $HAVE_PTR0'$ii`  
         #  if test "x$tst" = xt ; then  
1060          line_0="$line_0  --PTR 0"$ii"--"          line_0="$line_0  --PTR 0"$ii"--"
1061          line_1="$line_1        m  s"          line_1="$line_1        m  s"
1062          line_2="$line_2  m  m  e  ."          line_2="$line_2  m  m  e  ."
1063          line_3="$line_3  i  a  a  d"          line_3="$line_3  i  a  a  d"
1064          line_4="$line_4  n  x  n  ."          line_4="$line_4  n  x  n  ."
         #  fi  
1065      done      done
1066      echo "$line_0" | tee -a $SUMMARY      echo "$line_0" | tee -a $SUMMARY
1067      echo "$line_1" | tee -a $SUMMARY      echo "$line_1" | tee -a $SUMMARY
# Line 1127  for dir in $TESTDIRS ; do Line 1122  for dir in $TESTDIRS ; do
1122          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
1123          continue          continue
1124      fi      fi
     if test "x$ADM" = x ; then  
         check_for_add_mon_output  $fout  
     fi  
1125    
1126      # Check for additional types of monitor output      # Check for specific files for particular type of run
1127    
1128      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then
1129          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"

Legend:
Removed from v.1.115  
changed lines
  Added in v.1.119

  ViewVC Help
Powered by ViewVC 1.1.22