/[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.101 by jmc, Thu Sep 20 02:46:11 2007 UTC revision 1.106 by jmc, Tue Oct 23 19:36:15 2007 UTC
# Line 189  dashnum() Line 189  dashnum()
189      done      done
190  }  }
191    
 testoutput_ad()  
 {  
     grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $5}' > t05.txt  
     grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $5}' > t15.txt  
     grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $6}' > t06.txt  
     grep $3 $1/$2/$OUTPUTFILE | awk '{print NR " " $6}' > t16.txt  
     join t05.txt t15.txt > t5.txt  
     join t06.txt t16.txt > t6.txt  
     echo "-1" >> t5.txt  
     echo "-1" >> t6.txt  
     digits_5=`./tr_cmpnum < t5.txt`  
     digits_6=`./tr_cmpnum < t6.txt`  
     dashnum $digits_5 $digits_6  
     rm -f t[01][56].txt t[56].txt  
 }  
   
192  check_for_add_mon_output()  check_for_add_mon_output()
193  {  {
194      # Check for additional types of monitor output      # Check for additional types of monitor output
# Line 235  testoutput_run() Line 219  testoutput_run()
219      # testoutput_run directory subdir reference_output      # testoutput_run directory subdir reference_output
220      #      #
221      #  test output from 1 run in "directory"      #  test output from 1 run in "directory"
222  #   if test "x$ADM" = x ; then  # --> same processing for adjoint & forward test
223          # default list of output variables to be checked:          # default list of output variables to be checked:
224          #  1rst : main variable used to decide if it pass or FAIL          #  1rst : main variable used to decide if it pass or FAIL
225          #  others : number of matching digits to be printed in summary.txt          #  others : number of matching digits to be printed in summary.txt
# Line 330  testoutput_run() Line 314  testoutput_run()
314          else          else
315            echo $allargs            echo $allargs
316          fi          fi
317    # <-- same processing for adjoint & forward test
 #   else  
 #       testoutput_ad $1 $2 "precision_grdchk_result"  
 #   fi  
318  }  }
319    
320  genmakemodel()  genmakemodel()
# Line 594  runmodel() Line 575  runmodel()
575          printf 'runmodel in %s ...' $1 1>&2          printf 'runmodel in %s ...' $1 1>&2
576          # make output.txt          # make output.txt
577          echo          echo
578            if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
579                diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1
580                outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; rm -f run.log ; fi
581            fi
582          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
583              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_00              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_00
584              ln -sf "../"$builddir"/"$EXECUTABLE .              ln -sf "../"$builddir"/"$EXECUTABLE .
# Line 929  else Line 914  else
914  fi  fi
915    
916  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
917  #   if test "x$ADM" = xt ; then      LIST=`scandirs results/$ref_outp`
 #       LIST=`scandirs results_ad/$ref_outp`  
 #   else  
         LIST=`scandirs results/$ref_outp`  
 #   fi  
918  else  else
919      #- expand group of experiments:      #- expand group of experiments:
920      LIST=" "      LIST=" "
# Line 985  if test "x$MPI" = xt ; then Line 966  if test "x$MPI" = xt ; then
966      OUTPUTFILE="STDOUT.0000"      OUTPUTFILE="STDOUT.0000"
967  fi  fi
968    
 #echo "OK"  
969  echo "OK (COMMAND= $COMMAND )"  echo "OK (COMMAND= $COMMAND )"
970    
971  # set the Default List of output variables to be checked:  # set the Default List of output variables to be checked:
# Line 999  if test "x$ADM" = x ; then Line 979  if test "x$ADM" = x ; then
979      ii=`echo $EMPTY_RESULTS | awk '{print NF}'`      ii=`echo $EMPTY_RESULTS | awk '{print NF}'`
980      EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf "  ."}}'`      EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf "  ."}}'`
981  else  else
982      DEF_CHECK_LIST='Cost Cost Grad'      DEF_CHECK_LIST='Grad Cost Grad'
983      EMPTY_RESULTS='.. ..'      EMPTY_RESULTS='.. ..'
984      LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'`      LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'`
985  fi  fi
# Line 1096  else Line 1076  else
1076      echo "ADJOINT=true" >> $SUMMARY      echo "ADJOINT=true" >> $SUMMARY
1077      echo >> $SUMMARY      echo >> $SUMMARY
1078      if [ $MATCH_CRIT -lt 10 ] ;      if [ $MATCH_CRIT -lt 10 ] ;
1079      then line_0="default  "$MATCH_CRIT ;      then line_0="default     "$MATCH_CRIT ;
1080      else line_0="default "$MATCH_CRIT ; fi      else line_0="default    "$MATCH_CRIT ; fi
1081      echo "$line_0" | tee -a $SUMMARY      echo "$line_0" | tee -a $SUMMARY
1082      cat << EOF | tee -a $SUMMARY      cat << EOF | tee -a $SUMMARY
1083  G D M    C  G  G D M    C  G
# Line 1111  fi Line 1091  fi
1091  #  ...and each test directory...  #  ...and each test directory...
1092  for dir in $TESTDIRS ; do  for dir in $TESTDIRS ; do
1093            
1094        # set builddir & rundir:
1095        builddir="build"
1096        if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi
1097        rundir="run"
1098        if test ! -d $dir/$rundir ; then
1099            rundir=$builddir
1100        fi
1101        CODE_DIR=$dir/$code_dir
1102        BUILD_DIR=$dir/$builddir
1103    
1104      #  Cleanup only!      #  Cleanup only!
1105      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
1106          if test -r $dir/build/Makefile ; then          if test -r $BUILD_DIR/Makefile ; then
1107              echo '  ------  clean dir:' $dir/build              echo '  ------  clean dir:' $dir/build
1108              ( cd $dir/build ; make CLEAN )              ( cd $BUILD_DIR ; make CLEAN )
1109          fi          fi
1110          if test -d $dir/run/CVS ; then          if test -d $dir/$rundir/CVS ; then
1111              echo '  ------  clean dir:' $dir/run              echo '  ------  clean dir:' $dir/$rundir
1112              run_clean $dir/run              run_clean $dir/$rundir
1113          fi          fi
1114          (          (
1115              cd $dir              cd $dir
# Line 1130  for dir in $TESTDIRS ; do Line 1120  for dir in $TESTDIRS ; do
1120    
1121      #  Verify that the testdir exists and contains previous      #  Verify that the testdir exists and contains previous
1122      #  results in the correct location--or skip this directory!      #  results in the correct location--or skip this directory!
1123      fout=      fout=$dir"/results/"$ref_outp
     if test "x$ADM" = x ; then  
         fout=$dir"/results/"$ref_outp  
     else  
         fout=$dir"/results_ad/"$ref_outp  
     fi  
1124      if test ! -r $fout ; then      if test ! -r $fout ; then
1125          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
1126          continue          continue
# Line 1146  for dir in $TESTDIRS ; do Line 1131  for dir in $TESTDIRS ; do
1131    
1132      # Check for additional types of monitor output      # Check for additional types of monitor output
1133    
     builddir="build"  
     if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi  
     rundir="run"  
     if test ! -d $dir/$rundir ; then  
         rundir=$builddir  
     fi  
     CODE_DIR=$dir/$code_dir  
     BUILD_DIR=$dir/$builddir  
   
1134      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
1135          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
1136          continue          continue
# Line 1218  for dir in $TESTDIRS ; do Line 1194  for dir in $TESTDIRS ; do
1194      fi      fi
1195            
1196      echo      echo
1197  #   if test "x$ADM" = x ; then  # --> same processing for adjoint & forward test
1198          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1199          echo          echo
1200          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
# Line 1232  for dir in $TESTDIRS ; do Line 1208  for dir in $TESTDIRS ; do
1208          for ex in $extra_runs ; do          for ex in $extra_runs ; do
1209              unset run              unset run
1210              results=$EMPTY_RESULTS              results=$EMPTY_RESULTS
1211                #  reference output file
1212                refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"`
1213              #  Create an output dir for each OPTFILE/tdir.ex combination              #  Create an output dir for each OPTFILE/tdir.ex combination
1214              rel_CDIR=$DRESULTS"/"$dir"."$ex              rel_CDIR=$DRESULTS"/"$dir"."$ex
1215              mkdir $rel_CDIR              mkdir $rel_CDIR
1216              CDIR=`pwd`"/$rel_CDIR"              CDIR=`pwd`"/$rel_CDIR"
1217              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"
1218              run_clean $dir/tr_run.$ex              run_clean $dir/tr_run.$ex
1219              linkdata $dir/tr_run.$ex input.$ex input              linkdata $dir/tr_run.$ex input.$ex input
1220              runmodel $dir/tr_run.$ex && run=Y \              runmodel $dir/tr_run.$ex && run=Y \
1221                  && results=`testoutput_run $dir tr_run.$ex "output.${ex}.txt"`              && results=`testoutput_run $dir tr_run.$ex $refExOut`
1222              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1223              fres="$fres.$ex"              fres="$fres.$ex"
1224              echo              echo
# Line 1255  for dir in $TESTDIRS ; do Line 1233  for dir in $TESTDIRS ; do
1233                  run_clean $dir/tr_run.$ex                  run_clean $dir/tr_run.$ex
1234              fi              fi
1235          done          done
1236  #   else  # <-- same processing for adjoint & forward test
 #       fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`  
 #       fres=$fres"$results   $dir"  
 #       echo  
 #       echo "$fres" >> $SUMMARY  
 #       touch $CDIR"/summary.txt"  
 #       echo "fresults='$fres'" >> $CDIR"/summary.txt"  
 #       echo "MACH='$MACH'" >> $CDIR"/summary.txt"  
 #       echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"  
 #       echo "DATE='$DATE'" >> $CDIR"/summary.txt"  
 #       echo "tdir='$dir'" >> $CDIR"/summary.txt"  
 #   fi  
1237      if test "x$ADM" = xt ; then      if test "x$ADM" = xt ; then
1238            head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt"
1239          grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \          grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \
1240                             >> $CDIR"/summary.txt"                             >> $CDIR"/summary.txt"
1241      fi      fi
# Line 1317  fi Line 1285  fi
1285  rm -f tr_cmpnum.c tr_cmpnum  rm -f tr_cmpnum.c tr_cmpnum
1286    
1287  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
1288      cat $SUMMARY | sed 's/  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.//'      cat $SUMMARY | sed 's/ \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \. //'
1289      if test -e tr_out.txt ; then      if test -e tr_out.txt ; then
1290          mv tr_out.txt tr_out.txt.old          mv tr_out.txt tr_out.txt.old
1291      fi      fi
1292      cat $SUMMARY | sed '/^[YN] [YN] [YN] [YN]/ s/  \.//g' > tr_out.txt      cat $SUMMARY | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' > tr_out.txt
1293  fi  fi
1294    
1295  if test "x$DELDIR" = xt ; then  if test "x$DELDIR" = xt ; then

Legend:
Removed from v.1.101  
changed lines
  Added in v.1.106

  ViewVC Help
Powered by ViewVC 1.1.22