--- MITgcm/verification/testreport 2015/03/03 15:55:51 1.202 +++ MITgcm/verification/testreport 2016/08/03 19:42:31 1.209 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.202 2015/03/03 15:55:51 mlosch Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.209 2016/08/03 19:42:31 jmc Exp $ # $Name: $ # @@ -22,7 +22,7 @@ echo " (-command|-c) STRING command to run (e.g., if non-standard MPI setting)" echo " DEF='mitgcmuv' or ='mpirun -np TR_NPROC mitgcmuv'" echo " ---- testing options : ----" - echo " (-optfile|-of) STRING list of optfiles to use" + echo " (-optfile|-of) STRING optfile to use" echo " (-fast) use optfile default for compiler flags (no '-ieee')" echo " DEF=off => use IEEE numerics option (if available)" echo " (-devel) use optfile developement flags (if available)" @@ -42,7 +42,8 @@ echo " (-bash|-b) STRING preferred location of a \"bash\" or \"sh\" shell" echo " (DEF=\"\" for \"bash\")" echo " (-ef) STRING used as genmake2 \"-extra_flag\" argument" - echo " (-ncad) used genmake2 option \"-nocat4ad\" (-ncad)" + echo " (-ncad) use genmake2 option \"-nocat4ad\" (-ncad)" + echo " (-small_f) make target small_f before making target all" echo " (-makedepend|-md) STRING command to use for \"makedepend\"" echo " (-make|-m) STRING command to use for \"make\"" echo " (DEF=\"make\")" @@ -269,7 +270,11 @@ allargs="" for xx in $listVar do - case $xx in + #ii=`echo $xx | sed 's/^pt[0-9][0-9]*..$/XXX/'` #- any ptr number + ii=`echo $xx | sed 's/^pt[1-9]..$/XXX/'` #- 1 to 9 ptr number + if test $ii != 'XXX' ; then + #- all except ptracer stats: + case $xx in 'PS') if [ $debug -gt 0 ] then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $refoutp ; yy=$? @@ -296,14 +301,6 @@ 'Vmx') testoutput_var $1 "dynstat_vvel_max" "V maximum" $2 $refoutp ; yy=$? ;; 'Vav') testoutput_var $1 "dynstat_vvel_mean" "V mean" $2 $refoutp ; yy=$? ;; 'Vsd') testoutput_var $1 "dynstat_vvel_sd" "V Std.Dev" $2 $refoutp ; yy=$? ;; - 'pt1mn'|'pt2mn'|'pt3mn'|'pt4mn'|'pt5mn') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'` - testoutput_var $1 "trcstat_ptracer0"$ii"_min" "p0"$ii"_min" $2 $refoutp ; yy=$? ;; - 'pt1mx'|'pt2mx'|'pt3mx'|'pt4mx'|'pt5mx') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'` - testoutput_var $1 "trcstat_ptracer0"$ii"_max" "p0"$ii"_max" $2 $refoutp ; yy=$? ;; - 'pt1av'|'pt2av'|'pt3av'|'pt4av'|'pt5av') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'` - testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $refoutp ; yy=$? ;; - 'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'` - testoutput_var $1 "trcstat_ptracer0"$ii"_sd" "p0"$ii"_StDv" $2 $refoutp ; yy=$? ;; 'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum" $2 $refoutp ; yy=$? ;; 'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum" $2 $refoutp ; yy=$? ;; 'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean" $2 $refoutp ; yy=$? ;; @@ -338,12 +335,24 @@ 'sboAp') testoutput_var $1 "sbo_zoamp" "SBO AM-P" $2 $refoutp ; yy=$? ;; 'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;; *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;; - esac + esac + else + #- ptracers stats: + nn=`echo $xx | sed 's/pt//' | sed 's/..$//'` + ii=`echo $xx | sed 's/^pt[0-9]*//'` + case $ii in + 'mn') testoutput_var $1 "trcstat_ptracer0"$nn"_min" "p0"$nn"_min" $2 $refoutp ; yy=$? ;; + 'mx') testoutput_var $1 "trcstat_ptracer0"$nn"_max" "p0"$nn"_max" $2 $refoutp ; yy=$? ;; + 'av') testoutput_var $1 "trcstat_ptracer0"$nn"_mean" "p0"$nn"_mean" $2 $refoutp ; yy=$? ;; + 'sd') testoutput_var $1 "trcstat_ptracer0"$nn"_sd" "p0"$nn"_StDv" $2 $refoutp ; yy=$? ;; + esac + fi if test $xx = $sVar then allargs="$allargs > $yy <" else allargs="$allargs $yy" fi done + echo 1>&2 nbVar=`echo $listVar | awk '{print NF}'` if [ $nbVar -lt $LEN_CHECK_LIST ] ; then @@ -527,7 +536,22 @@ else cd $1; if test -r Makefile ; then - printf 'make ... ' + if test "x$MKSMALLF" = xt ; then + printf 'make small_f ... ' + $MAKE_CMD small_f >> make.tr_log 2>&1 + RETVAL=$? + if test "x$RETVAL" != x0 ; then + tail make.tr_log + echo failed + cp genmake.log genmake.tr_log $CDIR + tail -$NBLINES_MKLOG make.tr_log > $CDIR"/make.tr_log_tail" + rm -f $EXECUTABLE + mk_fail=1 + else + echo successful + fi + fi + printf "make $TARG ... " $MAKE_CMD $TARG >> make.tr_log 2>&1 RETVAL=$? if test "x$RETVAL" != x0 ; then @@ -1065,6 +1089,7 @@ USE_R4= EXTRFLG= NOCATAD= +MKSMALLF= #- type of testing (KIND): # KIND=0 : forward (= default) ; KIND=1 : Tangent Linear with TAF ; @@ -1174,6 +1199,7 @@ echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage fi ;; -ncad) NOCATAD=t ;; + -small_f) MKSMALLF=t ;; -ieee) echo "Warning: ignore option '-ieee' (already the default)" printf " ... " ;; @@ -1300,10 +1326,6 @@ if test $count = 1 ; then echo "" ; echo -n " ... " ; fi #echo 'TESTDIRS='${TESTDIRS}'<' -if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then - OPTFILE=$MITGCM_OF -fi - LOC_MFILE='tr_mpi_mfile' RUNLOG="run.tr_log" if test "x$MPI" = x0 ; then @@ -1311,7 +1333,7 @@ if test "x$COMMAND" = x ; then COMMAND="./$EXECUTABLE > $OUTPUTFILE" ; fi else OUTPUTFILE="STDOUT.0000" - if test "x$COMMAND" = x ; then COMMAND="mpirun -v -np TR_NPROC ./$EXECUTABLE" ; fi + if test "x$COMMAND" = x ; then COMMAND="mpirun -np TR_NPROC ./$EXECUTABLE" ; fi fi echo "OK (COMMAND='$COMMAND')" @@ -1653,7 +1675,6 @@ #echo "results='$results'" fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` - echo 1>&2 echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /> $SUMMARY echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" @@ -1675,8 +1696,8 @@ linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir runmodel $dir/$pfxdir.$ex && run=Y \ && results=`testoutput_run $dir $pfxdir.$ex $refExOut` + fres=`formatresults $dir.$ex ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` - echo 1>&2 echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /> $SUMMARY echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt" if test "x$POSTCLEAN" = x2 ; then @@ -1722,10 +1743,13 @@ >> $DRESULTS/genmake_state rm -f tmp.tr_log fi - echo -n "from '$gmkLog', " >> $DRESULTS/genmake_state - echo "get NETCDF & LAPACK settings:" >> $DRESULTS/genmake_state - sed -n '/set HAVE_NETCDF=/p' $gmkLog >> $DRESULTS/genmake_state - sed -n '/set HAVE_LAPACK=/p' $gmkLog >> $DRESULTS/genmake_state + fi + gmkLog=$dir/$builddir/genmake_state + if test -r $gmkLog ; then + echo -n "from '$gmkLog', " >> $DRESULTS/genmake_state + echo "get genmake settings:" >> $DRESULTS/genmake_state + sed -n '/^HAVE_/p' $gmkLog | sed 's/^./ &/' \ + >> $DRESULTS/genmake_state fi fi fi