--- MITgcm/verification/testreport 2004/07/06 19:53:34 1.40 +++ MITgcm/verification/testreport 2004/11/17 21:38:35 1.48 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.40 2004/07/06 19:53:34 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.48 2004/11/17 21:38:35 jmc 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,6 +27,7 @@ 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" @@ -235,7 +236,8 @@ printf 'genmake ... ' 1>&2 $command > make.log 2>&1 RETVAL=$? - cp Makefile $CDIR + # Reduce the size of the testing emails! + head -100 Makefile > $CDIR/Makefile_head if test "x$RETVAL" != x0 ; then tail make.log echo "genmakemodel: genmake failed" 1>&2 @@ -307,7 +309,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 @@ -334,7 +340,7 @@ code_dir=$2 BUILD_DIR=$dir/$3 CODE_DIR=$dir/$code_dir - + # These are files that should replace their counter-part when using -mpi MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")` @@ -349,20 +355,21 @@ RETVAL=$? if test "x$RETVAL" != x0 ; then if ! test -f $BUILD_DIR/$i ; then - #echo Linking $name to $i + #echo Linking $name to $i (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name) fi fi done else - # NO: We undo any _mpi symbolically linked files + # NO: We undo any _mpi symbolically linked files for ii in $MPI_FILES ; do i=`echo $ii | sed 's:^\./::'` name=`echo $i | sed 's:_mpi::' ` if test -L $BUILD_DIR/$name ; then - linktarg=`(cd $BUILD_DIR; readlink $name)` - if test $linktarg = "../$code_dir/$name"_mpi ; then - #echo Un-linking $name from $linktarg + cmp $BUILD_DIR/$name "../$code_dir/$name"_mpi > /dev/null 2>&1 + RETVAL=$? + if test "x$RETVAL" = x0 ; then + #echo Un-linking $name from $linktarg rm -f $BUILD_DIR/$name fi fi @@ -415,22 +422,27 @@ printf 'runmodel ... ' 1>&2 # make output.txt echo + rm -f run.log # echo "COMMAND='$COMMAND'" # echo "pwd='"`pwd`"'" - ( eval $COMMAND ) >> run.log 2>&1 + ( eval $COMMAND ) > run.log 2>&1 RETVAL=$? if test "x$RETVAL" = x0 ; then + tail run.log echo successful 1>&2 - if test "x$ADM" = x ; then - cp output.txt $CDIR"/output.txt" - else - cp output.txt_adm $CDIR"/output.txt_adm" - fi + # === Reduce the size of the testing emails! + # if test "x$ADM" = x ; then + # cp output.txt $CDIR"/output.txt" + # else + # cp output.txt_adm $CDIR"/output.txt_adm" + # fi + if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi return 0 else tail run.log echo failed 1>&2 cp run.log $CDIR"/run.log" + if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi return 1 fi ) @@ -567,6 +579,7 @@ MPACK="$MPACKDIR/mpack" COMMAND= MAKE=make +JOBS= MPI=f DELDIR= @@ -621,6 +634,9 @@ -make=* | --make=*) MAKE=$ac_optarg ;; + -j) ac_prev=JOBS ;; + -j=*) JOBS=$ac_optarg ;; + -clean | --clean) CLEANUP=t ;; @@ -679,7 +695,7 @@ fi if test "x$COMMAND" = x ; then - COMMAND="make output.txt" + COMMAND="$MAKE output.txt" fi echo "OK" @@ -868,26 +884,26 @@ 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" + 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 ) 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/mitgcmuv mitgcmuv ) - runmodel $dir/tr_run && run=Y \ - && results=`testoutput $dir tr_run "."$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" @@ -929,7 +945,7 @@ if test "x$HAVE_MPACK" = xt ; then tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \ && gzip $DRESULTS".tar" \ - && $MPACK -s MITgcm-test -m 1500000 $DRESULTS".tar.gz" $ADDRESSES + && $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES RETVAL=$? if test "x$RETVAL" != x0 ; then echo