/[MITgcm]/MITgcm/verification/testreport
ViewVC logotype

Diff of /MITgcm/verification/testreport

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.30 by edhill, Fri Dec 5 17:46:32 2003 UTC revision 1.69 by jmc, Thu Jul 28 16:32:34 2005 UTC
# Line 13  usage() Line 13  usage()
13      echo "  (-help|-h)               print usage"      echo "  (-help|-h)               print usage"
14      echo "  (-mpi)                   use MPI input files"      echo "  (-mpi)                   use MPI input files"
15      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"
16      echo "                             (DEF=\"noieee\")"      echo "                             (DEF=\"-ieee\")"
17      echo "  (-optfile=|-of=)STRING   list of optfiles to use"      echo "  (-optfile=|-of=)STRING   list of optfiles to use"
18      echo "  (-a|-addr) STRING        list of email recipients"      echo "  (-a|-addr) STRING        list of email recipients"
19      echo "                             (DEF=\"edhill@mitgcm.org\")"      echo "                             (DEF=\"edhill@mitgcm.org\")"
# Line 27  usage() Line 27  usage()
27      echo "                             (DEF=\"make output.txt\")"      echo "                             (DEF=\"make output.txt\")"
28      echo "  (-m|-make) STRING        command to use for \"make\""      echo "  (-m|-make) STRING        command to use for \"make\""
29      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
30        echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"
31        echo "                             (DEF=\"1 2 3 4 5\")"
32        echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
33      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\""
34      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
35      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
36      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
37      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
38        echo "  (-deldir|-dd)            on success, delete the output directory"
39      echo      echo
40      echo "and where STRING follows a whitespace-delimited format"      echo "and where STRING can be a whitespace-delimited list"
41      echo "such as:"      echo "such as:"
42        echo
43      echo "  -t 'exp0 exp2 exp3' "      echo "  -t 'exp0 exp2 exp3' "
44      echo "  -addr='abc@123.com testing@home.org'"      echo "  -addr='abc@123.com testing@home.org'"
45      echo      echo
46        echo "provided that the expression is properly quoted within the current"
47        echo "shell (note the use of single quotes to protect white space)."
48        echo
49      exit 1      exit 1
50  }  }
51    
52  #  build the mpack utility  #  build the mpack utility
53  build_mpack()  build_mpack()
54  {  {
55      echo -n "building the mpack utility...  "      printf "building the mpack utility...  "
56      if test ! -x "$MPACKDIR/mpack" ; then      if test ! -x "$MPACKDIR/mpack" ; then
57          if test ! -d $MPACKDIR ; then          if test ! -d $MPACKDIR ; then
58              echo              echo
# Line 54  build_mpack() Line 62  build_mpack()
62              echo              echo
63              HAVE_MPACK=f              HAVE_MPACK=f
64          fi          fi
65          echo -n "building mpack...  "          printf "building mpack...  "
66          if test "x$CC" = x ; then          if test "x$CC" = x ; then
67              export CC=cc              export CC=cc
68          fi          fi
# Line 77  build_mpack() Line 85  build_mpack()
85    
86  testoutput_for_prop()  testoutput_for_prop()
87  {  {
88      # testoutput_for_prop dir s1 label subdir      # testoutput_for_prop dir s1 label subdir extension
89      #      #
90      #  compares files in $dir/$subdir/output.txt and $dir/results/output.txt      #  compares files in $dir/$subdir/output.txt and $dir/results/output.txt
91      #  using search strings s1 and text label      #  using search strings s1 and text label
# Line 87  testoutput_for_prop() Line 95  testoutput_for_prop()
95      fi      fi
96      if [ -r $1/$4/output.txt ]; then      if [ -r $1/$4/output.txt ]; then
97          grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt          grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt
98          lncnt=`wc -l tmp1.txt | awk '{print $1}' `          lncntA=`wc -l tmp1.txt | awk '{print $1}' `
99          if [ $lncnt -lt 3 ]; then          if [ $lncntA -lt 3 ]; then
100              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
101                  echo Not enough lines of output when searching for "$2" 1>&2                  echo Not enough lines of output when searching for "$2" 1>&2
102              fi              fi
# Line 99  testoutput_for_prop() Line 107  testoutput_for_prop()
107          return 99          return 99
108      fi      fi
109      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
110          echo testoutput_for_prop: grep "$2" $1/results/output.txt 1>&2          echo testoutput_for_prop: grep "$2" $1/results/output.txt$5 1>&2
111      fi      fi
112      grep "$2" $1/results/output.txt | sed 's/.*=//' | cat -n > tmp2.txt      grep "$2" $1/results/output.txt$5 | sed 's/.*=//' | cat -n > tmp2.txt
113      lncnt=`wc -l tmp2.txt | awk '{print $1}' `      lncntB=`wc -l tmp2.txt | awk '{print $1}' `
114      if [ $lncnt -lt 3 ]; then      if [ $lncntB -lt 3 ]; then
115          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
116              echo Not enough lines of output when searching for "$2" 1>&2              echo Not enough lines of output when searching for "$2" 1>&2
117          fi          fi
118          return 99          return 99
119      fi      fi
120        if [ $lncntA -ne $lncntB ]; then
121            if [ $verbose -gt 0 ]; then
122                echo Not same Nb of lines when searching for "$2" ":" $lncntA $lncntB 1>&2
123            fi
124            return 99
125        fi
126      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
127          echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2          echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2
128      fi      fi
# Line 169  testoutput_ad() Line 183  testoutput_ad()
183      rm -f t[01][56].txt t[56].txt      rm -f t[01][56].txt t[56].txt
184  }  }
185    
186    check_for_add_mon_output()
187    {
188        # Check for additional types of monitor output
189        if test "x$1" = x ; then
190            return
191        fi
192    
193        for ii in $PTRACERS_NUM ; do
194            eval "HAVE_PTR0"$ii"=f"
195        done
196    
197        ptr_add="trcstat_ptracerXX_min trcstat_ptracerXX_max"
198        ptr_add="$ptr_add trcstat_ptracerXX_mean trcstat_ptracerXX_sd"
199        for ii in $PTRACERS_NUM ; do
200            for jj in $ptr_add ; do
201                name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"`
202                tst=`grep $name $1 | wc -l | awk '{print $1}'`
203                if test ! "x$tst" = x0 ; then
204                    eval "HAVE_PTR0"$ii"=t"
205                fi
206            done
207            #  eval 'echo "HAVE_PTR0'$ii' = $HAVE_PTR0'$ii'"'
208        done
209    }
210    
211  testoutput()  testoutput()
212  {  {
213      # testoutput directory subdir      # testoutput directory subdir extension
214      #      #
215      #  test output in "directory"      #  test output in "directory"
216      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
217          if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
218              echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2              echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2
219          fi          fi
220          testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2; cg2dres=$?          testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2 $3; cg2dres=$?
221          if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
222              echo testoutput: cg2dres=$cg2dres 1>&2              echo testoutput: cg2dres=$cg2dres 1>&2
223          fi          fi
224          testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$?          testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2 $3; tmin=$?
225          testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$?          testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2 $3; tmax=$?
226          testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$?          testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2 $3; tmean=$?
227          testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2; tsd=$?          testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2 $3; tsd=$?
228          testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2; smin=$?          testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2 $3; smin=$?
229          testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2; smax=$?          testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2 $3; smax=$?
230          testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2; smean=$?          testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2 $3; smean=$?
231          testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2; ssd=$?          testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2 $3; ssd=$?
232          testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2; umin=$?          testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2 $3; umin=$?
233          testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2; umax=$?          testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2 $3; umax=$?
234          testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2; umean=$?          testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2 $3; umean=$?
235          testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2; usd=$?          testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2 $3; usd=$?
236          testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2; vmin=$?          testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2 $3; vmin=$?
237          testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2; vmax=$?          testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2 $3; vmax=$?
238          testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2; vmean=$?          testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2 $3; vmean=$?
239          testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2; vsd=$?          testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2 $3; vsd=$?
240          dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \  
241              $umin $umax $umean $usd $vmin $vmax $vmean $vsd          #  This is for PTRACERS
242            for ii in $PTRACERS_NUM ; do
243                eval `echo "p0"$ii"_min=99"`
244                eval `echo "p0"$ii"_max=99"`
245                eval `echo "p0"$ii"_mean=99"`
246                eval `echo "p0"$ii"_sd=99"`
247                tst=`eval 'echo "$HAVE_PTR0'$ii'"'`
248                #echo 'tst = '$tst
249                if test "x$tst" = xt ; then
250                    a="trcstat_ptracer0"
251                    testoutput_for_prop $1 "$a"$ii"_min"  "p0"$ii"_min"  $2 $3
252                    RETVAL=$? ; eval `echo "p0"$ii"_min="$RETVAL`
253                    testoutput_for_prop $1 "$a"$ii"_max"  "p0"$ii"_max"  $2 $3
254                    RETVAL=$? ; eval `echo "p0"$ii"_max="$RETVAL`
255                    testoutput_for_prop $1 "$a"$ii"_mean" "p0"$ii"_mean" $2 $3
256                    RETVAL=$? ; eval `echo "p0"$ii"_mean="$RETVAL`
257                    testoutput_for_prop $1 "$a"$ii"_sd"   "p0"$ii"_sd"   $2 $3
258                    RETVAL=$? ; eval `echo "p0"$ii"_sd="$RETVAL`
259                fi
260            done
261    
262            allargs="$cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd"
263            allargs="$allargs $umin $umax $umean $usd $vmin $vmax $vmean $vsd"
264            allargs="$allargs $p01_min $p01_max $p01_mean $p01_sd"
265            allargs="$allargs $p02_min $p02_max $p02_mean $p02_sd"
266            allargs="$allargs $p03_min $p03_max $p03_mean $p03_sd"
267            allargs="$allargs $p04_min $p04_max $p04_mean $p04_sd"
268            allargs="$allargs $p05_min $p05_max $p05_mean $p05_sd"
269    
270            eval "dashnum $allargs"
271    
272      else      else
273          testoutput_ad $1 $2 "precision_grdchk_result"          testoutput_ad $1 $2 "precision_grdchk_result"
274      fi      fi
# Line 211  genmakemodel() Line 280  genmakemodel()
280      if test "x$NOGENMAKE" = xt ; then      if test "x$NOGENMAKE" = xt ; then
281          echo "genmake skipped!"          echo "genmake skipped!"
282      else      else
283          GENMAKE2="$BASH ../../../tools/genmake2"          if test "x$BASH" = x ; then
284                GENMAKE2="../../../tools/genmake2"
285            else
286                GENMAKE2="$BASH ../../../tools/genmake2 -bash $BASH"
287            fi
288          (          (
289              cd $1;              cd $1;
290              command="$GENMAKE2  -ds -m $MAKE"              command="$GENMAKE2  -ds -m $MAKE"
# Line 227  genmakemodel() Line 300  genmakemodel()
300              if test "x$IEEE" != x ; then              if test "x$IEEE" != x ; then
301                  command="$command -ieee"                  command="$command -ieee"
302              fi              fi
303                if test "x$MPI" = xt ; then
304                    command="$command -mpi"
305                fi
306              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
307              $command > make.log 2>&1              $command > make.log 2>&1
308              RETVAL=$?              RETVAL=$?
309              cp Makefile $CDIR              #  Reduce the size of the testing emails!
310                head -100 Makefile > $CDIR/Makefile_head
311              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
312                  tail make.log                  tail make.log
313                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed" 1>&2
# Line 271  makeclean() Line 348  makeclean()
348      fi      fi
349  }  }
350    
351    postclean()
352    {
353        # postclean directory
354        if test "x$POSTCLEAN" = xt ; then
355            (
356                cd $1;
357                if test -r Makefile ; then
358                    $MAKE CLEAN >> /dev/null 2>&1
359                fi
360                exit 0
361            )
362        fi
363    }
364    
365  makedependmodel()  makedependmodel()
366  {  {
367      # makedependmodel directory      # makedependmodel directory
# Line 302  makemodel() Line 393  makemodel()
393          if test -r Makefile ; then          if test -r Makefile ; then
394              printf 'make ... ' 1>&2              printf 'make ... ' 1>&2
395              if test "x$ADM" = x ; then              if test "x$ADM" = x ; then
396                  $MAKE >> make.log 2>&1                  if test "x$JOBS" = x ; then
397                        $MAKE >> make.log 2>&1
398                    else
399                        $MAKE -j $JOBS >> make.log 2>&1
400                    fi
401              else              else
402                  $MAKE adall >> make.log 2>&1                  $MAKE adall >> make.log 2>&1
403              fi              fi
# Line 329  symlink_mpifiles() Line 424  symlink_mpifiles()
424      code_dir=$2      code_dir=$2
425      BUILD_DIR=$dir/$3      BUILD_DIR=$dir/$3
426      CODE_DIR=$dir/$code_dir      CODE_DIR=$dir/$code_dir
427        
428      # These are files that should replace their counter-part when using -mpi      # These are files that should replace their counter-part when using -mpi
429      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`
430    
# Line 344  symlink_mpifiles() Line 439  symlink_mpifiles()
439              RETVAL=$?              RETVAL=$?
440              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
441                  if ! test -f $BUILD_DIR/$i ; then                  if ! test -f $BUILD_DIR/$i ; then
442                  #echo Linking $name to $i                      #echo Linking $name to $i
443                      (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)                      (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)
444                  fi                  fi
445              fi              fi
446          done          done
447      else      else
448      # NO: We undo any _mpi symbolically linked files          # NO: We undo any _mpi symbolically linked files
449          for ii in $MPI_FILES ; do          for ii in $MPI_FILES ; do
450              i=`echo $ii | sed 's:^\./::'`              i=`echo $ii | sed 's:^\./::'`
451              name=`echo $i | sed 's:_mpi::' `              name=`echo $i | sed 's:_mpi::' `
452              if test -L $BUILD_DIR/$name ; then              if test -L $BUILD_DIR/$name ; then
453                  linktarg=`(cd $BUILD_DIR; readlink $name)`                  cmp $BUILD_DIR/$name "../$code_dir/$name"_mpi > /dev/null 2>&1
454                  if test $linktarg = "../$code_dir/$name"_mpi ; then                  RETVAL=$?
455                  #echo Un-linking $name from $linktarg                  if test "x$RETVAL" = x0 ; then
456                        #echo Un-linking $name from $linktarg
457                      rm -f $BUILD_DIR/$name                      rm -f $BUILD_DIR/$name
458                  fi                  fi
459              fi              fi
# Line 377  linkdata() Line 473  linkdata()
473              if test "x$ADM" = x ; then              if test "x$ADM" = x ; then
474                  files=`( cd ../input ; ls -1 | grep -v CVS )`                  files=`( cd ../input ; ls -1 | grep -v CVS )`
475                  for i in $files ; do                  for i in $files ; do
476                      if test ! -d "../input/"$i ; then                      if test ! -d "../input/"$i -a ! -f $i ; then
477                          ln -sf "../input/"$i $i                          ln -sf "../input/"$i $i
478                      fi                      fi
479                  done                  done
# Line 409  runmodel() Line 505  runmodel()
505          cd $1          cd $1
506          printf 'runmodel ... ' 1>&2          printf 'runmodel ... ' 1>&2
507          # make output.txt          # make output.txt
508          $COMMAND >> run.log 2>&1          echo
509            rm -f run.log
510            # echo "COMMAND='$COMMAND'"
511            # echo "pwd='"`pwd`"'"
512            ( eval $COMMAND ) > run.log 2>&1
513          RETVAL=$?          RETVAL=$?
514          if test "x$RETVAL" = x0 ; then          if test "x$RETVAL" = x0 ; then
515                tail run.log
516              echo successful 1>&2              echo successful 1>&2
517              if test "x$ADM" = x ; then              # === Reduce the size of the testing emails!
518                  cp output.txt $CDIR"/output.txt"              # if test "x$ADM" = x ; then
519              else              #   cp output.txt $CDIR"/output.txt"
520                  cp output.txt_adm $CDIR"/output.txt_adm"              # else
521              fi              #   cp output.txt_adm $CDIR"/output.txt_adm"
522                # fi
523                if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
524              return 0              return 0
525          else          else
526              tail run.log              tail run.log
527              echo failed 1>&2              echo failed 1>&2
528              cp run.log $CDIR"/run.log"              cp run.log $CDIR"/run.log"
529                if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
530              return 1              return 1
531          fi          fi
532      )      )
# Line 432  createcodelet() Line 536  createcodelet()
536  {  {
537      # create codelet for comparing model output      # create codelet for comparing model output
538    
539      echo -n "creating the comparison code...  "      printf "creating the comparison code...  "
540      cat > tmp_cmpnum.c <<EOF      cat > tmp_cmpnum.c <<EOF
541  #include <stdio.h>  #include <stdio.h>
542  #include <math.h>  #include <math.h>
543  int main( int argc, char** argv )  {  int main( int argc, char** argv )  {
544    int linnum,best;    int linnum,best,lncnt;
545    double a,b,diff;    double a,b,abave,relerr;
546    best = -16;    best = -22;
547    while( 1 )  {    lncnt = 0;
548      while( 1 & (lncnt+=1) < 999 )  {
549      scanf("%d", &linnum);      scanf("%d", &linnum);
550      if (linnum == -1)  break;      if (linnum == -1)  break;
551      scanf("%lf", &a);  scanf("%lf", &b);      scanf("%lf", &a);  scanf("%lf", &b);
552      diff = 0.5*(fabs(a)+fabs(b));      abave = 0.5*(fabs(a)+fabs(b));
553      if (diff > 1.e-12) {      if (abave > 0.0) {
554        diff=fabs(a-b)/diff;        relerr=fabs(a-b)/abave;
555        if (diff > 0.0) {        if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); }
556          linnum = (int)log10(diff);        else { linnum = -16 ; }
557          best = (best > linnum) ? best : linnum;        best = (best > linnum) ? best : linnum;
       }  
       else {  
         if (best == -16 && diff != 0)  best = -22;  
       }  
558      }      }
559    }    }
560      if (lncnt == 999) best=-29;
561    printf("%d\n", -best);    printf("%d\n", -best);
562    return 0;    return 0;
563  }  }
564  EOF  EOF
565      cc -o tmp_cmpnum tmp_cmpnum.c -lm      $CC -o tmp_cmpnum tmp_cmpnum.c -lm
566    
567      if [ -x ./tmp_cmpnum ]; then      if [ -x ./tmp_cmpnum ]; then
568          echo "OK"          echo "OK"
569          return 0          return 0
570      else      else
571          echo          echo
572          echo "ERROR: failed to compile comparison code"          echo "ERROR: failed to compile comparison code -- please specify"
573            echo "  a C compiler using the CC environment variable."
574          exit 1          exit 1
575      fi      fi
576  }  }
# Line 536  clean=0 Line 639  clean=0
639  expts=''  expts=''
640  # ieee=1  # ieee=1
641    
642  IEEE=  IEEE=true
643  if test "x$MITGCM_IEEE" != x ; then  if test "x$MITGCM_IEEE" != x ; then
644      IEEE=$MITGCM_IEEE      IEEE=$MITGCM_IEEE
645  fi  fi
# Line 547  QUICK=f Line 650  QUICK=f
650  NOGENMAKE=f  NOGENMAKE=f
651  NOCLEAN=f  NOCLEAN=f
652  NODEPEND=f  NODEPEND=f
653    POSTCLEAN=f
654    
655  BASH=  BASH=
656  OPTFILE=NONE  OPTFILE=NONE
# Line 556  MPACKDIR="../tools/mpack-1.6" Line 660  MPACKDIR="../tools/mpack-1.6"
660  HAVE_MPACK=  HAVE_MPACK=
661  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
662  COMMAND=  COMMAND=
663  MAKE=make  if test "x$MAKE" = x ; then
664        MAKE=make
665    fi
666    if test "x$CC" = x ; then
667        CC=cc
668    fi
669    JOBS=
670  MPI=f  MPI=f
671    DELDIR=
672    
673  ADM=  ADM=
674    
675  echo -n "parsing options...  "  # Additional monitor types
676    PTRACERS_NUM="1 2 3 4 5"
677    
678    printf "parsing options...  "
679    
680  ac_prev=  ac_prev=
681  for ac_option ; do  for ac_option ; do
# Line 610  for ac_option ; do Line 724  for ac_option ; do
724          -make=* | --make=*)          -make=* | --make=*)
725              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
726    
727            -ptracers | --ptracers | -ptr | --ptr)
728                ac_prev=PTRACERS_NUM ;;
729            -ptracers=* | --ptracers=* | -ptr=* | --ptr=*)
730                PTRACERS_NUM=$ac_optarg ;;
731    
732            -j) ac_prev=JOBS ;;
733            -j=*) JOBS=$ac_optarg ;;
734    
735          -clean | --clean)          -clean | --clean)
736              CLEANUP=t ;;              CLEANUP=t ; DELDIR=t ;;
737    
738          -quick | --quick | -q | --q)          -quick | --quick | -q | --q)
739              QUICK=t ;;              QUICK=t ;;
# Line 622  for ac_option ; do Line 744  for ac_option ; do
744          -nodepend | --nodepend | -nd | --nd)          -nodepend | --nodepend | -nd | --nd)
745              NODEPEND=t ;;              NODEPEND=t ;;
746    
747            -postclean | --postclean | -pc | --pc)
748                POSTCLEAN=t ;;
749    
750          -mpi) MPI=t ;;          -mpi) MPI=t ;;
751    
752          -adm | -ad) ADM=t ;;          -adm | -ad) ADM=t ;;
# Line 633  for ac_option ; do Line 758  for ac_option ; do
758          -debug) debug=1 ;;          -debug) debug=1 ;;
759          -quiet) verbose=0 ;;          -quiet) verbose=0 ;;
760    
761            -deldir | -dd) DELDIR=t ;;
762    
763          -*)          -*)
764              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
765              usage              usage
# Line 666  if test "x$ADM" = xt -a "x$COMMAND" = x Line 793  if test "x$ADM" = xt -a "x$COMMAND" = x
793  fi  fi
794    
795  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
796      COMMAND="make output.txt"      COMMAND="$MAKE output.txt"
797  fi  fi
798    
799  echo "OK"  echo "OK"
# Line 675  echo "OK" Line 802  echo "OK"
802  createcodelet  createcodelet
803    
804  #  build the mpack utility  #  build the mpack utility
805  build_mpack  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
806        echo "skipping mpack build"
807    else
808        build_mpack
809    fi
810    
811  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
812  MACH=`hostname`  MACH=`hostname`
# Line 695  if test "x$RETVAL" != x0 ; then Line 826  if test "x$RETVAL" != x0 ; then
826      exit 1      exit 1
827  fi  fi
828  SUMMARY="$DRESULTS/summary.txt"  SUMMARY="$DRESULTS/summary.txt"
829  echo -n "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
830  start_date=`date`  start_date=`date`
831  echo $start_date > $SUMMARY  echo $start_date > $SUMMARY
832    
# Line 727  fi Line 858  fi
858  echo  echo
859  echo >> $SUMMARY  echo >> $SUMMARY
860  if test "x$ADM" = x ; then  if test "x$ADM" = x ; then
861      cat << EOF | tee -a $SUMMARY      line_0="            ----T-----  ----S-----  ----U-----  ----V-----"
862                  T           S           U           V      line_1="G D M    c        m  s        m  s        m  s        m  s"
863  G D M    c        m  s        m  s        m  s        m  s      line_2="E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  ."
864  E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .      line_3="N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d"
865  N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d      line_4="2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  ."
866  2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .      for ii in $PTRACERS_NUM ; do
867            #  tst=`eval 'echo $HAVE_PTR0'$ii`
868  EOF          #  if test "x$tst" = xt ; then
869            line_0="$line_0  --PTR 0"$ii"--"
870            line_1="$line_1        m  s"
871            line_2="$line_2  m  m  e  ."
872            line_3="$line_3  i  a  a  d"
873            line_4="$line_4  n  x  n  ."
874            #  fi
875        done
876        echo "$line_0" | tee -a $SUMMARY
877        echo "$line_1" | tee -a $SUMMARY
878        echo "$line_2" | tee -a $SUMMARY
879        echo "$line_3" | tee -a $SUMMARY
880        echo "$line_4" | tee -a $SUMMARY
881        echo " "       | tee -a $SUMMARY
882  else  else
883      echo "ADJOINT=true" >> $SUMMARY      echo "ADJOINT=true" >> $SUMMARY
884      echo >> $SUMMARY      echo >> $SUMMARY
# Line 758  for dir in $TESTDIRS ; do Line 902  for dir in $TESTDIRS ; do
902          if test -r $dir/input/Makefile ; then          if test -r $dir/input/Makefile ; then
903              ( cd $dir/input ; make CLEAN )              ( cd $dir/input ; make CLEAN )
904          fi          fi
905            (
906                cd $dir
907                rm -rf tr_run.*
908            )
909          continue          continue
910      fi      fi
911    
# Line 773  for dir in $TESTDIRS ; do Line 921  for dir in $TESTDIRS ; do
921          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
922          continue          continue
923      fi      fi
924        if test "x$ADM" = x ; then
925            check_for_add_mon_output  $fout
926        fi
927    
928        # Check for additional types of monitor output
929    
930      builddir="input"      builddir="input"
931      rundir="input"      rundir="input"
# Line 784  for dir in $TESTDIRS ; do Line 937  for dir in $TESTDIRS ; do
937          linkdata $use_seperate_build $dir/$rundir          linkdata $use_seperate_build $dir/$rundir
938      fi      fi
939            
940        #  Check whether there are "extra runs" for this testdir
941        extra_runs=
942        if test "x$ADM" = x -a "x$use_seperate_build" = x1 ; then
943            ex_run_dirs=`( cd $dir ; echo input.* )`
944            echo "ex_run_dirs='$ex_run_dirs'"
945            for exd in $ex_run_dirs ; do
946                name=`echo $exd | sed -e 's/input.//g'`
947                outf="$dir/results/output.txt.$name"
948                if test -f $outf -a -r $outf ; then
949                    extra_runs="$extra_runs $name"
950                fi
951            done
952        fi
953    
954      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
955          code_dir=code          code_dir=code
956          CODE_DIR=$dir/code          CODE_DIR=$dir/code
# Line 826  for dir in $TESTDIRS ; do Line 993  for dir in $TESTDIRS ; do
993      echo      echo
994      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
995          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
996            echo
997            echo "$fres" >> $SUMMARY
998            echo "fresults='$fres'" > $CDIR"/summary.txt"
999            echo "MACH='$MACH'" >> $CDIR"/summary.txt"
1000            echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
1001            echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1002            echo "tdir='$dir'" >> $CDIR"/summary.txt"
1003    
1004            for ex in $extra_runs ; do
1005                test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"
1006                for ldir in input.$ex input ; do
1007                    (
1008                        cd "$dir/$ldir" > /dev/null 2>&1
1009                        ls -1 2>/dev/null \
1010                            | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g'
1011                    ) > tr_exrun_links
1012                    (
1013                        cd "$dir/tr_run.$ex"
1014                        cat ../../tr_exrun_links | while read i ; do
1015                            if test ! "x$i" = x ; then
1016                                test ! -r $i  &&  ln -s "../"$ldir"/"$i $i
1017                            fi
1018                        done
1019                    )
1020                    test -e tr_exrun_links  &&  rm -f tr_exrun_links
1021                done
1022                ldir=build
1023                (
1024                    cd "$dir/$ldir" > /dev/null 2>&1
1025                    ls -1 Makefile *.[fFhco] mitgcmuv  2>/dev/null \
1026                        | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g'
1027                ) > tr_exrun_links
1028                (
1029                    cd "$dir/tr_run.$ex"
1030                        cat ../../tr_exrun_links | while read i ; do
1031                            if test ! "x$i" = x ; then
1032                                test ! -r $i  &&  ln -s "../"$ldir"/"$i $i
1033                            fi
1034                        done
1035                )
1036                test -e tr_exrun_links  &&  rm -f tr_exrun_links
1037                runmodel $dir/tr_run.$ex && run=Y \
1038                    && results=`testoutput $dir tr_run.$ex "."$ex`
1039                fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
1040                fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1041                fres="$fres.$ex"
1042                echo
1043                echo "$fres" >> $SUMMARY
1044                echo "fresults='$fres'" > $CDIR"/summary.txt"
1045                echo "MACH='$MACH'" >> $CDIR"/summary.txt"
1046                echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
1047                echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1048                echo "tdir='$dir'" >> $CDIR"/summary.txt"
1049            done
1050      else      else
1051          fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`          fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
1052          fres=$fres"$results   $dir"          fres=$fres"$results   $dir"
1053            echo
1054            echo "$fres" >> $SUMMARY
1055            echo "fresults='$fres'" > $CDIR"/summary.txt"
1056            echo "MACH='$MACH'" >> $CDIR"/summary.txt"
1057            echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
1058            echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1059            echo "tdir='$dir'" >> $CDIR"/summary.txt"
1060      fi      fi
1061      echo  
1062      echo "$fres" >> $SUMMARY      postclean $dir/$builddir
     echo "fresults='$fres'" > $CDIR"/summary.txt"  
     echo "MACH='$MACH'" >> $CDIR"/summary.txt"  
     echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"  
     echo "DATE='$DATE'" >> $CDIR"/summary.txt"  
     echo "tdir='$dir'" >> $CDIR"/summary.txt"  
1063            
1064      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
1065            
1066  done  done
1067    
1068  echo -n "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
1069  echo $start_date >> $SUMMARY  echo $start_date >> $SUMMARY
1070  echo -n "End time:    " >> $SUMMARY  printf "End time:    " >> $SUMMARY
1071  date >> $SUMMARY  date >> $SUMMARY
1072    
1073  #  If addresses were supplied and mpack built successfully, then try  #  If addresses were supplied and mpack built successfully, then try
# Line 855  else Line 1078  else
1078      if test "x$HAVE_MPACK" = xt ; then      if test "x$HAVE_MPACK" = xt ; then
1079          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \
1080              && gzip $DRESULTS".tar" \              && gzip $DRESULTS".tar" \
1081              && $MPACK -s MITgcm-test -m 1500000 $DRESULTS".tar.gz" $ADDRESSES              && $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES
1082          RETVAL=$?          RETVAL=$?
1083          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
1084              echo              echo
# Line 878  fi Line 1101  fi
1101  rm -f tmp_cmpnum.c tmp_cmpnum  rm -f tmp_cmpnum.c tmp_cmpnum
1102    
1103  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
1104      cat $SUMMARY      cat $SUMMARY | sed 's/ -- -- -- --//g'
1105      if test -e tr_out.txt ; then      if test -e tr_out.txt ; then
1106          mv tr_out.txt tr_out.txt.old          mv tr_out.txt tr_out.txt.old
1107      fi      fi
1108      cat $SUMMARY > tr_out.txt      cat $SUMMARY | sed 's/ -- -- -- --//g' > tr_out.txt
1109    fi
1110    
1111    if test "x$DELDIR" = xt ; then
1112        rm -rf $DRESULTS
1113  fi  fi
1114    

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.69

  ViewVC Help
Powered by ViewVC 1.1.22