/[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.35 by edhill, Fri Mar 12 16:45:38 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=''