/[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.100 by jmc, Mon Sep 17 15:35:46 2007 UTC revision 1.107 by jmc, Mon Oct 29 19:14:12 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 270  testoutput_run() Line 254  testoutput_run()
254                    then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi                    then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi
255                    testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$?                    testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$?
256                    if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;;                    if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;;
257             'Cost') testoutput_var $1 "ADM  precision_derivative_cost" "ADM Cost" $2 $3; yy=$? ;;            'Cost') testoutput_var $1 "ADM  precision_derivative_cost" "ADM Cost" $2 $3; yy=$? ;;
258             'Grad') testoutput_var $1 "ADM  precision_derivative_grad" "ADM Grad" $2 $3; yy=$? ;;            'Grad') testoutput_var $1 "ADM  precision_derivative_grad" "ADM Grad" $2 $3; yy=$? ;;
259             'Tmn') testoutput_var $1 "dynstat_theta_min"  "Theta minimum"  $2 $3; yy=$? ;;             'Tmn') testoutput_var $1 "dynstat_theta_min"  "Theta minimum"  $2 $3; yy=$? ;;
260             'Tmx') testoutput_var $1 "dynstat_theta_max"  "Theta maximum"  $2 $3; yy=$? ;;             'Tmx') testoutput_var $1 "dynstat_theta_max"  "Theta maximum"  $2 $3; yy=$? ;;
261             'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean"     $2 $3; yy=$? ;;             'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean"     $2 $3; yy=$? ;;
# Line 296  testoutput_run() Line 280  testoutput_run()
280             testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3; yy=$? ;;             testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3; yy=$? ;;
281          'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`          'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`
282             testoutput_var $1 "trcstat_ptracer0"$ii"_sd"   "p0"$ii"_StDv"  $2 $3; yy=$? ;;             testoutput_var $1 "trcstat_ptracer0"$ii"_sd"   "p0"$ii"_StDv"  $2 $3; yy=$? ;;
283             'Qntmn') testoutput_var $1 "extforcing_qnet_min" "Qnet minimum"  $2 $3; yy=$? ;;
284             'Qntmx') testoutput_var $1 "extforcing_qnet_max" "Qnet maximum"  $2 $3; yy=$? ;;
285             'Qntav') testoutput_var $1 "extforcing_qnet_mean" "Qnet mean"    $2 $3; yy=$? ;;
286             'Qntsd') testoutput_var $1 "extforcing_qnet_sd"  "Qnet Std.Dev"  $2 $3; yy=$? ;;
287             'aSImn') testoutput_var $1 "seaice_area_min"   "SIce Area min"   $2 $3; yy=$? ;;
288             'aSImx') testoutput_var $1 "seaice_area_max"   "SIce Area max"   $2 $3; yy=$? ;;
289             'aSIav') testoutput_var $1 "seaice_area_mean"  "SIce Area mean"  $2 $3; yy=$? ;;
290             'aSIsd') testoutput_var $1 "seaice_area_sd"    "SIce Area StDv"  $2 $3; yy=$? ;;
291             'hSImn') testoutput_var $1 "seaice_heff_min"   "SIce Heff min"   $2 $3; yy=$? ;;
292             'hSImx') testoutput_var $1 "seaice_heff_max"   "SIce Hell max"   $2 $3; yy=$? ;;
293             'hSIav') testoutput_var $1 "seaice_heff_mean"  "SIce Hell mean"  $2 $3; yy=$? ;;
294             'hSIsd') testoutput_var $1 "seaice_heff_sd"    "SIce Hell StDv"  $2 $3; yy=$? ;;
295            'AthSiG') testoutput_var $1 "thSI_Ice_Area_G" "thSIc Area Global" $2 $3; yy=$? ;;
296            'AthSiS') testoutput_var $1 "thSI_Ice_Area_S" "thSIc Area South"  $2 $3; yy=$? ;;
297            'AthSiN') testoutput_var $1 "thSI_Ice_Area_N" "thSIc Area North"  $2 $3; yy=$? ;;
298            'HthSiG') testoutput_var $1 "thSI_IceH_ave_G" "thSIc H Global"    $2 $3; yy=$? ;;
299            'HthSiS') testoutput_var $1 "thSI_IceH_ave_S" "thSIc H South"     $2 $3; yy=$? ;;
300            'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North"     $2 $3; yy=$? ;;
301                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;
302            esac            esac
303            if test $xx = $sVar            if test $xx = $sVar
# Line 312  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 415  run_clean() Line 414  run_clean()
414              find . -type l -exec rm {} \;              find . -type l -exec rm {} \;
415              rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime              rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime
416              rm -rf mnc_test_*              rm -rf mnc_test_*
417                rm -f *_MIT_CE_000.opt0000 costfunction*0000
418              echo successful 1>&2              echo successful 1>&2
419              exit 0              exit 0
420          )          )
# Line 576  runmodel() Line 576  runmodel()
576          printf 'runmodel in %s ...' $1 1>&2          printf 'runmodel in %s ...' $1 1>&2
577          # make output.txt          # make output.txt
578          echo          echo
579            if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
580                diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1
581                outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; rm -f run.log ; fi
582            fi
583          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
584              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_00              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_00
585              ln -sf "../"$builddir"/"$EXECUTABLE .              ln -sf "../"$builddir"/"$EXECUTABLE .
# Line 911  else Line 915  else
915  fi  fi
916    
917  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
918  #   if test "x$ADM" = xt ; then      LIST=`scandirs results/$ref_outp`
 #       LIST=`scandirs results_ad/$ref_outp`  
 #   else  
         LIST=`scandirs results/$ref_outp`  
 #   fi  
919  else  else
920      #- expand group of experiments:      #- expand group of experiments:
921      LIST=" "      LIST=" "
# Line 967  if test "x$MPI" = xt ; then Line 967  if test "x$MPI" = xt ; then
967      OUTPUTFILE="STDOUT.0000"      OUTPUTFILE="STDOUT.0000"
968  fi  fi
969    
 #echo "OK"  
970  echo "OK (COMMAND= $COMMAND )"  echo "OK (COMMAND= $COMMAND )"
971    
972  # set the Default List of output variables to be checked:  # set the Default List of output variables to be checked:
# Line 981  if test "x$ADM" = x ; then Line 980  if test "x$ADM" = x ; then
980      ii=`echo $EMPTY_RESULTS | awk '{print NF}'`      ii=`echo $EMPTY_RESULTS | awk '{print NF}'`
981      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 "  ."}}'`
982  else  else
983      DEF_CHECK_LIST='Cost Cost Grad'      DEF_CHECK_LIST='Grad Cost Grad'
984      EMPTY_RESULTS='.. ..'      EMPTY_RESULTS='.. ..'
985      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}'`
986  fi  fi
# Line 1078  else Line 1077  else
1077      echo "ADJOINT=true" >> $SUMMARY      echo "ADJOINT=true" >> $SUMMARY
1078      echo >> $SUMMARY      echo >> $SUMMARY
1079      if [ $MATCH_CRIT -lt 10 ] ;      if [ $MATCH_CRIT -lt 10 ] ;
1080      then line_0="default  "$MATCH_CRIT ;      then line_0="default     "$MATCH_CRIT ;
1081      else line_0="default "$MATCH_CRIT ; fi      else line_0="default    "$MATCH_CRIT ; fi
1082      echo "$line_0" | tee -a $SUMMARY      echo "$line_0" | tee -a $SUMMARY
1083      cat << EOF | tee -a $SUMMARY      cat << EOF | tee -a $SUMMARY
1084  G D M    C  G  G D M    C  G
# Line 1093  fi Line 1092  fi
1092  #  ...and each test directory...  #  ...and each test directory...
1093  for dir in $TESTDIRS ; do  for dir in $TESTDIRS ; do
1094            
1095        # set builddir & rundir:
1096        builddir="build"
1097        if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi
1098        rundir="run"
1099        if test ! -d $dir/$rundir ; then
1100            rundir=$builddir
1101        fi
1102        CODE_DIR=$dir/$code_dir
1103        BUILD_DIR=$dir/$builddir
1104    
1105      #  Cleanup only!      #  Cleanup only!
1106      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
1107          if test -r $dir/build/Makefile ; then          if test -r $BUILD_DIR/Makefile ; then
1108              echo '  ------  clean dir:' $dir/build              echo '  ------  clean dir:' $dir/build
1109              ( cd $dir/build ; make CLEAN )              ( cd $BUILD_DIR ; make CLEAN )
1110          fi          fi
1111          if test -d $dir/run/CVS ; then          if test -d $dir/$rundir/CVS ; then
1112              echo '  ------  clean dir:' $dir/run              echo '  ------  clean dir:' $dir/$rundir
1113              run_clean $dir/run              run_clean $dir/$rundir
1114          fi          fi
1115          (          (
1116              cd $dir              cd $dir
# Line 1112  for dir in $TESTDIRS ; do Line 1121  for dir in $TESTDIRS ; do
1121    
1122      #  Verify that the testdir exists and contains previous      #  Verify that the testdir exists and contains previous
1123      #  results in the correct location--or skip this directory!      #  results in the correct location--or skip this directory!
1124      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  
1125      if test ! -r $fout ; then      if test ! -r $fout ; then
1126          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
1127          continue          continue
# Line 1128  for dir in $TESTDIRS ; do Line 1132  for dir in $TESTDIRS ; do
1132    
1133      # Check for additional types of monitor output      # Check for additional types of monitor output
1134    
     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  
   
1135      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
1136          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
1137          continue          continue
# Line 1200  for dir in $TESTDIRS ; do Line 1195  for dir in $TESTDIRS ; do
1195      fi      fi
1196            
1197      echo      echo
1198  #   if test "x$ADM" = x ; then  # --> same processing for adjoint & forward test
1199          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1200          echo          echo
1201          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
# Line 1214  for dir in $TESTDIRS ; do Line 1209  for dir in $TESTDIRS ; do
1209          for ex in $extra_runs ; do          for ex in $extra_runs ; do
1210              unset run              unset run
1211              results=$EMPTY_RESULTS              results=$EMPTY_RESULTS
1212                #  reference output file
1213                refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"`
1214              #  Create an output dir for each OPTFILE/tdir.ex combination              #  Create an output dir for each OPTFILE/tdir.ex combination
1215              rel_CDIR=$DRESULTS"/"$dir"."$ex              rel_CDIR=$DRESULTS"/"$dir"."$ex
1216              mkdir $rel_CDIR              mkdir $rel_CDIR
1217              CDIR=`pwd`"/$rel_CDIR"              CDIR=`pwd`"/$rel_CDIR"
1218              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"
1219              run_clean $dir/tr_run.$ex              run_clean $dir/tr_run.$ex
1220              linkdata $dir/tr_run.$ex input.$ex input              linkdata $dir/tr_run.$ex input.$ex input
1221              runmodel $dir/tr_run.$ex && run=Y \              runmodel $dir/tr_run.$ex && run=Y \
1222                  && results=`testoutput_run $dir tr_run.$ex "output.${ex}.txt"`              && results=`testoutput_run $dir tr_run.$ex $refExOut`
1223              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1224              fres="$fres.$ex"              fres="$fres.$ex"
1225              echo              echo
# Line 1237  for dir in $TESTDIRS ; do Line 1234  for dir in $TESTDIRS ; do
1234                  run_clean $dir/tr_run.$ex                  run_clean $dir/tr_run.$ex
1235              fi              fi
1236          done          done
1237  #   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  
1238      if test "x$ADM" = xt ; then      if test "x$ADM" = xt ; then
1239            head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt"
1240          grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \          grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \
1241                             >> $CDIR"/summary.txt"                             >> $CDIR"/summary.txt"
1242      fi      fi
# Line 1299  fi Line 1286  fi
1286  rm -f tr_cmpnum.c tr_cmpnum  rm -f tr_cmpnum.c tr_cmpnum
1287    
1288  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
1289      cat $SUMMARY | sed 's/  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.//'      cat $SUMMARY | sed 's/ \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \. //'
1290      if test -e tr_out.txt ; then      if test -e tr_out.txt ; then
1291          mv tr_out.txt tr_out.txt.old          mv tr_out.txt tr_out.txt.old
1292      fi      fi
1293      cat $SUMMARY | sed '/^[YN] [YN] [YN] [YN]/ s/  \.//g' > tr_out.txt      cat $SUMMARY | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' > tr_out.txt
1294  fi  fi
1295    
1296  if test "x$DELDIR" = xt ; then  if test "x$DELDIR" = xt ; then

Legend:
Removed from v.1.100  
changed lines
  Added in v.1.107

  ViewVC Help
Powered by ViewVC 1.1.22