--- MITgcm/verification/testreport 2013/09/22 23:35:56 1.195 +++ MITgcm/verification/testreport 2015/02/22 22:48:18 1.200 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.195 2013/09/22 23:35:56 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.200 2015/02/22 22:48:18 jmc Exp $ # $Name: $ # @@ -42,6 +42,7 @@ 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 " (-makedepend|-md) STRING command to use for \"makedepend\"" echo " (-make|-m) STRING command to use for \"make\"" echo " (DEF=\"make\")" @@ -331,6 +332,10 @@ 'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North-av" $2 $refoutp ; yy=$? ;; 'HthMxS') testoutput_var $1 "thSI_IceH_max_S" "thSIc H South-max" $2 $refoutp ; yy=$? ;; 'HthMxN') testoutput_var $1 "thSI_IceH_max_N" "thSIc H North-max" $2 $refoutp ; yy=$? ;; + 'sbo_M') testoutput_var $1 "sbo_mass" "SBO mass" $2 $refoutp ; yy=$? ;; + 'sboFW') testoutput_var $1 "sbo_mass_fw" "SBO m-FW" $2 $refoutp ; yy=$? ;; + 'sboAc') testoutput_var $1 "sbo_zoamc" "SBO AM-C" $2 $refoutp ; yy=$? ;; + '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 @@ -368,12 +373,10 @@ if test "x$MKDEPEND" != x ; then command="$command -makedepend=$MKDEPEND" fi - if test $KIND = 1 -o $KIND = 2 ; then - command="$command --mods=../code_ad" - elif test $KIND = 4 ; then - command="$command -adof ../../../tools/adjoint_options/adjoint_oad -mods ../code_oad" + if test $KIND = 4 ; then + command="$command -oad -mods=../$code_dir" else - command="$command -mods=../code" + command="$command -mods=../$code_dir" fi if test "x$OPTFILE" != xNONE ; then command="$command -optfile=$OPTFILE" @@ -400,6 +403,9 @@ if test "x$EXTRFLG" != x ; then command="$command -extra_flag $EXTRFLG" fi + if test "x$NOCATAD" = xt ; then + command="$command -nocat4ad" + fi if test "x$TS" = xt ; then command="$command -ts" fi @@ -522,11 +528,7 @@ cd $1; if test -r Makefile ; then printf 'make ... ' - if test "x$REPLMAKE" = x ; then - $MAKE $TARG >> make.tr_log 2>&1 - else - $REPLMAKE $TARG >> make.tr_log 2>&1 - fi + $MAKE_CMD $TARG >> make.tr_log 2>&1 RETVAL=$? if test "x$RETVAL" != x0 ; then tail make.tr_log @@ -1042,7 +1044,7 @@ if test "x$MAKE" = x ; then MAKE=make fi -REPLMAKE= +MAKE_CMD= if test "x$CC" = x ; then CC=cc fi @@ -1055,6 +1057,7 @@ DELDIR= USE_R4= EXTRFLG= +NOCATAD= #- type of testing (KIND): # KIND=0 : forward (= default) ; KIND=1 : Tangent Linear with TAF ; @@ -1114,8 +1117,8 @@ -make | --make | -m | --m) ac_prev=MAKE ;; -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;; - -repl_mk | --repl_mk ) ac_prev=REPLMAKE ;; - -repl_mk=* | --repl_mk=*) REPLMAKE=$ac_optarg ;; + -repl_mk | --repl_mk ) ac_prev=MAKE_CMD ;; + -repl_mk=* | --repl_mk=*) MAKE_CMD=$ac_optarg ;; -odir | --odir) ac_prev=OUTDIR ;; -odir=* | --odir=*) OUTDIR=$ac_optarg ;; @@ -1163,6 +1166,7 @@ -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage fi ;; + -ncad) NOCATAD=t ;; -ieee) echo "Warning: ignore option '-ieee' (already the default)" printf " ... " ;; @@ -1182,7 +1186,7 @@ -ts) TS=t;; -papis) PAPIS=t;; - -pcls) PCL=t;; + -pcls) PCLS=t;; -*) echo "Error: unrecognized option: "$ac_option usage ;; @@ -1198,6 +1202,7 @@ NOCLEAN=t NODEPEND=t fi +if test "x$MAKE_CMD" = x ; then MAKE_CMD=$MAKE ; fi #- check length of MPI machine file: if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then @@ -1236,12 +1241,12 @@ ref_outp="output_oadm.txt" EXECUTABLE="mitgcmuv_ad" else - if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi code_dir=code inputdir=input ref_outp="output.txt" EXECUTABLE="mitgcmuv" fi +if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi xx=`echo $TESTDIRS | awk '{print $1}'` if test "x$TESTDIRS" = x ; then @@ -1304,17 +1309,17 @@ echo "OK (COMMAND='$COMMAND')" -TMP=./tr_$$ +#TMP=./tr_$$ #- try to put temporary files in system-local /tmp dir -#TMP=/tmp/tr_$$ -#touch $TMP ; retVal=$? -#if [ $retVal -eq 0 ] ; then -# if test ! -r $TMP ; then TMP=./tr_$$ ; fi -#else -# TMP=./tr_$$ -#fi -#rm -f $TMP -#if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi +TMP=/tmp/tr_${USER}_$$ +touch $TMP ; retVal=$? +if [ $retVal -eq 0 ] ; then + if test ! -r $TMP ; then TMP=./tr_$$ ; fi +else + TMP=./tr_$$ +fi +rm -f $TMP +if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi # set the Default List of output variables to be checked: # (use default or load experiment-specific list from file "tr_checklist") @@ -1361,7 +1366,6 @@ CMDLINE="$CMDLINE $yy" ; fi fi done -#for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done MACH=`hostname` UNAMEA=`uname -a` DATE=`date +%Y%m%d` @@ -1369,7 +1373,9 @@ if test "x$OUTDIR" != x ; then BASE="tr_"$OUTDIR"_"$DATE"_" else - short_name=`hostname | sed 's/\..*$//'` + #short_name=`hostname -s | tr '[:upper:]' '[:lower:]'` + # hostname -s is not universal (does work on AIX system) + short_name=`hostname | sed 's/\..*$//' | tr '[:upper:]' '[:lower:]'` BASE="tr_"$short_name"_"$DATE"_" fi DNUM=0 @@ -1675,12 +1681,20 @@ if test -f $dir/$builddir/Makefile ; then mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'` echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state - sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state +# sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state +# bsd-sed cannot do the above code + cat $dir/$builddir/Makefile | \ + sed -n '/^# executed by:/{N + p + }' >> $DRESULTS/genmake_state echo " $mkOpt" >> $DRESULTS/genmake_state if test "x$OPTFILE" = xNONE ; then eval $mkOpt - sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ - $SUMMARY > tmp.tr_log +# sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ +# $SUMMARY > tmp.tr_log +# bsd-sed requires a newline after "a\": + sed "/^No \"OPTFILE\" was specified ; genmake2/a\\ + OPTFILE=${OPTFILE}" $SUMMARY > tmp.tr_log RETVAL=$? if test "x$RETVAL" = x0 ; then cp -f tmp.tr_log $SUMMARY