--- MITgcm/verification/testreport 2013/06/13 19:05:32 1.184 +++ MITgcm/verification/testreport 2013/07/25 00:42:41 1.191 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.184 2013/06/13 19:05:32 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.191 2013/07/25 00:42:41 jmc Exp $ # $Name: $ # @@ -458,21 +458,23 @@ if test "x$NOCLEAN" = xt ; then echo "run_clean skipped!" else - ( - cd $1; - printf 'clean run-dir ... ' - # part of what is done after "make clean" when doing "make CLEAN" - find . -name "*.meta" -exec rm {} \; - find . -name "*.data" -exec rm {} \; - find . -name "fort.*" -exec rm {} \; - find . -type l -exec rm {} \; - #- should remove executable only if sym-link (alredy done above) - rm -f $RUNLOG *.txt STD* w2_tile_topology.????.log *diagnostics.log datetime - rm -rf mnc_test_* - rm -f *_MIT_CE_000.opt0000 costfunction*0000 - echo successful - exit 0 - ) + ( + cd $1; + printf 'clean run-dir ... ' + # part of what is done after "make clean" when doing "make CLEAN" + find . -name "*.meta" -exec rm {} \; + find . -name "*.data" -exec rm {} \; + find . -name "fort.*" -exec rm {} \; + find . -type l -exec rm {} \; + #- should remove executable only if sym-link (already done above) + rm -f $RUNLOG *.txt STDOUT.* STDERR.* *diagnostics.log *.[0-9][0-9][0-9][0-9].log + rm -f datetime costfinal divided.ctrl snapshot* output_adm.*.diva_* + rm -f *_MIT_CE_000.opt0000 costfunction*0000 + rm -f oad_cp.[0-9][0-9][0-9].????? + rm -rf mnc_test_* + echo successful + exit 0 + ) fi } @@ -538,13 +540,18 @@ fi fi if test $KIND = 1 -a -f taf_ftl.log ; then - head -1 taf_ftl.log >> $CDIR"/summary.txt" + 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` - nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log` - echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \ + head -1 taf_ad.log >> $CDIR"/summary.txt" + nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log` + nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log` + if test -f taf_output ; then + n2er=`grep -c 'TAF *.* ERROR ' taf_output` + n3er=`grep -c '\*ERROR\* ' taf_output` + nerr=`expr $nerr + $n2er + $n3er` + fi + echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \ >> $CDIR"/summary.txt" fi if test $mk_fail != 0 ; then return $mk_fail ; fi @@ -791,6 +798,23 @@ # output do not exist or is older than executable: rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi + #- Divided Adjoint Run: + # get the number of additional runs (add_DIVA_runs) from file "run_ADM_DIVA" + if test $KIND = 2 -a -f run_ADM_DIVA ; then + adm_diva_nb=`sed -n '/^ *add_DIVA_runs\>.*=/p' run_ADM_DIVA | sed 's/ //g'` + echo " Divided Adjoint Run: $adm_diva_nb" >> $RUNLOG + eval "let $adm_diva_nb" + if [ $add_DIVA_runs -ge 1 ] ; then + rm -f costf* divided.ctrl snapshot* + echo -n "(add_DIVA_runs=$add_DIVA_runs) ... " + for ii in `seq 1 $add_DIVA_runs` ; do + ( eval $COMMAND ) >> $RUNLOG 2>&1 + echo " additional DIVA run # $ii : done" >> $RUNLOG + mv -f $OUTPUTFILE ${OUTPUTFILE}.diva_${ii} + done + fi + fi + #- special DIVA processing ends here ( eval $COMMAND ) >> $RUNLOG 2>&1 RETVAL=$? ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'` @@ -915,6 +939,13 @@ fi fi printf ' %s' $nm + if test $KIND = 2 ; then + #-- apppend taf repport summary: + tafrep=`grep -c '^ TAF reports ' $CDIR/summary.txt` + if test $tafrep = 1 ; then + grep '^ TAF reports ' $CDIR/summary.txt | awk '{printf " (e=%i, w=%i)",$3,$6}' + fi + fi printf '\n' } @@ -1432,6 +1463,7 @@ rm -f $EXECUTABLE *.bak rm -f genmake_state genmake_*optfile genmake.log rm -f SIZE.h.mpi genmake.tr_log make.tr_log + rm -rf mpi_headers ) if test -d $dir/$rundir/CVS ; then echo -n ' --- dir:' $dir/$rundir ': ' @@ -1606,8 +1638,7 @@ linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir runmodel $dir/$pfxdir.$ex && run=Y \ && results=`testoutput_run $dir $pfxdir.$ex $refExOut` - fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` - fres="$fres.$ex" + 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"