--- MITgcm/verification/testreport 2004/03/12 02:44:34 1.34 +++ MITgcm/verification/testreport 2004/07/08 20:58:24 1.43 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.34 2004/03/12 02:44:34 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.43 2004/07/08 20:58:24 edhill Exp $ # $Name: $ # @@ -13,7 +13,7 @@ echo " (-help|-h) print usage" echo " (-mpi) use MPI input files" echo " (-ieee|-noieee) if possible, use IEEE compiler flags" - echo " (DEF=\"noieee\")" + echo " (DEF=\"-ieee\")" echo " (-optfile=|-of=)STRING list of optfiles to use" echo " (-a|-addr) STRING list of email recipients" echo " (DEF=\"edhill@mitgcm.org\")" @@ -27,11 +27,13 @@ echo " (DEF=\"make output.txt\")" echo " (-m|-make) STRING command to use for \"make\"" echo " (DEF=\"make\")" + echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" echo " (-clean) *ONLY* run \"make CLEAN\"" echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" echo " (-nogenmake|-ng) skip the genmake stage" echo " (-noclean|-nc) skip the \"make clean\" stage" echo " (-nodepend|-nd) skip the \"make depend\" stage" + echo " (-deldir|-dd) on success, delete the output directory" echo echo "and where STRING follows a whitespace-delimited format" echo "such as:" @@ -306,7 +308,11 @@ if test -r Makefile ; then printf 'make ... ' 1>&2 if test "x$ADM" = x ; then - $MAKE >> make.log 2>&1 + if test "x$JOBS" = x ; then + $MAKE >> make.log 2>&1 + else + $MAKE -j $JOBS >> make.log 2>&1 + fi else $MAKE adall >> make.log 2>&1 fi @@ -413,7 +419,10 @@ cd $1 printf 'runmodel ... ' 1>&2 # make output.txt - $COMMAND >> run.log 2>&1 + echo + # echo "COMMAND='$COMMAND'" + # echo "pwd='"`pwd`"'" + ( eval $COMMAND ) >> run.log 2>&1 RETVAL=$? if test "x$RETVAL" = x0 ; then echo successful 1>&2 @@ -542,7 +551,7 @@ expts='' # ieee=1 -IEEE= +IEEE=true if test "x$MITGCM_IEEE" != x ; then IEEE=$MITGCM_IEEE fi @@ -563,7 +572,9 @@ MPACK="$MPACKDIR/mpack" COMMAND= MAKE=make +JOBS= MPI=f +DELDIR= ADM= @@ -616,6 +627,9 @@ -make=* | --make=*) MAKE=$ac_optarg ;; + -j) ac_prev=JOBS ;; + -j=*) JOBS=$ac_optarg ;; + -clean | --clean) CLEANUP=t ;; @@ -639,6 +653,8 @@ -debug) debug=1 ;; -quiet) verbose=0 ;; + -deldir | -dd) DELDIR=t ;; + -*) echo "Error: unrecognized option: "$ac_option usage @@ -858,28 +874,29 @@ echo "DATE='$DATE'" >> $CDIR"/summary.txt" echo "tdir='$dir'" >> $CDIR"/summary.txt" + OLD_COMMAND=$COMMAND + COMMAND="./mitgcmuv > output.txt" for ex in $extra_runs ; do - test -e "$dir/tr_run" && rm -rf "$dir/tr_run" - mkdir "$dir/tr_run" - ( cd "$dir/input" ; links=`ls -1 | grep -v CVS` ) + test -e "$dir/tr_run.$ex" && rm -rf "$dir/tr_run.$ex" + mkdir "$dir/tr_run.$ex" + links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )` ( - cd "$dir/tr_run" + cd "$dir/tr_run.$ex" for i in $links; do ln -s ../input/$i $i done ) - ( cd "$dir/input.$ex" ; links=`ls -1 | grep -v CVS` ) + links=`( cd "$dir/input.$ex" > /dev/null 2>&1 ; ls -1 | grep -v CVS )` ( - cd "$dir/tr_run" + cd "$dir/tr_run.$ex" for i in $links; do test -e $i && rm -f $i ln -s ../input.$ex/$i $i done - ln -s ../$builddir/Makefile Makefile ln -s ../$builddir/mitgcmuv mitgcmuv ) - runmodel $dir/tr_run && run=Y \ - && results=`testoutput $dir $rundir "."$ex` + runmodel $dir/tr_run.$ex && run=Y \ + && results=`testoutput $dir tr_run.$ex "."$ex` fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` fres="$fres.$ex" @@ -891,6 +908,7 @@ echo "DATE='$DATE'" >> $CDIR"/summary.txt" echo "tdir='$dir'" >> $CDIR"/summary.txt" done + COMMAND=$OLD_COMMAND else fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` fres=$fres"$results $dir" @@ -950,3 +968,7 @@ cat $SUMMARY > tr_out.txt fi +if test "x$DELDIR" = xt ; then + rm -rf $DRESULTS +fi +