--- MITgcm/verification/testreport 2005/06/07 22:21:47 1.68 +++ MITgcm/verification/testreport 2006/03/20 21:50:36 1.77 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.68 2005/06/07 22:21:47 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.77 2006/03/20 21:50:36 jmc Exp $ # $Name: $ # @@ -27,6 +27,8 @@ echo " (DEF=\"make output.txt\")" echo " (-m|-make) STRING command to use for \"make\"" echo " (DEF=\"make\")" + echo " (-odir) STRING used to build output directory name" + echo " (DEF=\"hostname\")" echo " (-ptracers|-ptr) STRING specify which ptracers to test" echo " (DEF=\"1 2 3 4 5\")" echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" @@ -123,6 +125,16 @@ fi return 99 fi + has_nan=`cat tmp1.txt | grep -i nan | wc -l` + if [ $has_nan -gt 0 ] ; then + echo testoutput_for_prop: output.txt contains $has_nan NaN values 1>&2 + return 99 + fi + has_inf=`cat tmp1.txt | grep -i inf | wc -l` + if [ $has_inf -gt 0 ] ; then + echo testoutput_for_prop: output.txt contains $has_inf Inf values 1>&2 + return 99 + fi if [ $debug -gt 0 ]; then echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2 fi @@ -503,14 +515,19 @@ # (where "$COMMAND" is relative to "directory") ( cd $1 - printf 'runmodel ... ' 1>&2 + printf 'runmodel in %s ...' $1 1>&2 # make output.txt echo rm -f run.log + if test $OUTPUTFILE -ot $EXECUTABLE ; then + ( eval $COMMAND ) > run.log 2>&1 + RETVAL=$? + else + echo " $OUTPUTFILE is up to date " > run.log 2>&1 + RETVAL=0 + fi # echo "COMMAND='$COMMAND'" # echo "pwd='"`pwd`"'" - ( eval $COMMAND ) > run.log 2>&1 - RETVAL=$? if test "x$RETVAL" = x0 ; then tail run.log echo successful 1>&2 @@ -668,6 +685,7 @@ fi JOBS= MPI=f +OUTDIR= DELDIR= ADM= @@ -724,6 +742,11 @@ -make=* | --make=*) MAKE=$ac_optarg ;; + -odir | --odir) + ac_prev=OUTDIR ;; + -odir=* | --odir=*) + OUTDIR=$ac_optarg ;; + -ptracers | --ptracers | -ptr | --ptr) ac_prev=PTRACERS_NUM ;; -ptracers=* | --ptracers=* | -ptr=* | --ptr=*) @@ -733,7 +756,7 @@ -j=*) JOBS=$ac_optarg ;; -clean | --clean) - CLEANUP=t ;; + CLEANUP=t ; DELDIR=t ;; -quick | --quick | -q | --q) QUICK=t ;; @@ -788,15 +811,24 @@ OPTFILE=$MITGCM_OF fi +if test "x$ADM" = xt ; then + EXECUTABLE="mitgcmuv_ad" + OUTPUTFILE="output.txt_adm" +else + EXECUTABLE="mitgcmuv" + OUTPUTFILE="output.txt" +fi + if test "x$ADM" = xt -a "x$COMMAND" = x ; then - COMMAND="./mitgcmuv_ad > output.txt_adm 2>&1" + COMMAND="./$EXECUTABLE > $OUTPUTFILE" fi if test "x$COMMAND" = x ; then - COMMAND="$MAKE output.txt" + COMMAND="./$EXECUTABLE > $OUTPUTFILE" fi -echo "OK" +#echo "OK" +echo "OK (COMMAND= $COMMAND )" # create the FORTRAN comparison code createcodelet @@ -813,6 +845,9 @@ UNAMEA=`uname -a` DATE=`date +%Y%m%d` BASE="tr_"$MACH"_"$DATE"_" +if test "x$OUTDIR" != x ; then + BASE="tr_"$OUTDIR"_"$DATE"_" +fi DNUM=0 DRESULTS="$BASE$DNUM" while test -e $DRESULTS ; do @@ -970,7 +1005,7 @@ echo "Experiment: $dir" echo unset genmake makedepend make run - results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' + results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' # Create an output dir for each OPTFILE/tdir combination rel_CDIR=$DRESULTS"/"$dir @@ -1002,6 +1037,12 @@ echo "tdir='$dir'" >> $CDIR"/summary.txt" for ex in $extra_runs ; do + unset run + results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' + # Create an output dir for each OPTFILE/tdir.ex combination + rel_CDIR=$DRESULTS"/"$dir"."$ex + mkdir $rel_CDIR + CDIR=`pwd`"/$rel_CDIR" test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" for ldir in input.$ex input ; do ( @@ -1021,19 +1062,9 @@ done ldir=build ( - cd "$dir/$ldir" > /dev/null 2>&1 - ls -1 Makefile *.[fFhco] mitgcmuv 2>/dev/null \ - | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g' - ) > tr_exrun_links - ( - cd "$dir/tr_run.$ex" - cat ../../tr_exrun_links | while read i ; do - if test ! "x$i" = x ; then - test ! -r $i && ln -s "../"$ldir"/"$i $i - fi - done + cd $dir/tr_run.$ex + test ! -e mitgcmuv && ln -s "../"$ldir"/"mitgcmuv . ) - test -e tr_exrun_links && rm -f tr_exrun_links runmodel $dir/tr_run.$ex && run=Y \ && results=`testoutput $dir tr_run.$ex "."$ex` fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` @@ -1045,7 +1076,7 @@ echo "MACH='$MACH'" >> $CDIR"/summary.txt" echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" echo "DATE='$DATE'" >> $CDIR"/summary.txt" - echo "tdir='$dir'" >> $CDIR"/summary.txt" + echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt" done else fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` @@ -1057,6 +1088,8 @@ echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" echo "DATE='$DATE'" >> $CDIR"/summary.txt" echo "tdir='$dir'" >> $CDIR"/summary.txt" + grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ + >> $CDIR"/summary.txt" fi postclean $dir/$builddir