--- MITgcm/verification/testreport 2012/08/18 19:01:54 1.178 +++ MITgcm/verification/testreport 2014/11/11 15:45:57 1.198 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.178 2012/08/18 19:01:54 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.198 2014/11/11 15:45:57 jmc Exp $ # $Name: $ # @@ -11,20 +11,23 @@ echo echo "where possible OPTIONS are:" echo " (-help|-h) print usage" + echo " ---- type of test : ----" + echo " (-tlm) perform a Tangent Linear run" + echo " (-adm|-ad) perform an adjoint run" + echo " (-oad) perform an OpenAD adjoint run" echo " (-mth) run multi-threaded (using eedata.mth)" echo " (-mpi) use MPI to compile and run on 2 processors" echo " (-MPI) NUMBER use MPI to compile and run on max NUMBER procs" echo " (-mfile|-mf) STRING MPI: file with list of possible machines to run on" + 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 " (-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)" echo " (-gsl) compile with \"-gsl\" flag" echo " (-use_r4|-ur4) if allowed, use real*4 type for '_RS' variable" - echo " (-optfile|-of) STRING list of optfiles to use" - echo " (-addr|-a) STRING list of email recipients" - echo " (DEF=\"\" no email is sent)" - echo " (-mpackdir|-mpd) DIR location of the mpack utility" - echo " (DEF=\"../tools/mpack-1.6\")" echo " (-tdir|-t) STRING list of group and/or exp. dirs to test" echo " (recognized groups: basic, tutorials)" echo " (DEF=\"\" which test all)" @@ -32,24 +35,29 @@ echo " test THIS_EXP + all the following)" echo " (-skipdir|-skd) STRING list of exp. dirs to skip" echo " (DEF=\"\" which test all)" - echo " (-bash|-b) STRING preferred location of a \"bash\" or" - echo " Bourne-compatible \"sh\" shell" + echo " (-ts) provide timing information per timestep" + echo " (-papis) provide MFlop/s per timestep using PAPI" + echo " (-pcls) provide MFlop/s per timestep using PCL" + echo " ---- system options : ----" + echo " (-bash|-b) STRING preferred location of a \"bash\" or \"sh\" shell" echo " (DEF=\"\" for \"bash\")" - echo " (-tlm) perform a Tangent Linear run" - echo " (-adm|-ad) perform an adjoint run" - echo " (-oad) perform an OpenAD adjoint run" - echo " (-command|-c) STRING command to run" + echo " (-ef) STRING used as genmake2 \"-extra_flag\" argument" echo " (-makedepend|-md) STRING command to use for \"makedepend\"" echo " (-make|-m) 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" + echo " ---- output options : ----" echo " (-match) NUMBER Matching Criteria (number of digits)" echo " (DEF=\"$MATCH_CRIT\")" - echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" - echo " (-ef) STRING used as genmake2 \"-extra_flag\" argument" + echo " (-odir) STRING used to build output directory name" + echo " (DEF=\"hostname\")" + echo " (-addr|-a) STRING list of email recipients" + echo " (DEF=\"\" no email is sent)" + echo " (-send) STRING sending command (instead of using mpack)" + echo " (-savdir|-sd) STRING location to save output tar file to send (DEF='$SAVDIR')" + echo " (-mpackdir|-mpd) DIR location of the mpack utility" + echo " (DEF=\"../tools/mpack-1.6\")" + echo " -- do only some parts: --" echo " (-clean) *ONLY* run \"make CLEAN\" & clean run-dir" echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" echo " (-obj) only produces objects (=norun & no executable)" @@ -61,9 +69,6 @@ echo " (-postclean|-pc) after each exp. test, clean build-dir & run-dir" echo " (-deloutp|-do) delete output files after successful run" echo " (-deldir|-dd) on success, delete the output directory" - echo " (-ts) provide timing information per timestep" - echo " (-papis) provide MFlop/s per timestep using PAPI" - echo " (-pcls) provide MFlop/s per timestep using PCL" echo echo "and where STRING can be a whitespace-delimited list" echo "such as:" @@ -125,13 +130,13 @@ echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2 fi if [ -r $1/$4/$OUTPUTFILE ]; then - grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt - lncntA=`wc -l tmp1.txt | awk '{print $1}' ` + grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > ${TMP}a.txt + lncntA=`wc -l ${TMP}a.txt | awk '{print $1}' ` if [ $lncntA -lt 2 ]; then if [ $verbose -gt 0 ]; then echo Not enough lines of output when searching for "$2" 1>&2 fi - rm -f tmp1.txt ; return 99 + rm -f ${TMP}a.txt ; return 99 fi else echo testoutput_var: $OUTPUTFILE from model run was not readable 1>&2 @@ -140,44 +145,43 @@ if [ $debug -gt 0 ]; then echo testoutput_var: grep "$2" $1/$5 1>&2 fi - grep "$2" $1/$5 | sed 's/.*=//' | cat -n > tmp2.txt - lncntB=`wc -l tmp2.txt | awk '{print $1}' ` + grep "$2" $1/$5 | sed 's/.*=//' | cat -n > ${TMP}b.txt + lncntB=`wc -l ${TMP}b.txt | awk '{print $1}' ` if [ $lncntB -lt 2 ]; then if [ $verbose -gt 0 ]; then echo Not enough lines of output when searching for "$2" 1>&2 fi - rm -f tmp1.txt tmp2.txt ; return 99 + rm -f ${TMP}a.txt ${TMP}b.txt ; return 99 fi if [ $lncntA -ne $lncntB ]; then if [ $verbose -gt 0 ]; then echo Not same Nb of lines when searching for "$2" ":" $lncntA $lncntB 1>&2 fi - rm -f tmp1.txt tmp2.txt ; return 99 + rm -f ${TMP}a.txt ${TMP}b.txt ; return 99 fi - has_nan=`cat tmp1.txt | grep -i nan | wc -l` + has_nan=`cat ${TMP}a.txt | grep -i nan | wc -l` if [ $has_nan -gt 0 ] ; then echo testoutput_var: $OUTPUTFILE contains $has_nan NaN values 1>&2 - rm -f tmp1.txt tmp2.txt ; return 99 + rm -f ${TMP}a.txt ${TMP}b.txt ; return 99 fi - has_inf=`cat tmp1.txt | grep -i inf | wc -l` + has_inf=`cat ${TMP}a.txt | grep -i inf | wc -l` if [ $has_inf -gt 0 ] ; then echo testoutput_var: $OUTPUTFILE contains $has_inf Inf values 1>&2 - rm -f tmp1.txt tmp2.txt ; return 99 + rm -f ${TMP}a.txt ${TMP}b.txt ; return 99 fi if [ $debug -gt 0 ]; then - echo testoutput_var: join tmp1.txt tmp2.txt 1>&2 + echo testoutput_var: join ${TMP}a.txt ${TMP}b.txt 1>&2 fi - join tmp1.txt tmp2.txt | awk '{print $1 " " $2 " " $3}' > tmp3.txt + # On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number + join ${TMP}a.txt ${TMP}b.txt | awk '{print $1 " " $2 " " $3}' | sed -e 's|:||g' > ${TMP}c.txt if [ $debug -gt 0 ]; then echo testoutput_var: compare_lines 1>&2 fi if [ $verbose -gt 1 ]; then - cat tmp3.txt 1>&2 + cat ${TMP}c.txt 1>&2 fi - echo "-1" >> tmp3.txt - # On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number - cat tmp3.txt | sed -e 's|:||g' > tmp4.txt - digits_of_similarity=`./tr_cmpnum < tmp4.txt` + echo "-1" >> ${TMP}c.txt + digits_of_similarity=`./tr_cmpnum < ${TMP}c.txt` if [ $digits_of_similarity -eq 99 ]; then if [ $verbose -gt 0 ]; then echo testoutput_var: No comparison was available for \"$3\" 1>&2 @@ -188,7 +192,7 @@ echo There were $digits_of_similarity decimal places of similarity for \"$3\" 1>&2 fi fi - rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt + rm -f ${TMP}a.txt ${TMP}b.txt ${TMP}c.txt return $digits_of_similarity } @@ -322,9 +326,16 @@ '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=$? ;; + '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 if test $xx = $sVar @@ -361,12 +372,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 ../../OpenAD/code_oad_all'" + 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" @@ -423,7 +432,7 @@ makeclean() { # makeclean directory - if test "x$NODEPEND" = xf ; then rm -f $1/make.tr_log ; fi + if test "x$NOGENMAKE" = xf ; then rm -f $1/make.tr_log ; fi if test "x$NOCLEAN" = xt ; then echo "make Clean skipped!" else @@ -455,21 +464,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 } @@ -535,13 +546,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 @@ -788,6 +804,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'` @@ -912,6 +945,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' } @@ -997,6 +1037,8 @@ MPACKDIR="../tools/mpack-1.6" HAVE_MPACK= MPACK= +SENDCMD= +SAVDIR='.' COMMAND= MKDEPEND= if test "x$MAKE" = x ; then @@ -1052,6 +1094,11 @@ -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;; -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;; + -send | --send ) ac_prev=SENDCMD ;; + -send=* | --send=* ) SENDCMD=$ac_optarg ;; + -savdir | --savdir | -sd | --sd ) ac_prev=SAVDIR ;; + -savdir=* | --savdir=* | -sd=* | --sd=* ) SAVDIR=$ac_optarg ;; + -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;; -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;; -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;; @@ -1249,15 +1296,27 @@ LOC_MFILE='tr_mpi_mfile' RUNLOG="run.tr_log" -OUTPUTFILE=$ref_outp -if test "x$COMMAND" = x ; then - COMMAND="./$EXECUTABLE > $OUTPUTFILE" -fi -if test "x$MPI" != x0 ; then - OUTPUTFILE="STDOUT.0000" +if test "x$MPI" = x0 ; then + OUTPUTFILE=$ref_outp + 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 fi -echo "OK (COMMAND= $COMMAND )" +echo "OK (COMMAND='$COMMAND')" + +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 # set the Default List of output variables to be checked: # (use default or load experiment-specific list from file "tr_checklist") @@ -1287,19 +1346,23 @@ fi # build the mpack utility (if ADDRESSES = NONE, do it to test the build) -if test "x$ADDRESSES" = x ; then +if test "x$ADDRESSES" = x -o "x$SENDCMD" != x ; then echo "skipping mpack build" else build_mpack + if test "x$HAVE_MPACK" = xt ; then SENDCMD=$MPACK ; fi fi # 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` UNAMEA=`uname -a` DATE=`date +%Y%m%d` @@ -1307,7 +1370,8 @@ if test "x$OUTDIR" != x ; then BASE="tr_"$OUTDIR"_"$DATE"_" else - short_name=`hostname | sed 's/\..*$//'` + #short_name=`hostname | sed 's/\..*$//'` + short_name=`hostname -s | tr '[:upper:]' '[:lower:]'` BASE="tr_"$short_name"_"$DATE"_" fi DNUM=0 @@ -1344,8 +1408,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 @@ -1372,11 +1436,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 @@ -1416,6 +1489,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 ': ' @@ -1500,14 +1574,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 @@ -1591,8 +1664,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" @@ -1612,10 +1684,10 @@ sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ $SUMMARY > tmp.tr_log RETVAL=$? - if test "x$RETVAL" = x0 ; then rm -f $SUMMARY - cp tmp.tr_log $SUMMARY - else rm -f tmp.tr_log + if test "x$RETVAL" = x0 ; then + cp -f tmp.tr_log $SUMMARY fi + rm -f tmp.tr_log fi gmkLog=$dir/$builddir/genmake.log if test -r $gmkLog ; then @@ -1659,10 +1731,13 @@ if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then echo "No results email was sent." else - if test "x$HAVE_MPACK" = xt ; then - tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \ - && gzip $DRESULTS".tar" \ - && $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES + if test "x$SENDCMD" != x ; then + if [ $verbose -gt 1 ]; then + echo " run: $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES" + fi + tar -cf ${SAVDIR}/${DRESULTS}".tar" $DRESULTS > /dev/null 2>&1 \ + && gzip ${SAVDIR}/${DRESULTS}".tar" \ + && $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES RETVAL=$? if test "x$RETVAL" != x0 ; then echo @@ -1675,8 +1750,8 @@ echo "An email containing results was sent to the following addresses:" echo " \"$ADDRESSES\"" echo - test -f $DRESULTS".tar" && rm -f $DRESULTS".tar" - test -f $DRESULTS".tar.gz" && rm -f $DRESULTS".tar.gz" + test -f ${SAVDIR}/${DRESULTS}".tar" && rm -f ${SAVDIR}/${DRESULTS}".tar" + test -f ${SAVDIR}/${DRESULTS}".tar.gz" && rm -f ${SAVDIR}/${DRESULTS}".tar.gz" fi fi fi