/[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.23 by edhill, Sat Nov 29 01:45:25 2003 UTC revision 1.44 by edhill, Mon Jul 12 14:02:25 2004 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 22  usage() Line 22  usage()
22      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"
23      echo "                             Bourne-compatible \"sh\" shell"      echo "                             Bourne-compatible \"sh\" shell"
24      echo "                             (DEF=\"\" for \"bash\")"      echo "                             (DEF=\"\" for \"bash\")"
25        echo "  (-adm|-ad)               perform an adjoint run"
26      echo "  (-command) STRING        command to run"      echo "  (-command) STRING        command to run"
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 "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
31      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\""
32      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
33      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
34      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
35      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
36        echo "  (-deldir|-dd)            on success, delete the output directory"
37      echo      echo
38      echo "and where STRING follows a whitespace-delimited format"      echo "and where STRING follows a whitespace-delimited format"
39      echo "such as:"      echo "such as:"
# Line 43  usage() Line 46  usage()
46  #  build the mpack utility  #  build the mpack utility
47  build_mpack()  build_mpack()
48  {  {
49      echo -n "building the mpack utility...  "      printf "building the mpack utility...  "
50      if test ! -x "$MPACKDIR/mpack" ; then      if test ! -x "$MPACKDIR/mpack" ; then
51          if test ! -d $MPACKDIR ; then          if test ! -d $MPACKDIR ; then
52              echo              echo
# Line 53  build_mpack() Line 56  build_mpack()
56              echo              echo
57              HAVE_MPACK=f              HAVE_MPACK=f
58          fi          fi
59          echo -n "building mpack...  "          printf "building mpack...  "
60          ( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1          if test "x$CC" = x ; then
61                export CC=cc
62            fi
63            ( cd $MPACKDIR && ./configure && $MAKE ) > tr_build_mpack.out 2>&1
64          RETVAL=$?          RETVAL=$?
65          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
66              echo              echo
# Line 62  build_mpack() Line 68  build_mpack()
68              echo              echo
69              HAVE_MPACK=f              HAVE_MPACK=f
70          else          else
71                rm -f tr_build_mpack.out
72              HAVE_MPACK=t              HAVE_MPACK=t
73          fi          fi
74      else      else
# Line 72  build_mpack() Line 79  build_mpack()
79    
80  testoutput_for_prop()  testoutput_for_prop()
81  {  {
82      # testoutput_for_prop dir s1 label subdir      # testoutput_for_prop dir s1 label subdir extension
83      #      #
84      #  compares files in $dir/$subdir/output.txt and $dir/results/output.txt      #  compares files in $dir/$subdir/output.txt and $dir/results/output.txt
85      #  using search strings s1 and text label      #  using search strings s1 and text label
# Line 94  testoutput_for_prop() Line 101  testoutput_for_prop()
101          return 99          return 99
102      fi      fi
103      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
104          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
105      fi      fi
106      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
107      lncnt=`wc -l tmp2.txt | awk '{print $1}' `      lncnt=`wc -l tmp2.txt | awk '{print $1}' `
108      if [ $lncnt -lt 3 ]; then      if [ $lncnt -lt 3 ]; then
109          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
# Line 148  dashnum() Line 155  dashnum()
155      done      done
156  }  }
157    
158    testoutput_ad()
159    {
160        grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $5}' > t05.txt
161        grep $3 $1/$2/output.txt_adm | awk '{print NR " " $5}' > t15.txt
162        grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $6}' > t06.txt
163        grep $3 $1/$2/output.txt_adm | awk '{print NR " " $6}' > t16.txt
164        join t05.txt t15.txt > t5.txt
165        join t06.txt t16.txt > t6.txt
166        echo "-1" >> t5.txt
167        echo "-1" >> t6.txt
168        digits_5=`./tmp_cmpnum < t5.txt`
169        digits_6=`./tmp_cmpnum < t6.txt`
170        dashnum $digits_5 $digits_6
171        rm -f t[01][56].txt t[56].txt
172    }
173    
174  testoutput()  testoutput()
175  {  {
176      # testoutput diretory subdir      # testoutput directory subdir extension
177      #      #
178      #  test output in "directory"      #  test output in "directory"
179        if test "x$ADM" = x ; then
180      if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
181          echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2              echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2
182      fi          fi
183      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=$?
184      if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
185          echo testoutput: cg2dres=$cg2dres 1>&2              echo testoutput: cg2dres=$cg2dres 1>&2
186            fi
187            testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2 $3; tmin=$?
188            testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2 $3; tmax=$?
189            testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2 $3; tmean=$?
190            testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2 $3; tsd=$?
191            testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2 $3; smin=$?
192            testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2 $3; smax=$?
193            testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2 $3; smean=$?
194            testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2 $3; ssd=$?
195            testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2 $3; umin=$?
196            testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2 $3; umax=$?
197            testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2 $3; umean=$?
198            testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2 $3; usd=$?
199            testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2 $3; vmin=$?
200            testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2 $3; vmax=$?
201            testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2 $3; vmean=$?
202            testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2 $3; vsd=$?
203            dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \
204                $umin $umax $umean $usd $vmin $vmax $vmean $vsd
205        else
206            testoutput_ad $1 $2 "precision_grdchk_result"
207      fi      fi
     testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$?  
     testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$?  
     testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$?  
     testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2; tsd=$?  
     testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2; smin=$?  
     testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2; smax=$?  
     testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2; smean=$?  
     testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2; ssd=$?  
     testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2; umin=$?  
     testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2; umax=$?  
     testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2; umean=$?  
     testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2; usd=$?  
     testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2; vmin=$?  
     testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2; vmax=$?  
     testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2; vmean=$?  
     testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2; vsd=$?  
       
     dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \  
         $umin $umax $umean $usd $vmin $vmax $vmean $vsd  
208  }  }
209    
210  genmakemodel()  genmakemodel()
# Line 188  genmakemodel() Line 213  genmakemodel()
213      if test "x$NOGENMAKE" = xt ; then      if test "x$NOGENMAKE" = xt ; then
214          echo "genmake skipped!"          echo "genmake skipped!"
215      else      else
216          GENMAKE2="$BASH ../../../tools/genmake2"          if test "x$BASH" = x ; then
217                GENMAKE2="../../../tools/genmake2"
218            else
219                GENMAKE2="$BASH ../../../tools/genmake2 -bash $BASH"
220            fi
221          (          (
222              cd $1;              cd $1;
223              command="$GENMAKE2  -ds -m $MAKE --mods=../code"              command="$GENMAKE2  -ds -m $MAKE"
224                if test "x$ADM" = x ; then
225                    command="$command --mods=../code"
226                else
227                    command="$command --mods=../code_ad"
228                    command="$command -adof=../../../tools/adjoint_options/adjoint_staf"
229                fi
230              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
231                  command="$command --optfile=$OPTFILE"                  command="$command --optfile=$OPTFILE"
232              fi              fi
# Line 201  genmakemodel() Line 236  genmakemodel()
236              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
237              $command > make.log 2>&1              $command > make.log 2>&1
238              RETVAL=$?              RETVAL=$?
239              cp Makefile $CDIR              #  Reduce the size of the testing emails!
240                #  cp Makefile $CDIR
241              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
242                  tail make.log                  tail make.log
243                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed" 1>&2
# Line 272  makemodel() Line 308  makemodel()
308          cd $1;          cd $1;
309          if test -r Makefile ; then          if test -r Makefile ; then
310              printf 'make ... ' 1>&2              printf 'make ... ' 1>&2
311              $MAKE >> make.log 2>&1              if test "x$ADM" = x ; then
312                    if test "x$JOBS" = x ; then
313                        $MAKE >> make.log 2>&1
314                    else
315                        $MAKE -j $JOBS >> make.log 2>&1
316                    fi
317                else
318                    $MAKE adall >> make.log 2>&1
319                fi
320              RETVAL=$?              RETVAL=$?
321              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
322                  tail make.log                  tail make.log
# Line 286  makemodel() Line 330  makemodel()
330      )      )
331  }  }
332    
333    symlink_mpifiles()
334    {
335        # Put special links so that MPI specific files are used
336        # This MUST be invoked between makeclean and makelinks because
337        # the Makefile will link to non-mpi files by default
338    
339        dir=$1
340        code_dir=$2
341        BUILD_DIR=$dir/$3
342        CODE_DIR=$dir/$code_dir
343    
344        # These are files that should replace their counter-part when using -mpi
345        MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`
346    
347        #  Is this an MPI run?
348        if test "x$MPI" = xt ; then
349            # YES: We symbolically link these files to the build
350            # dir so long as there is no real file in place
351            for ii in $MPI_FILES ; do
352                i=`echo $ii | sed 's:^\./::'`
353                name=`echo $i | sed 's:_mpi::' `
354                cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1
355                RETVAL=$?
356                if test "x$RETVAL" != x0 ; then
357                    if ! test -f $BUILD_DIR/$i ; then
358                    #echo Linking $name to $i
359                        (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)
360                    fi
361                fi
362            done
363        else
364        # NO: We undo any _mpi symbolically linked files
365            for ii in $MPI_FILES ; do
366                i=`echo $ii | sed 's:^\./::'`
367                name=`echo $i | sed 's:_mpi::' `
368                if test -L $BUILD_DIR/$name ; then
369                    linktarg=`(cd $BUILD_DIR; readlink $name)`
370                    if test $linktarg = "../$code_dir/$name"_mpi ; then
371                    #echo Un-linking $name from $linktarg
372                        rm -f $BUILD_DIR/$name
373                    fi
374                fi
375            done
376        fi
377        
378    }
379    
380  linkdata()  linkdata()
381  {  {
382      # linkdata flag      # linkdata flag
# Line 294  linkdata() Line 385  linkdata()
385      if test "x$1" = x1 ; then      if test "x$1" = x1 ; then
386          (          (
387              cd $2              cd $2
388              files=`( cd ../input ; ls -1 | grep -v CVS )`              if test "x$ADM" = x ; then
389              for i in $files ; do                  files=`( cd ../input ; ls -1 | grep -v CVS )`
390                  if test ! -d "../input/"$i ; then                  for i in $files ; do
391                      ln -sf "../input/"$i $i                      if test ! -d "../input/"$i ; then
392                  fi                          ln -sf "../input/"$i $i
393              done                      fi
394                    done
395                else
396                    files=`( cd ../input ; ls -1 *.bin | grep -v CVS )`
397                    for i in $files ; do
398                        if test ! -d "../input/"$i ; then
399                            ln -sf "../input/"$i $i
400                        fi
401                    done
402                    files=`( cd ../input_ad ; ls -1 | grep -v CVS )`
403                    for i in $files ; do
404                        if test ! -d "../input_ad/"$i ; then
405                            ln -sf "../input_ad/"$i $i
406                        fi
407                    done
408                fi
409          )          )
410      fi      fi
411  }  }
# Line 308  runmodel() Line 414  runmodel()
414  {  {
415      # runmodel directory      # runmodel directory
416      #      #
417      #  runs "$COMMAND" in "directory"      #  runs "$COMMAND in "directory"
418      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
419      (      (
420          cd $1          cd $1
421          printf 'runmodel ... ' 1>&2          printf 'runmodel ... ' 1>&2
422          # make output.txt          # make output.txt
423          $COMMAND >> run.log 2>&1          echo
424            # echo "COMMAND='$COMMAND'"
425            # echo "pwd='"`pwd`"'"
426            ( eval $COMMAND ) >> run.log 2>&1
427          RETVAL=$?          RETVAL=$?
428          if test "x$RETVAL" = x0 ; then          if test "x$RETVAL" = x0 ; then
429              echo successful 1>&2              echo successful 1>&2
430              cp output.txt $CDIR"/output.txt"              # === Reduce the size of the testing emails!
431                # if test "x$ADM" = x ; then
432                #   cp output.txt $CDIR"/output.txt"
433                # else
434                #   cp output.txt_adm $CDIR"/output.txt_adm"
435                # fi
436              return 0              return 0
437          else          else
438              tail run.log              tail run.log
# Line 333  createcodelet() Line 447  createcodelet()
447  {  {
448      # create codelet for comparing model output      # create codelet for comparing model output
449    
450      echo -n "creating the comparison code...  "      printf "creating the comparison code...  "
451      cat > tmp_cmpnum.c <<EOF      cat > tmp_cmpnum.c <<EOF
452  #include <stdio.h>  #include <stdio.h>
453  #include <math.h>  #include <math.h>
454  int main( int argc, char** argv )  {  int main( int argc, char** argv )  {
455    int linnum,best;    int linnum,best,lncnt;
456    double a,b,diff;    double a,b,diff;
457    best = -16;    best = -16;
458    while( 1 )  {    lncnt = 0;
459      while( 1 & (lncnt+=1) < 999 )  {
460      scanf("%d", &linnum);      scanf("%d", &linnum);
461      if (linnum == -1)  break;      if (linnum == -1)  break;
462      scanf("%lf", &a);  scanf("%lf", &b);      scanf("%lf", &a);  scanf("%lf", &b);
# Line 357  int main( int argc, char** argv )  { Line 472  int main( int argc, char** argv )  {
472        }        }
473      }      }
474    }    }
475      if (lncnt == 999) best=-29;
476    printf("%d\n", -best);    printf("%d\n", -best);
477    return 0;    return 0;
478  }  }
# Line 437  clean=0 Line 553  clean=0
553  expts=''  expts=''
554  # ieee=1  # ieee=1
555    
556  IEEE=  IEEE=true
557  if test "x$MITGCM_IEEE" != x ; then  if test "x$MITGCM_IEEE" != x ; then
558      IEEE=$MITGCM_IEEE      IEEE=$MITGCM_IEEE
559  fi  fi
# Line 456  TESTDIRS= Line 572  TESTDIRS=
572  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
573  HAVE_MPACK=  HAVE_MPACK=
574  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
575  COMMAND="make output.txt"  COMMAND=
576  MAKE=make  MAKE=make
577    JOBS=
578  MPI=f  MPI=f
579    DELDIR=
580    
581    ADM=
582    
583  echo -n "parsing options...  "  printf "parsing options...  "
584    
585  ac_prev=  ac_prev=
586  for ac_option ; do  for ac_option ; do
# Line 509  for ac_option ; do Line 629  for ac_option ; do
629          -make=* | --make=*)          -make=* | --make=*)
630              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
631    
632            -j) ac_prev=JOBS ;;
633            -j=*) JOBS=$ac_optarg ;;
634    
635          -clean | --clean)          -clean | --clean)
636              CLEANUP=t ;;              CLEANUP=t ;;
637    
# Line 523  for ac_option ; do Line 646  for ac_option ; do
646    
647          -mpi) MPI=t ;;          -mpi) MPI=t ;;
648    
649            -adm | -ad) ADM=t ;;
650    
651          -ieee) IEEE=true ;;          -ieee) IEEE=true ;;
652          -noieee) IEEE= ;;          -noieee) IEEE= ;;
653    
# Line 530  for ac_option ; do Line 655  for ac_option ; do
655          -debug) debug=1 ;;          -debug) debug=1 ;;
656          -quiet) verbose=0 ;;          -quiet) verbose=0 ;;
657    
658            -deldir | -dd) DELDIR=t ;;
659    
660          -*)          -*)
661              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
662              usage              usage
# Line 558  if test "x$OPTFILE" = xNONE -a "x$MITGCM Line 685  if test "x$OPTFILE" = xNONE -a "x$MITGCM
685      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
686  fi  fi
687    
688    if test "x$ADM" = xt -a "x$COMMAND" = x ; then
689        COMMAND="./mitgcmuv_ad > output.txt_adm 2>&1"
690    fi
691    
692    if test "x$COMMAND" = x ; then
693        COMMAND="make output.txt"
694    fi
695    
696  echo "OK"  echo "OK"
697    
698  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
699  createcodelet  createcodelet
700    
701  #  build the mpack utility  #  build the mpack utility
702  build_mpack  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
703        echo "skipping mpack build"
704    else
705        build_mpack
706    fi
707    
708  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
709  MACH=`hostname`  MACH=`hostname`
710  UNAMEA=`uname -a`  UNAMEA=`uname -a`
711  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
712  BASE=$MACH"_"$DATE"_"  BASE="tr_"$MACH"_"$DATE"_"
713  DNUM=0  DNUM=0
714  DRESULTS="$BASE$DNUM"  DRESULTS="$BASE$DNUM"
715  while test -e $DRESULTS ; do  while test -e $DRESULTS ; do
# Line 584  if test "x$RETVAL" != x0 ; then Line 723  if test "x$RETVAL" != x0 ; then
723      exit 1      exit 1
724  fi  fi
725  SUMMARY="$DRESULTS/summary.txt"  SUMMARY="$DRESULTS/summary.txt"
726  echo -n "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
727  start_date=`date`  start_date=`date`
728  echo $start_date > $SUMMARY  echo $start_date > $SUMMARY
729    
# Line 615  else Line 754  else
754  fi  fi
755  echo  echo
756  echo >> $SUMMARY  echo >> $SUMMARY
757  cat << EOF | tee -a $SUMMARY  if test "x$ADM" = x ; then
758        cat << EOF | tee -a $SUMMARY
759                  T           S           U           V                  T           S           U           V
760  G D M    c        m  s        m  s        m  s        m  s  G D M    c        m  s        m  s        m  s        m  s
761  E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .  E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
# Line 623  N n k u  2  i  a  a  d  i  a  a  d  i  a Line 763  N n k u  2  i  a  a  d  i  a  a  d  i  a
763  2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .  2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .
764    
765  EOF  EOF
766    else
767        echo "ADJOINT=true" >> $SUMMARY
768        echo >> $SUMMARY
769        cat << EOF | tee -a $SUMMARY
770    G D M    C  G
771    E p a R  o  r
772    N n k u  s  a
773    2 d e n  t  d
774    
775    EOF
776    fi
777    
778  #  ...and each test directory...  #  ...and each test directory...
779  for dir in $TESTDIRS ; do  for dir in $TESTDIRS ; do
# Line 640  for dir in $TESTDIRS ; do Line 791  for dir in $TESTDIRS ; do
791    
792      #  Verify that the testdir exists and contains previous      #  Verify that the testdir exists and contains previous
793      #  results in the correct location--or skip this directory!      #  results in the correct location--or skip this directory!
794      if test ! -r $dir"/results/output.txt" ; then      fout=
795          echo "can't read \"$dir/results/output.txt\" -- skipping $dir"      if test "x$ADM" = x ; then
796            fout=$dir"/results/output.txt"
797        else
798            fout=$dir"/results_ad/output.txt_adm"
799        fi
800        if test ! -r $fout ; then
801            echo "can't read \"$fout\" -- skipping $dir"
802          continue          continue
803      fi      fi
804    
     echo "-------------------------------------------------------------------------------"  
     echo  
     echo "Experiment:  $dir"  
     echo  
     unset genmake makedepend make run  
     results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'  
   
805      builddir="input"      builddir="input"
806      rundir="input"      rundir="input"
807      use_seperate_build=0      use_seperate_build=0
# Line 662  for dir in $TESTDIRS ; do Line 812  for dir in $TESTDIRS ; do
812          linkdata $use_seperate_build $dir/$rundir          linkdata $use_seperate_build $dir/$rundir
813      fi      fi
814            
815      CODE_DIR=$dir/code      #  Check whether there are "extra runs" for this testdir
816      BUILD_DIR=$dir/$builddir      extra_runs=
817      MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi"      if test "x$ADM" = x -a "x$use_seperate_build" = x1 ; then
818      NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi"          ex_run_dirs=`( cd $dir ; echo input.* )`
819            echo "ex_run_dirs='$ex_run_dirs'"
820            for exd in $ex_run_dirs ; do
821                name=`echo $exd | sed -e 's/input.//g'`
822                outf="$dir/results/output.txt.$name"
823                if test -f $outf -a -r $outf ; then
824                    extra_runs="$extra_runs $name"
825                fi
826            done
827        fi
828    
829      #  Is this an MPI run?      if test "x$ADM" = x ; then
830      if test "x$MPI" = xt ; then          code_dir=code
831          FILES=$MPI_FILES          CODE_DIR=$dir/code
         endings="_mpi"  
832      else      else
833          FILES=$NOMPI_FILES          code_dir=code_ad
834          endings="_nompi"          CODE_DIR=$dir/code_ad
835      fi      fi
836            BUILD_DIR=$dir/$builddir
837      #  Check to see that we have the files  
838      have_files=t      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then
839      for i in $FILES ; do          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
         if test ! -r $CODE_DIR/$i ; then  
             echo "Warning: can't read file $CODE_DIR/$i"  
             have_files=f  
         fi  
     done  
     if test "x$have_files" != xt -a "x$MPI" = xt ; then  
         echo "Skipping $dir due to lack of input files (see above warning)"  
840          continue          continue
841      fi      fi
842        
843      #  If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR      echo "-------------------------------------------------------------------------------"
844      if test "x$have_files" = xt ; then      echo
845          for i in $FILES ; do      echo "Experiment:  $dir"
846              sstr="s|$endings||"      echo
847              name=`echo $i | sed -e $sstr `      unset genmake makedepend make run
848              cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
849              RETVAL=$?  
             if test "x$RETVAL" != x0 ; then  
                 cp $CODE_DIR/$i $BUILD_DIR/$name  
             fi  
         done  
     fi  
       
850      #  Create an output dir for each OPTFILE/tdir combination      #  Create an output dir for each OPTFILE/tdir combination
851      rel_CDIR=$DRESULTS"/"$dir      rel_CDIR=$DRESULTS"/"$dir
852      mkdir $rel_CDIR      mkdir $rel_CDIR
# Line 712  for dir in $TESTDIRS ; do Line 857  for dir in $TESTDIRS ; do
857      else      else
858          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
859              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
860                && symlink_mpifiles $dir $code_dir $builddir \
861              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
862              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
863              && linkdata $use_seperate_build $dir/$rundir \              && linkdata $use_seperate_build $dir/$rundir \
# Line 720  for dir in $TESTDIRS ; do Line 866  for dir in $TESTDIRS ; do
866      fi      fi
867            
868      echo      echo
869      fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`      if test "x$ADM" = x ; then
870      echo          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
871      echo "$fres" >> $SUMMARY          echo
872      echo "fresults='$fres'" > $CDIR"/summary.txt"          echo "$fres" >> $SUMMARY
873      echo "MACH='$MACH'" >> $CDIR"/summary.txt"          echo "fresults='$fres'" > $CDIR"/summary.txt"
874      echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"          echo "MACH='$MACH'" >> $CDIR"/summary.txt"
875      echo "DATE='$DATE'" >> $CDIR"/summary.txt"          echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
876      echo "tdir='$dir'" >> $CDIR"/summary.txt"          echo "DATE='$DATE'" >> $CDIR"/summary.txt"
877            echo "tdir='$dir'" >> $CDIR"/summary.txt"
878    
879            OLD_COMMAND=$COMMAND
880            COMMAND="./mitgcmuv > output.txt"
881            for ex in $extra_runs ; do
882                test -e "$dir/tr_run.$ex" && rm -rf "$dir/tr_run.$ex"
883                mkdir "$dir/tr_run.$ex"
884                links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )`
885                (
886                    cd "$dir/tr_run.$ex"
887                    for i in $links; do
888                        ln -s ../input/$i $i
889                    done
890                )
891                links=`( cd "$dir/input.$ex" > /dev/null 2>&1 ; ls -1 | grep -v CVS )`
892                (
893                    cd "$dir/tr_run.$ex"
894                    for i in $links; do
895                        test -e $i  &&  rm -f $i
896                        ln -s ../input.$ex/$i $i
897                    done
898                    ln -s ../$builddir/mitgcmuv mitgcmuv
899                )
900                runmodel $dir/tr_run.$ex && run=Y \
901                    && results=`testoutput $dir tr_run.$ex "."$ex`
902                fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
903                fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
904                fres="$fres.$ex"
905                echo
906                echo "$fres" >> $SUMMARY
907                echo "fresults='$fres'" > $CDIR"/summary.txt"
908                echo "MACH='$MACH'" >> $CDIR"/summary.txt"
909                echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
910                echo "DATE='$DATE'" >> $CDIR"/summary.txt"
911                echo "tdir='$dir'" >> $CDIR"/summary.txt"
912            done
913            COMMAND=$OLD_COMMAND
914        else
915            fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
916            fres=$fres"$results   $dir"
917            echo
918            echo "$fres" >> $SUMMARY
919            echo "fresults='$fres'" > $CDIR"/summary.txt"
920            echo "MACH='$MACH'" >> $CDIR"/summary.txt"
921            echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
922            echo "DATE='$DATE'" >> $CDIR"/summary.txt"
923            echo "tdir='$dir'" >> $CDIR"/summary.txt"
924        fi
925            
926      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
927            
928  done  done
929    
930  echo -n "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
931  echo $start_date >> $SUMMARY  echo $start_date >> $SUMMARY
932  echo -n "End time:    " >> $SUMMARY  printf "End time:    " >> $SUMMARY
933  date >> $SUMMARY  date >> $SUMMARY
934    
935  #  If addresses were supplied and mpack built successfully, then try  #  If addresses were supplied and mpack built successfully, then try
# Line 746  else Line 940  else
940      if test "x$HAVE_MPACK" = xt ; then      if test "x$HAVE_MPACK" = xt ; then
941          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \
942              && gzip $DRESULTS".tar" \              && gzip $DRESULTS".tar" \
943              && $MPACK -s MITgcm-test -m 1500000 $DRESULTS".tar.gz" $ADDRESSES              && $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES
944          RETVAL=$?          RETVAL=$?
945          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
946              echo              echo
# Line 770  rm -f tmp_cmpnum.c tmp_cmpnum Line 964  rm -f tmp_cmpnum.c tmp_cmpnum
964    
965  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
966      cat $SUMMARY      cat $SUMMARY
967      if test -e tr.out ; then      if test -e tr_out.txt ; then
968          mv tr.out tr.out.old          mv tr_out.txt tr_out.txt.old
969      fi      fi
970      cat $SUMMARY > tr.out      cat $SUMMARY > tr_out.txt
971    fi
972    
973    if test "x$DELDIR" = xt ; then
974        rm -rf $DRESULTS
975  fi  fi
976    

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.44

  ViewVC Help
Powered by ViewVC 1.1.22