--- MITgcm/verification/testreport 2012/08/15 23:19:21 1.175 +++ MITgcm/verification/testreport 2013/06/05 17:44:31 1.183 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.175 2012/08/15 23:19:21 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.183 2013/06/05 17:44:31 jmc Exp $ # $Name: $ # @@ -322,9 +322,11 @@ 'AthSiG') testoutput_var $1 "thSI_Ice_Area_G" "thSIc Area Global" $2 $refoutp ; yy=$? ;; 'AthSiS') testoutput_var $1 "thSI_Ice_Area_S" "thSIc Area South" $2 $refoutp ; yy=$? ;; 'AthSiN') testoutput_var $1 "thSI_Ice_Area_N" "thSIc Area North" $2 $refoutp ; yy=$? ;; - 'HthSiG') testoutput_var $1 "thSI_IceH_ave_G" "thSIc H Global" $2 $refoutp ; yy=$? ;; - 'HthSiS') testoutput_var $1 "thSI_IceH_ave_S" "thSIc H South" $2 $refoutp ; yy=$? ;; - 'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North" $2 $refoutp ; yy=$? ;; + 'HthSiG') testoutput_var $1 "thSI_IceH_ave_G" "thSIc H Glob-ave" $2 $refoutp ; yy=$? ;; + 'HthSiS') testoutput_var $1 "thSI_IceH_ave_S" "thSIc H South-av" $2 $refoutp ; yy=$? ;; + '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=$? ;; *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;; esac if test $xx = $sVar @@ -534,6 +536,9 @@ mk_fail=2 fi fi + if test $KIND = 1 -a -f taf_ftl.log ; then + head -1 taf_ftl.log >> $CDIR"/summary.txt" + fi if test $KIND = 2 -a -f taf_ad.log ; then head -1 taf_ad.log >> $CDIR"/summary.txt" nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log` @@ -802,13 +807,12 @@ fi fi rm -f run.log_tmp - #- in all cases where OutputFile exists, report SIZE (and AD time) + #- in all cases where OutputFile exists, report SIZE and time if test -f $OUTPUTFILE ; then grep '(PID\.TID 0000\.0001) n.. =' $OUTPUTFILE \ - | sed 's/(PID.TID 0000.0001) //' >> $CDIR"/summary.txt" - if test $KIND = 2 ; then - grep -A3 'Seconds in section "ALL' $OUTPUTFILE >> $CDIR"/summary.txt" - fi + | sed 's/(PID.TID 0000.0001) //' >> $CDIR"/summary.txt" + grep -A3 'Seconds in section "ALL' $OUTPUTFILE \ + | sed 's/(PID.TID 0000.0001) //' >> $CDIR"/summary.txt" fi if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then @@ -1278,7 +1282,7 @@ fi # create the FORTRAN comparison code -if test -x tr_cmpnum ; then +if test "x$CLEANUP" = xt -o -x tr_cmpnum ; then echo "skipping comparison code build" else createcodelet @@ -1294,8 +1298,12 @@ # Create a uniquely named directory to store results CMDLINE=$0 for xx in "$@" ; do nw=`echo $xx | wc -w` - if test $nw = '1' ; then CMDLINE="$CMDLINE $xx" - else CMDLINE="$CMDLINE '$xx'" ; fi + if test $nw = '1' ; then CMDLINE="$CMDLINE $xx" ; else + nb=`echo $xx | grep -c '='` + if test $nb = 0 ; then CMDLINE="$CMDLINE '$xx'" + else yy=`echo "$xx'" | sed "s/=/='/"` ; + CMDLINE="$CMDLINE $yy" ; fi + fi done #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done MACH=`hostname` @@ -1342,8 +1350,8 @@ echo >> $SUMMARY echo " OPTFILE=$OPTFILE" >> $SUMMARY else - echo | tee $SUMMARY - echo "ERROR: can't read OPTFILE=\"$OPTFILE\"" | tee $SUMMARY + echo | tee -a $SUMMARY + echo "ERROR: can't read OPTFILE=\"$OPTFILE\"" | tee -a $SUMMARY exit 1 fi else @@ -1370,11 +1378,20 @@ else line_0=`printf '%s %2i' 'default ' $MATCH_CRIT` if test $KIND = 1 ; then - echo "TANGLIN=true" >> $SUMMARY + #echo "TANGLIN=true" >> $SUMMARY + echo "TangLin generated by TAF" >> $SUMMARY + elif test $KIND = 3 ; then + echo "TangLin generated by OpenAD" >> $SUMMARY + elif test $KIND = 2 ; then + #echo "ADJOINT=true" >> $SUMMARY + echo "Adjoint generated by TAF" >> $SUMMARY + else + echo "Adjoint generated by OpenAD" >> $SUMMARY + fi + if test $KIND = 1 -o $KIND = 3 ; then line_1="G D M C T F" line_2="e p a R o L D" else - echo "ADJOINT=true" >> $SUMMARY line_1="G D M C A F" line_2="e p a R o d D" fi @@ -1382,12 +1399,14 @@ line_4="2 d e n t r r" echo >> $SUMMARY fi +if test "x$CLEANUP" != xt ; then echo "$line_0" | tee -a $SUMMARY echo "$line_1" | tee -a $SUMMARY echo "$line_2" | tee -a $SUMMARY echo "$line_3" | tee -a $SUMMARY echo "$line_4" | tee -a $SUMMARY echo "" | tee -a $SUMMARY +fi echo "-------------------------------------------------------------------------------" # ...and each test directory... @@ -1496,14 +1515,13 @@ # Check whether there are "extra runs" for this testdir extra_runs= if test "x$NORUN" = xf ; then - ex_run_dirs=`( cd $dir ; echo $inputdir.* )` + ex_run_dirs=`( cd $dir ; ls -d $inputdir.* 2> /dev/null )` fi #echo "ex_run_dirs='$ex_run_dirs'" for exd in $ex_run_dirs ; do name=`echo $exd | sed -e "s/$inputdir\.//"` refExOut=`echo $ref_outp | sed "s/\./.${name}./"` outf="$dir/results/$refExOut" - #if test -f $outf -a -r $outf ; then if test -r $outf -o -r ${outf}.gz ; then if test "x$MULTI_THREAD" = "xt" ; then if test -r $dir"/"$exd"/eedata.mth" ; then @@ -1597,7 +1615,7 @@ fi done - if test -f $DRESULTS"/"genmake_state ; then : ; else + if test ! -f $DRESULTS"/"genmake_state ; then 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 @@ -1606,24 +1624,31 @@ if test "x$OPTFILE" = xNONE ; then eval $mkOpt sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ - $SUMMARY > tr_0.tmp_log + $SUMMARY > tmp.tr_log RETVAL=$? if test "x$RETVAL" = x0 ; then rm -f $SUMMARY - cp tr_0.tmp_log $SUMMARY - else rm -f tr_0.tmp_log + cp tmp.tr_log $SUMMARY + else rm -f tmp.tr_log fi fi gmkLog=$dir/$builddir/genmake.log - grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1 - RETVAL=$? - if test "x$RETVAL" = x0 ; then - echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state - sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \ - | grep -v '^... compiler version ' > tr_1.tmp_log - sed -n '1p' tr_1.tmp_log >> $DRESULTS/genmake_state - sed -n '2,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \ - >> $DRESULTS/genmake_state - rm -f tr_1.tmp_log + if test -r $gmkLog ; then + grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1 + RETVAL=$? + if test "x$RETVAL" = x0 ; then + echo -n "from '$gmkLog', " >> $DRESULTS/genmake_state + echo "extract compiler version:" >> $DRESULTS/genmake_state + sed -n '/Get compiler version/,/<-- compiler version/p' \ + $gmkLog | grep -v '^... compiler version ' > tmp.tr_log + sed -n '1p' tmp.tr_log >> $DRESULTS/genmake_state + sed -n '2,/^$/p' tmp.tr_log | sed '/^$/d' | sed 's/^./ &/' \ + >> $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 fi fi @@ -1685,3 +1710,4 @@ if test "x$DELDIR" = xt ; then rm -rf $DRESULTS fi +echo "======== End of testreport execution ========"