--- MITgcm/verification/testreport 2004/12/01 16:59:42 1.52 +++ MITgcm/verification/testreport 2005/02/04 16:41:42 1.66 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.52 2004/12/01 16:59:42 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.66 2005/02/04 16:41:42 edhill Exp $ # $Name: $ # @@ -294,6 +294,9 @@ if test "x$IEEE" != x ; then command="$command -ieee" fi + if test "x$MPI" = xt ; then + command="$command -mpi" + fi printf 'genmake ... ' 1>&2 $command > make.log 2>&1 RETVAL=$? @@ -450,7 +453,7 @@ if test "x$ADM" = x ; then files=`( cd ../input ; ls -1 | grep -v CVS )` for i in $files ; do - if test ! -d "../input/"$i ; then + if test ! -d "../input/"$i -a ! -f $i ; then ln -sf "../input/"$i $i fi done @@ -520,7 +523,7 @@ int main( int argc, char** argv ) { int linnum,best,lncnt; double a,b,abave,relerr; - best = -16; + best = -22; lncnt = 0; while( 1 & (lncnt+=1) < 999 ) { scanf("%d", &linnum); @@ -529,13 +532,9 @@ abave = 0.5*(fabs(a)+fabs(b)); if (abave > 0.0) { relerr=fabs(a-b)/abave; - if (relerr > 0.0) { - linnum = (int)log10(relerr); - best = (best > linnum) ? best : linnum; - } - } - else { - if (best == -16 && abave != 0) best = -22; + if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); } + else { linnum = -16 ; } + best = (best > linnum) ? best : linnum; } } if (lncnt == 999) best=-29; @@ -543,14 +542,15 @@ return 0; } EOF - cc -o tmp_cmpnum tmp_cmpnum.c -lm + $CC -o tmp_cmpnum tmp_cmpnum.c -lm if [ -x ./tmp_cmpnum ]; then echo "OK" return 0 else echo - echo "ERROR: failed to compile comparison code" + echo "ERROR: failed to compile comparison code -- please specify" + echo " a C compiler using the CC environment variable." exit 1 fi } @@ -639,7 +639,12 @@ HAVE_MPACK= MPACK="$MPACKDIR/mpack" COMMAND= -MAKE=make +if test "x$MAKE" = x ; then + MAKE=make +fi +if test "x$CC" = x ; then + CC=cc +fi JOBS= MPI=f DELDIR= @@ -873,6 +878,10 @@ if test -r $dir/input/Makefile ; then ( cd $dir/input ; make CLEAN ) fi + ( + cd $dir + rm -rf tr_run.* + ) continue fi @@ -881,7 +890,6 @@ fout= if test "x$ADM" = x ; then fout=$dir"/results/output.txt" - check_for_add_mon_output $fout else fout=$dir"/results_ad/output.txt_adm" fi @@ -889,6 +897,9 @@ echo "can't read \"$fout\" -- skipping $dir" continue fi + if test "x$ADM" = x ; then + check_for_add_mon_output $fout + fi # Check for additional types of monitor output @@ -966,27 +977,39 @@ 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.$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 )` + test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" + for ldir in input.$ex input ; do + ( + cd "$dir/$ldir" > /dev/null 2>&1 + ls -1 2>/dev/null \ + | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g' + ) > tr_exrun_links + ( + cd "$dir/tr_run.$ex" + cat ../../tr_exrun_links | while read i ; do + if test ! "x$i" = x ; then + test ! -r $i && ln -s "../"$ldir"/"$i $i + fi + done + ) + test -e tr_exrun_links && rm -f tr_exrun_links + done + ldir=build + ( + cd "$dir/$ldir" > /dev/null 2>&1 + ls -1 Makefile *.[fFhco] mitgcmuv 2>/dev/null \ + | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g' + ) > tr_exrun_links ( 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.$ex" - for i in $links; do - test -e $i && rm -f $i - ln -s ../input.$ex/$i $i - done - ln -s ../$builddir/mitgcmuv mitgcmuv + cat ../../tr_exrun_links | while read i ; do + if test ! "x$i" = x ; then + test ! -r $i && ln -s "../"$ldir"/"$i $i + fi + done ) + test -e tr_exrun_links && rm -f tr_exrun_links 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}` @@ -1000,7 +1023,6 @@ 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" @@ -1053,11 +1075,11 @@ rm -f tmp_cmpnum.c tmp_cmpnum if test "x$CLEANUP" != xt ; then - cat $SUMMARY + cat $SUMMARY | sed 's/ -- -- -- --//g' if test -e tr_out.txt ; then mv tr_out.txt tr_out.txt.old fi - cat $SUMMARY > tr_out.txt + cat $SUMMARY | sed 's/ -- -- -- --//g' > tr_out.txt fi if test "x$DELDIR" = xt ; then