/[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.34 by edhill, Fri Mar 12 02:44:34 2004 UTC revision 1.49 by edhill, Tue Nov 23 21:25:24 2004 UTC
# Line 13  usage() Line 13  usage()
13      echo "  (-help|-h)               print usage"      echo "  (-help|-h)               print usage"
14      echo "  (-mpi)                   use MPI input files"      echo "  (-mpi)                   use MPI input files"
15      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"
16      echo "                             (DEF=\"noieee\")"      echo "                             (DEF=\"-ieee\")"
17      echo "  (-optfile=|-of=)STRING   list of optfiles to use"      echo "  (-optfile=|-of=)STRING   list of optfiles to use"
18      echo "  (-a|-addr) STRING        list of email recipients"      echo "  (-a|-addr) STRING        list of email recipients"
19      echo "                             (DEF=\"edhill@mitgcm.org\")"      echo "                             (DEF=\"edhill@mitgcm.org\")"
# Line 27  usage() Line 27  usage()
27      echo "                             (DEF=\"make output.txt\")"      echo "                             (DEF=\"make output.txt\")"
28      echo "  (-m|-make) STRING        command to use for \"make\""      echo "  (-m|-make) STRING        command to use for \"make\""
29      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
30        echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
31      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\""
32      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
33      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
34      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
35      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
36        echo "  (-deldir|-dd)            on success, delete the output directory"
37      echo      echo
38      echo "and where STRING follows a whitespace-delimited format"      echo "and where STRING follows a whitespace-delimited format"
39      echo "such as:"      echo "such as:"
# Line 169  testoutput_ad() Line 171  testoutput_ad()
171      rm -f t[01][56].txt t[56].txt      rm -f t[01][56].txt t[56].txt
172  }  }
173    
174    check_for_add_mon_output()
175    {
176        # Check for additional types of monitor output
177        if test "x$1" = x ; then
178            return
179        fi
180    
181        ptr_add="trcstat_ptracerXX_min trcstat_ptracerXX_max"
182        ptr_add="$ptr_add trcstat_ptracerXX_mean trcstat_ptracerXX_sd"
183        for ii in 1 2 3 4 5 ; do
184            for jj in $ptr_add ; do
185                name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"`
186                tst=`grep $name $1 | wc -l | awk '{print $1}'`
187                if test ! "x$tst" = x0 ; then
188                    eval "HAVE_PTR0"$ii"=t"
189                fi
190            done
191            #  eval 'echo "HAVE_PTR0'$ii' = $HAVE_PTR0'$ii'"'
192        done
193    }
194    
195  testoutput()  testoutput()
196  {  {
197      # testoutput directory subdir extension      # testoutput directory subdir extension
# Line 198  testoutput() Line 221  testoutput()
221          testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2 $3; vmax=$?          testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2 $3; vmax=$?
222          testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2 $3; vmean=$?          testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2 $3; vmean=$?
223          testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2 $3; vsd=$?          testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2 $3; vsd=$?
224          dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \  
225              $umin $umax $umean $usd $vmin $vmax $vmean $vsd          for ii in 1 2 3 4 5 ; do
226                testoutput_for_prop $1 "trcstat_ptracer0"$ii"_min"  "p0"$ii"_min"  $2 $3
227                RETVAL=$? ; eval `echo "p0"$ii"_min="$RETVAL`
228                testoutput_for_prop $1 "trcstat_ptracer0"$ii"_max"  "p0"$ii"_max"  $2 $3
229                RETVAL=$? ; eval `echo "p0"$ii"_max="$RETVAL`
230                testoutput_for_prop $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3
231                RETVAL=$? ; eval `echo "p0"$ii"_mean="$RETVAL`
232                testoutput_for_prop $1 "trcstat_ptracer0"$ii"_sd"   "p0"$ii"_sd"   $2 $3
233                RETVAL=$? ; eval `echo "p0"$ii"_sd="$RETVAL`
234            done
235    
236            allargs="$cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd"
237            allargs="$allargs $umin $umax $umean $usd $vmin $vmax $vmean $vsd"
238            allargs="$allargs $p01_min $p01_max $p01_mean $p01_sd"
239            allargs="$allargs $p02_min $p02_max $p02_mean $p02_sd"
240            allargs="$allargs $p03_min $p03_max $p03_mean $p03_sd"
241            allargs="$allargs $p04_min $p04_max $p04_mean $p04_sd"
242            allargs="$allargs $p05_min $p05_max $p05_mean $p05_sd"
243    
244            eval "dashnum $allargs"
245    
246      else      else
247          testoutput_ad $1 $2 "precision_grdchk_result"          testoutput_ad $1 $2 "precision_grdchk_result"
248      fi      fi
# Line 234  genmakemodel() Line 277  genmakemodel()
277              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
278              $command > make.log 2>&1              $command > make.log 2>&1
279              RETVAL=$?              RETVAL=$?
280              cp Makefile $CDIR              #  Reduce the size of the testing emails!
281                head -100 Makefile > $CDIR/Makefile_head
282              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
283                  tail make.log                  tail make.log
284                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed" 1>&2
# Line 306  makemodel() Line 350  makemodel()
350          if test -r Makefile ; then          if test -r Makefile ; then
351              printf 'make ... ' 1>&2              printf 'make ... ' 1>&2
352              if test "x$ADM" = x ; then              if test "x$ADM" = x ; then
353                  $MAKE >> make.log 2>&1                  if test "x$JOBS" = x ; then
354                        $MAKE >> make.log 2>&1
355                    else
356                        $MAKE -j $JOBS >> make.log 2>&1
357                    fi
358              else              else
359                  $MAKE adall >> make.log 2>&1                  $MAKE adall >> make.log 2>&1
360              fi              fi
# Line 333  symlink_mpifiles() Line 381  symlink_mpifiles()
381      code_dir=$2      code_dir=$2
382      BUILD_DIR=$dir/$3      BUILD_DIR=$dir/$3
383      CODE_DIR=$dir/$code_dir      CODE_DIR=$dir/$code_dir
384        
385      # These are files that should replace their counter-part when using -mpi      # These are files that should replace their counter-part when using -mpi
386      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`
387    
# Line 348  symlink_mpifiles() Line 396  symlink_mpifiles()
396              RETVAL=$?              RETVAL=$?
397              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
398                  if ! test -f $BUILD_DIR/$i ; then                  if ! test -f $BUILD_DIR/$i ; then
399                  #echo Linking $name to $i                      #echo Linking $name to $i
400                      (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)                      (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)
401                  fi                  fi
402              fi              fi
403          done          done
404      else      else
405      # NO: We undo any _mpi symbolically linked files          # NO: We undo any _mpi symbolically linked files
406          for ii in $MPI_FILES ; do          for ii in $MPI_FILES ; do
407              i=`echo $ii | sed 's:^\./::'`              i=`echo $ii | sed 's:^\./::'`
408              name=`echo $i | sed 's:_mpi::' `              name=`echo $i | sed 's:_mpi::' `
409              if test -L $BUILD_DIR/$name ; then              if test -L $BUILD_DIR/$name ; then
410                  linktarg=`(cd $BUILD_DIR; readlink $name)`                  cmp $BUILD_DIR/$name "../$code_dir/$name"_mpi > /dev/null 2>&1
411                  if test $linktarg = "../$code_dir/$name"_mpi ; then                  RETVAL=$?
412                  #echo Un-linking $name from $linktarg                  if test "x$RETVAL" = x0 ; then
413                        #echo Un-linking $name from $linktarg
414                      rm -f $BUILD_DIR/$name                      rm -f $BUILD_DIR/$name
415                  fi                  fi
416              fi              fi
# Line 413  runmodel() Line 462  runmodel()
462          cd $1          cd $1
463          printf 'runmodel ... ' 1>&2          printf 'runmodel ... ' 1>&2
464          # make output.txt          # make output.txt
465          $COMMAND >> run.log 2>&1          echo
466            rm -f run.log
467            # echo "COMMAND='$COMMAND'"
468            # echo "pwd='"`pwd`"'"
469            ( eval $COMMAND ) > run.log 2>&1
470          RETVAL=$?          RETVAL=$?
471          if test "x$RETVAL" = x0 ; then          if test "x$RETVAL" = x0 ; then
472                tail run.log
473              echo successful 1>&2              echo successful 1>&2
474              if test "x$ADM" = x ; then              # === Reduce the size of the testing emails!
475                  cp output.txt $CDIR"/output.txt"              # if test "x$ADM" = x ; then
476              else              #   cp output.txt $CDIR"/output.txt"
477                  cp output.txt_adm $CDIR"/output.txt_adm"              # else
478              fi              #   cp output.txt_adm $CDIR"/output.txt_adm"
479                # fi
480                if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
481              return 0              return 0
482          else          else
483              tail run.log              tail run.log
484              echo failed 1>&2              echo failed 1>&2
485              cp run.log $CDIR"/run.log"              cp run.log $CDIR"/run.log"
486                if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
487              return 1              return 1
488          fi          fi
489      )      )
# Line 542  clean=0 Line 599  clean=0
599  expts=''  expts=''
600  # ieee=1  # ieee=1
601    
602  IEEE=  IEEE=true
603  if test "x$MITGCM_IEEE" != x ; then  if test "x$MITGCM_IEEE" != x ; then
604      IEEE=$MITGCM_IEEE      IEEE=$MITGCM_IEEE
605  fi  fi
# Line 563  HAVE_MPACK= Line 620  HAVE_MPACK=
620  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
621  COMMAND=  COMMAND=
622  MAKE=make  MAKE=make
623    JOBS=
624  MPI=f  MPI=f
625    DELDIR=
626    
627  ADM=  ADM=
628    
629    # Additional monitor types
630    # HAVE_PTR01=
631    # HAVE_PTR02=
632    # HAVE_PTR03=
633    # HAVE_PTR04=
634    # HAVE_PTR05=
635    
636  printf "parsing options...  "  printf "parsing options...  "
637    
638  ac_prev=  ac_prev=
# Line 616  for ac_option ; do Line 682  for ac_option ; do
682          -make=* | --make=*)          -make=* | --make=*)
683              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
684    
685            -j) ac_prev=JOBS ;;
686            -j=*) JOBS=$ac_optarg ;;
687    
688          -clean | --clean)          -clean | --clean)
689              CLEANUP=t ;;              CLEANUP=t ;;
690    
# Line 639  for ac_option ; do Line 708  for ac_option ; do
708          -debug) debug=1 ;;          -debug) debug=1 ;;
709          -quiet) verbose=0 ;;          -quiet) verbose=0 ;;
710    
711            -deldir | -dd) DELDIR=t ;;
712    
713          -*)          -*)
714              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
715              usage              usage
# Line 672  if test "x$ADM" = xt -a "x$COMMAND" = x Line 743  if test "x$ADM" = xt -a "x$COMMAND" = x
743  fi  fi
744    
745  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
746      COMMAND="make output.txt"      COMMAND="$MAKE output.txt"
747  fi  fi
748    
749  echo "OK"  echo "OK"
# Line 737  fi Line 808  fi
808  echo  echo
809  echo >> $SUMMARY  echo >> $SUMMARY
810  if test "x$ADM" = x ; then  if test "x$ADM" = x ; then
811      cat << EOF | tee -a $SUMMARY      line_0="            ----T-----  ----S-----  ----U-----  ----V-----"
812                  T           S           U           V      line_1="G D M    c        m  s        m  s        m  s        m  s"
813  G D M    c        m  s        m  s        m  s        m  s      line_2="E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  ."
814  E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .      line_3="N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d"
815  N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d      line_4="2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  ."
816  2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .      for ii in 1 2 3 4 5 ; do
817            #  tst=`eval 'echo $HAVE_PTR0'$ii`
818  EOF          #  if test "x$tst" = xt ; then
819            line_0="$line_0  --PTR 0"$ii"--"
820            line_1="$line_1        m  s"
821            line_2="$line_2  m  m  e  ."
822            line_3="$line_3  i  a  a  d"
823            line_4="$line_4  n  x  n  ."
824            #  fi
825        done
826        echo "$line_0" | tee -a $SUMMARY
827        echo "$line_1" | tee -a $SUMMARY
828        echo "$line_2" | tee -a $SUMMARY
829        echo "$line_3" | tee -a $SUMMARY
830        echo "$line_4" | tee -a $SUMMARY
831        echo " "       | tee -a $SUMMARY
832  else  else
833      echo "ADJOINT=true" >> $SUMMARY      echo "ADJOINT=true" >> $SUMMARY
834      echo >> $SUMMARY      echo >> $SUMMARY
# Line 784  for dir in $TESTDIRS ; do Line 868  for dir in $TESTDIRS ; do
868          continue          continue
869      fi      fi
870    
871        # Check for additional types of monitor output
872        check_for_add_mon_output  $fout
873    
874      builddir="input"      builddir="input"
875      rundir="input"      rundir="input"
876      use_seperate_build=0      use_seperate_build=0
# Line 858  for dir in $TESTDIRS ; do Line 945  for dir in $TESTDIRS ; do
945          echo "DATE='$DATE'" >> $CDIR"/summary.txt"          echo "DATE='$DATE'" >> $CDIR"/summary.txt"
946          echo "tdir='$dir'" >> $CDIR"/summary.txt"          echo "tdir='$dir'" >> $CDIR"/summary.txt"
947    
948            OLD_COMMAND=$COMMAND
949            COMMAND="./mitgcmuv > output.txt"
950          for ex in $extra_runs ; do          for ex in $extra_runs ; do
951              test -e "$dir/tr_run" && rm -rf "$dir/tr_run"              test -e "$dir/tr_run.$ex" && rm -rf "$dir/tr_run.$ex"
952              mkdir "$dir/tr_run"              mkdir "$dir/tr_run.$ex"
953              ( cd "$dir/input" ; links=`ls -1 | grep -v CVS` )              links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )`
954              (              (
955                  cd "$dir/tr_run"                  cd "$dir/tr_run.$ex"
956                  for i in $links; do                  for i in $links; do
957                      ln -s ../input/$i $i                      ln -s ../input/$i $i
958                  done                  done
959              )              )
960              ( cd "$dir/input.$ex" ; links=`ls -1 | grep -v CVS` )              links=`( cd "$dir/input.$ex" > /dev/null 2>&1 ; ls -1 | grep -v CVS )`
961              (              (
962                  cd "$dir/tr_run"                  cd "$dir/tr_run.$ex"
963                  for i in $links; do                  for i in $links; do
964                      test -e $i  &&  rm -f $i                      test -e $i  &&  rm -f $i
965                      ln -s ../input.$ex/$i $i                      ln -s ../input.$ex/$i $i
966                  done                  done
                 ln -s ../$builddir/Makefile Makefile  
967                  ln -s ../$builddir/mitgcmuv mitgcmuv                  ln -s ../$builddir/mitgcmuv mitgcmuv
968              )              )
969              runmodel $dir/tr_run && run=Y \              runmodel $dir/tr_run.$ex && run=Y \
970                  && results=`testoutput $dir $rundir "."$ex`                  && results=`testoutput $dir tr_run.$ex "."$ex`
971              fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`              fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
972              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
973              fres="$fres.$ex"              fres="$fres.$ex"
# Line 891  for dir in $TESTDIRS ; do Line 979  for dir in $TESTDIRS ; do
979              echo "DATE='$DATE'" >> $CDIR"/summary.txt"              echo "DATE='$DATE'" >> $CDIR"/summary.txt"
980              echo "tdir='$dir'" >> $CDIR"/summary.txt"              echo "tdir='$dir'" >> $CDIR"/summary.txt"
981          done          done
982            COMMAND=$OLD_COMMAND
983      else      else
984          fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`          fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
985          fres=$fres"$results   $dir"          fres=$fres"$results   $dir"
# Line 920  else Line 1009  else
1009      if test "x$HAVE_MPACK" = xt ; then      if test "x$HAVE_MPACK" = xt ; then
1010          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \
1011              && gzip $DRESULTS".tar" \              && gzip $DRESULTS".tar" \
1012              && $MPACK -s MITgcm-test -m 1500000 $DRESULTS".tar.gz" $ADDRESSES              && $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES
1013          RETVAL=$?          RETVAL=$?
1014          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
1015              echo              echo
# Line 950  if test "x$CLEANUP" != xt ; then Line 1039  if test "x$CLEANUP" != xt ; then
1039      cat $SUMMARY > tr_out.txt      cat $SUMMARY > tr_out.txt
1040  fi  fi
1041    
1042    if test "x$DELDIR" = xt ; then
1043        rm -rf $DRESULTS
1044    fi
1045    

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

  ViewVC Help
Powered by ViewVC 1.1.22