/[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.127 by jmc, Thu Jun 4 23:40:53 2009 UTC revision 1.158 by jmc, Thu Jan 27 18:20:38 2011 UTC
# Line 12  usage() Line 12  usage()
12      echo "where possible OPTIONS are:"      echo "where possible OPTIONS are:"
13      echo "  (-help|-h)               print usage"      echo "  (-help|-h)               print usage"
14      echo "  (-mth)                   run multi-threaded (using eedata.mth)"      echo "  (-mth)                   run multi-threaded (using eedata.mth)"
15      echo "  (-mpi)                   compile and run using MPI"      echo "  (-mpi)                   use MPI to compile and run on 2 processors"
16      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"      echo "  (-MPI)  NUMBER           use MPI to compile and run on max NUMBER procs"
17        echo "  (-mfile|-mf) STRING      MPI: file with list of possible machines to run on"
18        echo "  (-ieee/-noieee)          if possible, use IEEE compiler flags"
19      echo "                             (DEF=\"-ieee\")"      echo "                             (DEF=\"-ieee\")"
20      echo "  (-gsl)                   compile with \"-gsl\" flag"      echo "  (-gsl)                   compile with \"-gsl\" flag"
21      echo "  (-of=|-optfile=)STRING   list of optfiles to use"      echo "  (-use_r4|-ur4)           if allowed, use real*4 type for '_RS' variable"
22      echo "  (-a|-addr) STRING        list of email recipients"      echo "  (-optfile|-of) STRING    list of optfiles to use"
23        echo "  (-addr|-a) STRING        list of email recipients"
24      echo "                             (DEF=\"\" no email is sent)"      echo "                             (DEF=\"\" no email is sent)"
25      echo "  (-mpd|-mpackdir) DIR     location of the mpack utility"      echo "  (-mpackdir|-mpd) DIR     location of the mpack utility"
26      echo "                             (DEF=\"../tools/mpack-1.6\")"      echo "                             (DEF=\"../tools/mpack-1.6\")"
27      echo "  (-t|-tdir) STRING        list of group and/or exp. dirs to test"      echo "  (-tdir|-t) STRING        list of group and/or exp. dirs to test"
28      echo "                             (recognized groups: basic, tutorials)"      echo "                             (recognized groups: basic, tutorials)"
29      echo "                             (DEF=\"\" which test all)"      echo "                             (DEF=\"\" which test all)"
30      echo "  (-skd|-skipdir) STRING   list of exp. dirs to skip"      echo "                             (if list= 'start_from THIS_EXP' then"
31        echo "                              test THIS_EXP + all the following)"
32        echo "  (-skipdir|-skd) STRING   list of exp. dirs to skip"
33      echo "                             (DEF=\"\" which test all)"      echo "                             (DEF=\"\" which test all)"
34      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"      echo "  (-bash|-b) STRING        preferred location of a \"bash\" or"
35      echo "                             Bourne-compatible \"sh\" shell"      echo "                             Bourne-compatible \"sh\" shell"
36      echo "                             (DEF=\"\" for \"bash\")"      echo "                             (DEF=\"\" for \"bash\")"
37      echo "  (-adm|-ad)               perform an adjoint run"      echo "  (-adm|-ad)               perform an adjoint run"
38      echo "  (-oad)                   perform an OpenAD adjoint run"      echo "  (-oad)                   perform an OpenAD adjoint run"
39      echo "  (-command) STRING        command to run"      echo "  (-command|-c) STRING     command to run"
40      echo "                             (DEF=\"make output.txt\")"      echo "  (-makedepend|-md) STRING command to use for \"makedepend\""
41      echo "  (-m|-make) STRING        command to use for \"make\""      echo "  (-make|-m) STRING        command to use for \"make\""
42      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
43      echo "  (-odir) STRING           used to build output directory name"      echo "  (-odir) STRING           used to build output directory name"
44      echo "                             (DEF=\"hostname\")"      echo "                             (DEF=\"hostname\")"
45      echo "  (-ptr|-ptracers) STRING  specify which ptracers to test"  #   echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"
46      echo "                             (DEF=\"1 2 3 4 5\")"  #   echo "                             (DEF=\"1 2 3 4 5\")"
47      echo "  (-match) NUMBER          Matching Criteria (number of digits)"      echo "  (-match) NUMBER          Matching Criteria (number of digits)"
48      echo "                             (DEF=\"12\")"      echo "                             (DEF=\"$MATCH_CRIT\")"
49      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
50      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\" & clean run-dir"
51        echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"
52        echo "  (-runonly|-ro)           *ONLY* run stage (=\"-quick\" without make)"
53      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
54      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
55      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
56      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
57        echo "  (-postclean|-pc)         after each exp. test, clean build-dir & run-dir"
58        echo "  (-deloutp|-do)           delete output files after successful run"
59      echo "  (-deldir|-dd)            on success, delete the output directory"      echo "  (-deldir|-dd)            on success, delete the output directory"
60      echo "  (-ts)                    provide timing information per timestep"      echo "  (-ts)                    provide timing information per timestep"
61      echo "  (-papis)                 provide MFlop/s per timestep using PAPI"      echo "  (-papis)                 provide MFlop/s per timestep using PAPI"
# Line 104  testoutput_var() Line 113  testoutput_var()
113  {  {
114      # testoutput_var dir s1 label subdir reference_output      # testoutput_var dir s1 label subdir reference_output
115      #      #
116      #  compares 1 variable output selected from file $dir/$subdir/$OUTPUTFILE      #  compares 1 variable output selected from file $dir/$subdir/$OUTPUTFILE
117      #     with same output from reference file $dir/results/$reference_output      #     with same output from reference file $dir/results/$reference_output
118      #  using search strings s1 and text label      #  using search strings s1 and text label
119    
# Line 176  testoutput_var() Line 185  testoutput_var()
185          fi          fi
186      fi      fi
187      rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt      rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt
188        
189      return $digits_of_similarity      return $digits_of_similarity
190  }  }
191    
# Line 229  testoutput_run() Line 238  testoutput_run()
238            listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"`            listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"`
239          fi          fi
240          if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(M)='$listVar'" 1>&2 ; fi          if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(M)='$listVar'" 1>&2 ; fi
241          echo "listVar='$listVar'" > $CDIR"/summary.txt"          echo "listVar='$listVar'" >> $locDIR"/summary.txt"
242            #---
243          allargs=""          allargs=""
244          for xx in $listVar          for xx in $listVar
245          do          do
# Line 264  testoutput_run() Line 274  testoutput_run()
274             testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3; yy=$? ;;             testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3; yy=$? ;;
275          'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`          'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`
276             testoutput_var $1 "trcstat_ptracer0"$ii"_sd"   "p0"$ii"_StDv"  $2 $3; yy=$? ;;             testoutput_var $1 "trcstat_ptracer0"$ii"_sd"   "p0"$ii"_StDv"  $2 $3; yy=$? ;;
277           'Qntmn') testoutput_var $1 "extforcing_qnet_min" "Qnet minimum"  $2 $3; yy=$? ;;           'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum"  $2 $3; yy=$? ;;
278           'Qntmx') testoutput_var $1 "extforcing_qnet_max" "Qnet maximum"  $2 $3; yy=$? ;;           'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum"  $2 $3; yy=$? ;;
279           'Qntav') testoutput_var $1 "extforcing_qnet_mean" "Qnet mean"    $2 $3; yy=$? ;;           'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean"       $2 $3; yy=$? ;;
280           'Qntsd') testoutput_var $1 "extforcing_qnet_sd"  "Qnet Std.Dev"  $2 $3; yy=$? ;;           'Qntsd') testoutput_var $1 "forcing_qnet_sd"  "Qnet Std.Dev"  $2 $3; yy=$? ;;
281           'aSImn') testoutput_var $1 "seaice_area_min"   "SIce Area min"   $2 $3; yy=$? ;;           'aSImn') testoutput_var $1 "seaice_area_min"   "SIce Area min"   $2 $3; yy=$? ;;
282           'aSImx') testoutput_var $1 "seaice_area_max"   "SIce Area max"   $2 $3; yy=$? ;;           'aSImx') testoutput_var $1 "seaice_area_max"   "SIce Area max"   $2 $3; yy=$? ;;
283           'aSIav') testoutput_var $1 "seaice_area_mean"  "SIce Area mean"  $2 $3; yy=$? ;;           'aSIav') testoutput_var $1 "seaice_area_mean"  "SIce Area mean"  $2 $3; yy=$? ;;
# Line 291  testoutput_run() Line 301  testoutput_run()
301          done          done
302    
303          nbVar=`echo $listVar | awk '{print NF}'`          nbVar=`echo $listVar | awk '{print NF}'`
304          if [ $nbVar -lt $LEN_CHECK_LIST ] ; then          if [ $nbVar -lt $LEN_CHECK_LIST ] ; then
305          #-- fill line (up to standard length) with dot:          #-- fill line (up to standard length) with dot:
306            adNul=`expr $LEN_CHECK_LIST - $nbVar | awk '{for(i=1;i<=$1;i++){print "."}}'`            adNul=`expr $LEN_CHECK_LIST - $nbVar | awk '{for(i=1;i<=$1;i++){print "."}}'`
307            echo $allargs $adNul            echo $allargs $adNul
308          else          else
309            echo $allargs            echo $allargs
310          fi          fi
311  # <-- same processing for adjoint & forward test  # <-- same processing for adjoint & forward test
312  }  }
313    
# Line 315  genmakemodel() Line 325  genmakemodel()
325          (          (
326              cd $1;              cd $1;
327              command="$GENMAKE2  -ds -m $MAKE"              command="$GENMAKE2  -ds -m $MAKE"
328                if test "x$MKDEPEND" != x ; then
329                    command="$command -makedepend=$MKDEPEND"
330                fi
331              if test "x$ADM" = xt ; then              if test "x$ADM" = xt ; then
332                  command="$command --mods=../code_ad"                  command="$command --mods=../code_ad"
333              elif test "x$OADM" = xt ; then              elif test "x$OADM" = xt ; then
# Line 331  genmakemodel() Line 344  genmakemodel()
344              if test "x$GSL" = xt ; then              if test "x$GSL" = xt ; then
345                  command="$command -gsl"                  command="$command -gsl"
346              fi              fi
347              if test "x$MPI" = xt ; then              if test "x$MPI" != x0 ; then
348                  command="$command -mpi"                  command="$command -mpi"
349              fi              fi
350              if test "x$MULTI_THREAD" = xt ; then              if test "x$MULTI_THREAD" = xt ; then
351              #- run multi-threaded using OpenMP:              #- run multi-threaded using OpenMP:
352                  command="$command -omp"                  command="$command -omp"
353              fi              fi
354                if test "x$USE_R4" = xt ; then
355                    command="$command -use_r4"
356                fi
357              if test "x$TS" = xt ; then              if test "x$TS" = xt ; then
358                  command="$command -ts"                  command="$command -ts"
359              fi              fi
360              if test "x$PAPIS" = xt ; then              if test "x$PAPIS" = xt ; then
361                  command="$command -papis"                  command="$command -papis"
362              else              else
363              if test "x$PCLS" = xt ; then              if test "x$PCLS" = xt ; then
364                  command="$command -pcls"                  command="$command -pcls"
365              fi              fi
366              fi              fi
367              printf 'genmake ... ' 1>&2              printf 'genmake ... '
368              # $command > make.log 2>&1              eval $command > genmake.tr_log 2>&1
             eval $command > make.log 2>&1  
369              RETVAL=$?              RETVAL=$?
370              #  Reduce the size of the testing emails!              #  Reduce the size of the testing emails!
371              head -100 Makefile > $CDIR/Makefile_head              head -100 Makefile > $CDIR/Makefile_head
372              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
373                  tail make.log                  tail genmake.tr_log
374                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed"
375                  cp genmake_* make.log $CDIR                  cp genmake.log genmake_* genmake.tr_log $CDIR
376                  return 1                  return 1
377              else              else
378                  echo "successful" 1>&2                  echo "successful"
379              fi              fi
380          )          )
381      fi      fi
# Line 369  genmakemodel() Line 384  genmakemodel()
384  makeclean()  makeclean()
385  {  {
386      # makeclean directory      # makeclean directory
387        if test "x$NODEPEND" = xf ; then rm -f $1/make.tr_log ; fi
388      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
389          echo "make Clean skipped!"          echo "make Clean skipped!"
390      else      else
# Line 376  makeclean() Line 392  makeclean()
392              cd $1;              cd $1;
393              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi
394              if test -r Makefile ; then              if test -r Makefile ; then
395                  printf 'clean build-dir: make Clean ... ' 2>&1                  printf 'clean build-dir: make Clean ... '
396                  $MAKE Clean >> make.log 2>&1                  $MAKE Clean >> make.tr_log 2>&1
397                  RETVAL=$?                  RETVAL=$?
398                  if test "x$RETVAL" != x0 ; then                  if test "x$RETVAL" != x0 ; then
399                      tail make.log                      tail make.tr_log
400                      echo "makeclean: \"make Clean\" failed" 1>&2                      echo "makeclean: \"make Clean\" failed"
401                      cp make.log $CDIR"/make.log"                      cp make.tr_log genmake.log genmake.tr_log $CDIR
402                      return 1                      return 1
403                  fi                  fi
404                  echo successful 1>&2                  echo successful
405              else              else
406                  echo ''                  echo ''
407              fi              fi
# Line 402  run_clean() Line 418  run_clean()
418      else      else
419          (          (
420              cd $1;              cd $1;
421              printf 'clean run-dir ... ' 2>&1              printf 'clean run-dir ... '
422              # part of what is done after "make clean" when doing "make CLEAN"              # part of what is done after "make clean" when doing "make CLEAN"
423              find . -name "*.meta" -exec rm {} \;              find . -name "*.meta" -exec rm {} \;
424              find . -name "*.data" -exec rm {} \;              find . -name "*.data" -exec rm {} \;
425              find . -name "fort.*" -exec rm {} \;              find . -name "fort.*" -exec rm {} \;
426              find . -type l -exec rm {} \;              find . -type l -exec rm {} \;
427              rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime              rm -f $EXECUTABLE $RUNLOG *.txt STD* *diagnostics.log datetime
428              rm -rf mnc_test_*              rm -rf mnc_test_*
429              rm -f *_MIT_CE_000.opt0000 costfunction*0000              rm -f *_MIT_CE_000.opt0000 costfunction*0000
430              echo successful 1>&2              echo successful
431              exit 0              exit 0
432          )          )
433      fi      fi
# Line 425  makedependmodel() Line 441  makedependmodel()
441      else      else
442          (          (
443              cd $1;              cd $1;
444              printf 'make depend ... ' 1>&2              printf 'make depend ... '
445              $MAKE depend >> make.log 2>&1              $MAKE depend >> make.tr_log 2>&1
446              RETVAL=$?              RETVAL=$?
447              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
448                  tail make.log                  tail make.tr_log
449                  echo "makedependmodel: make depend failed" 1>&2                  echo "makedependmodel: make depend failed"
450                  cp make.log $CDIR"/make.log"                  cp make.tr_log genmake.log genmake.tr_log $CDIR
451                  return 1                  return 1
452              else              else
453                  echo successful 1>&2                  echo successful
454              fi              fi
455          )          )
456      fi      fi
# Line 444  makemodel() Line 460  makemodel()
460  {  {
461      # makemodel directory      # makemodel directory
462      (      (
463        if test "x$NOMAKE" = xt ; then
464            cd $1;
465            if test -x $EXECUTABLE ; then
466                echo "make skipped!"
467            else
468                echo "no executable!"
469                return 2
470            fi
471        else
472          cd $1;          cd $1;
473          if test -r Makefile ; then          if test -r Makefile ; then
474              printf 'make ... ' 1>&2              printf 'make ... '
475              if test "x$ADM" = xt ; then              if test "x$ADM" = xt ; then
476                  $MAKE adall >> make.log 2>&1                  $MAKE adall >> make.tr_log 2>&1
477              elif test "x$OADM" = xt ; then              elif test "x$OADM" = xt ; then
478                  $MAKE adAll >> make.log 2>&1                  $MAKE adAll >> make.tr_log 2>&1
479              else              else
480                  if test "x$JOBS" = x ; then                  if test "x$JOBS" = x ; then
481                      $MAKE >> make.log 2>&1                      $MAKE >> make.tr_log 2>&1
482                  else                  else
483                      $MAKE -j $JOBS >> make.log 2>&1                      $MAKE -j $JOBS >> make.tr_log 2>&1
484                  fi                  fi
485              fi              fi
486              RETVAL=$?              RETVAL=$?
487              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
488                  tail make.log                  tail make.tr_log
489                  echo failed 1>&2                  echo failed
490                  cp make.log $CDIR"/make.log"                  cp make.tr_log genmake.log genmake.tr_log $CDIR
491                    rm -f $EXECUTABLE
492                  return 1                  return 1
493              else              else
494                  echo successful 1>&2                  echo successful
495              fi              fi
496          fi          fi
497        fi
498        if test "x$ADM" = xt -a -f taf_ad.log ; then
499                head -1 taf_ad.log >> $CDIR"/summary.txt"
500                nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log`
501                nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log`
502                echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \
503                                    >> $CDIR"/summary.txt"
504        fi
505      )      )
506  }  }
507    
508    mk_mpi_size()
509    {
510        # mk_mpi_size input_file output_file proc_Nb
511        #
512        # make new SIZE.h (=output_file) from SIZE.h_mpi (=input_file)
513        #     for an MPI build with no more than proc_Nb processors ;
514        # return the effective number of processors.
515    
516        inp=$1
517        out=$2
518        np=$3
519        tmp=TTT.$$
520    
521        px=`grep "^     & *nPx *=" $inp | sed "s/^     & *nPx *= *//" | sed 's/, *$//'`
522        py=`grep "^     & *nPy *=" $inp | sed "s/^     & *nPy *= *//" | sed 's/, *$//'`
523        sx=`grep "^     & *nSx *=" $inp | sed "s/^     & *nSx *= *//" | sed 's/, *$//'`
524        sy=`grep "^     & *nSy *=" $inp | sed "s/^     & *nSy *= *//" | sed 's/, *$//'`
525    
526        #- find the largest divisor of input_file proc Nb, but not larger than $np
527        pp=0
528        i=1
529        while [ $i -le $px ] ; do
530          if [ `expr $px % $i` -eq 0 ] ; then
531            j=1
532            while [ $j -le $py ] ; do
533              if [ `expr $py % $j` -eq 0 ] ; then
534                ij=`expr $i \* $j`
535                if [ $ij -gt $pp ] ; then
536                  if [ $ij -le $np ] ; then
537                    ix=$i ; jy=$j ; pp=$ij
538                    #echo "  ix,jy= $ix,$jy"
539                  fi
540                fi
541              fi
542              j=`expr $j + 1`
543            done
544          fi
545          i=`expr $i + 1`
546        done
547    
548        #- create new SIZE.h type file:
549        sx=`expr $sx \* $px / $ix`
550        sy=`expr $sy \* $py / $jy`
551        if [ $verbose -gt 1 ]; then
552            echo " px,py,np= $px,$py,$np : New MPI size: px,py= $ix,$jy : sx,sy= $sx,$sy"
553        fi
554        sed "/^     \& *nPx *=/s/[0-9]*,/$ix,/" $inp > $tmp
555        sed "/^     \& *nPy *=/s/[0-9]*,/$jy,/" $tmp > $out
556        sed "/^     \& *nSx *=/s/[0-9]*,/$sx,/" $out > $tmp
557        sed "/^     \& *nSy *=/s/[0-9]*,/$sy,/" $tmp > $out
558        rm -f $tmp
559        return $pp
560    }
561    
562  symlink_mpifiles()  symlink_mpifiles()
563  {  {
564      # Put special links so that MPI specific files are used      # Put special links so that MPI specific files are used
# Line 479  symlink_mpifiles() Line 567  symlink_mpifiles()
567    
568      dir=$1      dir=$1
569      code_dir=$2      code_dir=$2
570      BUILD_DIR=$dir/$3      build_dir=$dir/$3
571      CODE_DIR=$dir/$code_dir  
       
572      # These are files that should replace their counter-part when using -mpi      # These are files that should replace their counter-part when using -mpi
573      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)`      MPI_FILES=`(cd $dir/$code_dir; find . -name "*_mpi" -print)`
574    
575      #  Is this an MPI run?      for ii in $MPI_FILES ; do
576      if test "x$MPI" = xt ; then          i=`echo $ii | sed 's:^\./::'`
577          # YES: We symbolically link these files to the build          name=`echo $i | sed 's:_mpi::'`
578          # dir so long as there is no real file in place          file="../$code_dir/$i"
579          for ii in $MPI_FILES ; do          if test $name = 'SIZE.h' ; then file="SIZE.h.mpi" ; fi
580              i=`echo $ii | sed 's:^\./::'`  
581              name=`echo $i | sed 's:_mpi::' `          #  Is this an MPI run?
582              cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1          if test "x$MPI" = x0 ; then
583              RETVAL=$?              # NO: We undo any _mpi symbolically linked files
584              if test "x$RETVAL" != x0 ; then              if test -L $build_dir/$name ; then
585                  if ! test -f $BUILD_DIR/$i ; then                  ( cd $build_dir ; cmp $name $file > /dev/null 2>&1 )
                     #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  
         for ii in $MPI_FILES ; do  
             i=`echo $ii | sed 's:^\./::'`  
             name=`echo $i | sed 's:_mpi::' `  
             if test -L $BUILD_DIR/$name ; then  
                 cmp $BUILD_DIR/$name "../$code_dir/$name"_mpi > /dev/null 2>&1  
586                  RETVAL=$?                  RETVAL=$?
587                  if test "x$RETVAL" = x0 ; then                  if test "x$RETVAL" = x0 ; then
588                      #echo Un-linking $name from $linktarg                      if [ $verbose -gt 1 ]; then
589                      rm -f $BUILD_DIR/$name                          echo "  Un-linking $name from ../$code_dir" ; fi
590                        rm -f $build_dir/$name
591                  fi                  fi
592              fi              fi
593          done          else
594      fi              # YES: We symbolically link these files to the build
595                    # dir so long as there is no real file in place
596                ( cd $build_dir ; cmp $name $file > /dev/null 2>&1 )
597                RETVAL=$?
598                if [ $verbose -gt 1 ]; then echo "  cmp $name $file returns: $RETVAL" ; fi
599                if test "x$RETVAL" != x0 ; then
600                    if test -h $build_dir/$name ; then rm -f $build_dir/$name ; fi
601                    if test ! -r $build_dir/$name ; then
602                        if [ $verbose -gt 1 ]; then echo "  Linking $name to $file" ; fi
603                        (cd $build_dir; ln -sf $file $name)
604                    fi
605                fi
606            fi
607        done
608  }  }
609    
610  linkdata()  linkdata()
# Line 527  linkdata() Line 615  linkdata()
615      if test -d $1 ; then      if test -d $1 ; then
616          (          (
617              cd $1 ; shift              cd $1 ; shift
618                echo 'linkdata from dirs:' $*
619              inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')`              inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')`
620              for xx in $inpMPI ; do              for xx in $inpMPI ; do
621                if test -r "../"$1"/"$xx ; then                if test -r "../"$1"/"$xx ; then
622                  # found 1 _mpi sfx file in 1rst input dir and it is readable                  # found 1 _mpi sfx file in 1rst input dir and it is readable
623                  yy=`echo $xx | sed 's:\.mpi$::'`                  yy=`echo $xx | sed 's:\.mpi$::'`
624                  if test "x$MPI" = "xt" ; then                  if test "x$MPI" = "x0" ; then
625                  # mpi test: remove symbolic link & link _mpi sfx file                      # not mpi test: remove symbolic link
626                      if test -h $yy ; then rm -f $yy ; fi                      if test -h $yy ; then rm -f $yy ; fi
                     if test ! -r $yy ; then  
                         ln -sf "../"$1"/"$xx $yy ;  
                         printf "$xx " 1>&2  
                     fi  
627                  else                  else
628                  # not mpi test: remove symbolic link                      # mpi test: remove symbolic link & link .mpi sfx file
629                      if test -h $yy ; then rm -f $yy ; fi                      if test -h $yy ; then rm -f $yy ; fi
630                        if test ! -r $yy ; then
631                            ln -sf "../"$1"/"$xx $yy ;
632                            printf " $xx" 1>&2
633                        fi
634                  fi                  fi
635                fi                fi
636              done              done
# Line 550  linkdata() Line 639  linkdata()
639                  if test "x$MULTI_THREAD" = "xt" ; then                  if test "x$MULTI_THREAD" = "xt" ; then
640                  # multi-threaded test: remove symbolic link & link eedata.mth                  # multi-threaded test: remove symbolic link & link eedata.mth
641                      if test -h eedata ; then rm -f eedata ; fi                      if test -h eedata ; then rm -f eedata ; fi
642                      if test ! -r eedata ; then                      if test ! -r eedata ; then
643                          ln -sf "../"$1"/eedata.mth" eedata ;                          ln -sf "../"$1"/eedata.mth" eedata ;
644                          printf 'eedata.mth ' 1>&2                          printf ' eedata.mth' 1>&2
645                      fi                      fi
646                  else                  else
647                  # not multi-threaded test: remove eedata symbolic link                  # not multi-threaded test: remove eedata symbolic link
# Line 562  linkdata() Line 651  linkdata()
651              prevDir='NONE'              prevDir='NONE'
652              for ldir in $* ; do              for ldir in $* ; do
653                  if test -d "../"$ldir -a $ldir != $prevDir ; then                  if test -d "../"$ldir -a $ldir != $prevDir ; then
654                      printf 'ldir='${ldir} 1>&2                      printf " ldir=${ldir}:" 1>&2
655                      files=`( cd "../"$ldir ; ls -1 | grep -v CVS )`                      files=`( cd "../"$ldir ; ls -1 | grep -v CVS )`
656                      for i in $files ; do                      for i in $files ; do
657                          if test ! -d "../"$ldir/$i ; then                          if test ! -d "../"$ldir/$i ; then
# Line 572  linkdata() Line 661  linkdata()
661                              fi                              fi
662                          fi                          fi
663                      done                      done
664                        printf ' ;' 1>&2
665                      if test -x "../"$ldir"/"prepare_run ; then                      if test -x "../"$ldir"/"prepare_run ; then
666                          "../"$ldir"/"prepare_run                          "../"$ldir"/"prepare_run 1>&2
667                        else
668                            echo '' 1>&2
669                      fi                      fi
                     printf ' ; ' 1>&2  
670                  fi                  fi
671                  prevDir=$ldir                  prevDir=$ldir
672              done              done
# Line 587  runmodel() Line 678  runmodel()
678  {  {
679      # runmodel directory      # runmodel directory
680      #      #
681      #  runs "$COMMAND in "directory"      #  runs $COMMAND in "directory"
682      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
683      (      (
684          cd $1          cd $1
685          printf 'runmodel in %s ...' $1 1>&2          printf 'runmodel in %s ... ' $1
686          # make output.txt          if test "x$MPI" != x0 ; then
687          echo              #- adjust the MPI run command with the right number of Procs
688          if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then              #echo '' ; echo "  COMMAND='$COMMAND'"
689              diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"`
690              outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi              if test "x$MPI_MFILE" != x ; then
691                  COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`
692                fi
693                #echo "  COMMAND='$COMMAND'"
694            fi
695            if test -L $EXECUTABLE ; then
696              if test -x "../"$builddir"/"$EXECUTABLE ; then
697                cmp $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1
698                outD=$? ; if test "x$outD" != x0 ; then rm -f $EXECUTABLE ; fi
699              else rm -f $EXECUTABLE
700              fi
701          fi          fi
702          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
703              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp
704              ln -sf "../"$builddir"/"$EXECUTABLE .              ln -sf "../"$builddir"/"$EXECUTABLE .
705          fi          fi
706          if test ! -x $EXECUTABLE ; then          if test ! -x $EXECUTABLE ; then
707                  rm -f $RUNLOG ; touch $RUNLOG              rm -f $RUNLOG ; touch $RUNLOG
708                  if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi              if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
709                  echo " no executable:" $EXECUTABLE >> $RUNLOG              echo " no executable:" $EXECUTABLE >> $RUNLOG
710                  RETVAL=8              RETVAL=8
711                  ENDVAL=-1              ENDVAL=-1
712          else          else
713              if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then            if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then
714                # output do not exist or is older than executable:              # output do not exist or is older than executable:
715                  rm -f $RUNLOG ; touch $RUNLOG              rm -f $RUNLOG ; touch $RUNLOG
716                  if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi              if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
717                  ( eval $COMMAND ) >> $RUNLOG 2>&1              ( eval $COMMAND ) >> $RUNLOG 2>&1
718                  RETVAL=$?              RETVAL=$?
719              else              ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`
720                  RETVAL=0              if [ $POSTCLEAN -eq 1 -a $ENDVAL -gt 0 ] ; then
721                  if test -f $RUNLOG ; then                  find . -name "*.meta" -exec rm {} \;
722                      if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi                  find . -name "*.data" -exec rm {} \;
723                      echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1                  rm -rf mnc_test_*
                 else  
                     touch $RUNLOG  
                     if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi  
                     echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1  
                     echo " no previous $RUNLOG: assume NORMAL END" >> $RUNLOG 2>&1  
                 fi  
724              fi              fi
725              ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'`            else
726                RETVAL=0
727                ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`
728                touch $RUNLOG
729                if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
730                echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1
731              fi
732          fi          fi
733          rm -f run.log_tmp          rm -f run.log_tmp
734          #if test "x$RETVAL" = x0 ; then          #- in all cases where OutputFile exists, report SIZE (and AD time)
735            if test -f $OUTPUTFILE ; then
736              grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \
737                    | sed 's/(PID.TID 0000.0001)     //' >> $CDIR"/summary.txt"
738              if test "x$ADM" = xt ; then
739                grep -A3 'Seconds in section "ALL' $OUTPUTFILE >> $CDIR"/summary.txt"
740              fi
741            fi
742            if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
743          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
744              tail $RUNLOG              echo successful
745              echo successful 1>&2              printf '=> output from running in %s :\n' $1 1>&2
746              # === Reduce the size of the testing emails!              tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
747              #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE              return 0
748              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi          elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then
749                #-- for some weird cases (run is finihed but with error code)
750                echo 'finished with error (run:' $RETVAL ' end:' $ENDVAL ')'
751                printf '=> output from running in %s :\n' $1 1>&2
752                tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
753              return 0              return 0
754          else          else
755              tail $RUNLOG              echo 'failed (run:' $RETVAL ' end:' $ENDVAL ')'
756              echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2              printf '=> output from running in %s :\n' $1 1>&2
757                tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
758              cp $RUNLOG $CDIR"/"$RUNLOG              cp $RUNLOG $CDIR"/"$RUNLOG
             if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi  
759              return 1              return 1
760          fi          fi
761      )      )
# Line 692  EOF Line 805  EOF
805          return 0          return 0
806      else      else
807          echo          echo
808          echo "ERROR: failed to compile comparison code -- please specify"          echo "ERROR: failed to compile comparison code -- please specify"
809          echo "  a C compiler using the CC environment variable."          echo "  a C compiler using the CC environment variable."
810          exit 1          exit 1
811      fi      fi
# Line 711  formatresults() Line 824  formatresults()
824      printf '%3s' $listPrt      printf '%3s' $listPrt
825  #   line below does not work on hp-ux_ia64 : do those substitutions later on  #   line below does not work on hp-ux_ia64 : do those substitutions later on
826  #   printf '%3s' $listPrt | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</'  #   printf '%3s' $listPrt | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</'
827        
828      if [ $xx = '..' ]; then      if [ $xx = '..' ]; then
829          printf ' N/O '          printf ' N/O '
830      elif [ $xx = '--' ]; then      elif [ $xx = '--' ]; then
# Line 727  formatresults() Line 840  formatresults()
840      fi      fi
841      printf '  %s' $nm      printf '  %s' $nm
842      printf '\n'      printf '\n'
843        
844  }  }
845    
846  scandirs()  scandirs()
# Line 777  check_eedata() Line 890  check_eedata()
890  #  Default properties  #  Default properties
891  debug=0  debug=0
892  verbose=1  verbose=1
 clean=0  
893    
894  IEEE=true  IEEE=true
895  if test "x$MITGCM_IEEE" != x ; then  if test "x$MITGCM_IEEE" != x ; then
# Line 786  fi Line 898  fi
898  GSL=f  GSL=f
899    
900  CLEANUP=f  CLEANUP=f
901    NORUN=f
902  QUICK=f  QUICK=f
903    NOMAKE=f
904  NOGENMAKE=f  NOGENMAKE=f
905  NOCLEAN=f  NOCLEAN=f
906  NODEPEND=f  NODEPEND=f
907  POSTCLEAN=f  POSTCLEAN=0
908    
909  BASH=  BASH=
910  OPTFILE=NONE  OPTFILE=NONE
# Line 801  MPACKDIR="../tools/mpack-1.6" Line 915  MPACKDIR="../tools/mpack-1.6"
915  HAVE_MPACK=  HAVE_MPACK=
916  MPACK=  MPACK=
917  COMMAND=  COMMAND=
918    MKDEPEND=
919  if test "x$MAKE" = x ; then  if test "x$MAKE" = x ; then
920      MAKE=make      MAKE=make
921  fi  fi
# Line 808  if test "x$CC" = x ; then Line 923  if test "x$CC" = x ; then
923      CC=cc      CC=cc
924  fi  fi
925  JOBS=  JOBS=
926  MPI=f  MPI=0
927    MPI_MFILE=
928  MULTI_THREAD=f  MULTI_THREAD=f
929  OUTDIR=  OUTDIR=
930  DELDIR=  DELDIR=
931    USE_R4=
932    
933  ADM=  ADM=
934  OADM=  OADM=
# Line 819  OADM= Line 936  OADM=
936  # list of pTracers to check for monitor output  # list of pTracers to check for monitor output
937  PTRACERS_NUM="1 2 3 4 5"  PTRACERS_NUM="1 2 3 4 5"
938    
939  MATCH_CRIT=13  MATCH_CRIT=10
940    
941  printf "parsing options...  "  printf "parsing options...  "
942    
# Line 834  for ac_option ; do Line 951  for ac_option ; do
951      fi      fi
952    
953      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
954        
955      case $ac_option in      case $ac_option in
956                    
957          -help | --help | -h | --h)          -help | --help | -h | --h) usage ;;
958              usage ;;  
959                    -optfile | --optfile | -of | --of) ac_prev=OPTFILE ;;
960          -optfile | --optfile | -of | --of)          -optfile=* | --optfile=* | -of=* | --of=*) OPTFILE=$ac_optarg ;;
961              ac_prev=OPTFILE ;;  
962          -optfile=* | --optfile=* | -of=* | --of=*)          -addr | --addr | -a | --a) ac_prev=ADDRESSES ;;
963              OPTFILE=$ac_optarg ;;          -addr=* | --addr=* | -a=* | --a=*) ADDRESSES=$ac_optarg ;;
964                    -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;;
965          -addr | --addr | -a | --a)          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;;
966              ac_prev=ADDRESSES ;;  
967          -addr=* | --addr=*)          -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;;
968              ADDRESSES=$ac_optarg ;;          -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;;
969          -mpackdir | --mpackdir | -mpd | --mpd)          -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;;
970              ac_prev=MPACKDIR ;;          -skipdir=* | --skipdir=* | -skd=* | --skd=*) SKIPDIRS=$ac_optarg ;;
971          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*)  
972              MPACKDIR=$ac_optarg ;;          -bash | --bash | -b | --b) ac_prev=BASH ;;
973            -bash=* | --bash=* | -b=* | --b=*) BASH=$ac_optarg ;;
974          -tdir | --tdir | -t | --t)  
975              ac_prev=TESTDIRS ;;          -command | --command | -c | --c) ac_prev=COMMAND ;;
976          -tdir=* | --tdir=*)          -command=* | --command=* | -c=* | --c=*) COMMAND=$ac_optarg ;;
977              TESTDIRS=$ac_optarg ;;  
978            -makedepend | --makedepend | -md | --md) ac_prev=MKDEPEND ;;
979          -skipdir | --skipdir | -skd | --skd)          -makedepend=* | --makedepend=* | -md=* | --md=*) MKDEPEND=$ac_optarg ;;
980              ac_prev=SKIPDIRS ;;  
981          -skipdir=* | --skipdir=*)          -make | --make | -m | --m) ac_prev=MAKE ;;
982              SKIPDIRS=$ac_optarg ;;          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;
983    
984          -bash | --bash | -b | --b)          -odir | --odir) ac_prev=OUTDIR ;;
985              ac_prev=BASH ;;          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;
986          -bash=* | --bash=*)  
987              BASH=$ac_optarg ;;          -ptracers | --ptracers | -ptr | --ptr) ac_prev=PTRACERS_NUM ;;
988            -ptracers=* | --ptracers=* | -ptr=* | --ptr=*) PTRACERS_NUM=$ac_optarg ;;
         -command | --command | -c | --c)  
             ac_prev=COMMAND ;;  
         -command=* | --command=*)  
             COMMAND=$ac_optarg ;;  
   
         -make | --make | -m | --m)  
             ac_prev=MAKE ;;  
         -make=* | --make=*)  
             MAKE=$ac_optarg ;;  
   
         -odir | --odir)  
             ac_prev=OUTDIR ;;  
         -odir=* | --odir=*)  
             OUTDIR=$ac_optarg ;;  
   
         -ptracers | --ptracers | -ptr | --ptr)  
             ac_prev=PTRACERS_NUM ;;  
         -ptracers=* | --ptracers=* | -ptr=* | --ptr=*)  
             PTRACERS_NUM=$ac_optarg ;;  
989    
990          -match | --match ) ac_prev=MATCH_CRIT ;;          -match | --match ) ac_prev=MATCH_CRIT ;;
991          -match=* | --match=* ) MATCH_CRIT=$ac_optarg ;;          -match=* | --match=* ) MATCH_CRIT=$ac_optarg ;;
992    
993          -j) ac_prev=JOBS ;;          -j | --j) ac_prev=JOBS ;;
994          -j=*) JOBS=$ac_optarg ;;          -j=* | --j=*) JOBS=$ac_optarg ;;
   
         -clean | --clean)  
             CLEANUP=t ; DELDIR=t ;;  
995    
996          -quick | --quick | -q | --q)          -clean | --clean) CLEANUP=t ; DELDIR=t ;;
             QUICK=t ;;  
         -nogenmake | --nogenmake | -ng | --ng)  
             NOGENMAKE=t ;;  
         -noclean | --noclean | -nc | --nc)  
             NOCLEAN=t ;;  
         -nodepend | --nodepend | -nd | --nd)  
             NODEPEND=t ;;  
997    
998          -postclean | --postclean | -pc | --pc)          -norun | --norun | -nr | --nr) NORUN=t ;;
999              POSTCLEAN=t ;;          -runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;;
1000            -quick | --quick | -q | --q) QUICK=t ;;
1001            -nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;;
1002            -noclean | --noclean | -nc | --nc) NOCLEAN=t ;;
1003            -nodepend | --nodepend | -nd | --nd) NODEPEND=t ;;
1004    
1005            -postclean | --postclean | -pc | --pc) POSTCLEAN=2 ;;
1006            -deloutp | --deloutp | -do | --do) POSTCLEAN=1 ;;
1007    
1008            -mpi | --mpi) MPI=2 ;;
1009            -MPI | --MPI) ac_prev=MPI ;;
1010            -MPI=* | --MPI=*) MPI=$ac_optarg ;;
1011    
1012          -mpi) MPI=t ;;          -mfile | --mfile | -mf | --mf) ac_prev=MPI_MFILE ;;
1013            -mfile=* | --mfile=* | -mf=* | --mf=*) MPI_MFILE=$ac_optarg ;;
1014    
1015          -mth) MULTI_THREAD=t ;;          -mth) MULTI_THREAD=t ;;
1016    
1017          -adm | -ad) ADM=t ;;          -adm | -ad) ADM=t ;;
   
1018          -oad) OADM=t; NODEPEND=t ;;          -oad) OADM=t; NODEPEND=t ;;
1019    
1020          -ieee) IEEE=true ;;          -ieee) IEEE=true ;;
1021          -noieee) IEEE= ;;          -noieee) IEEE= ;;
1022          -gsl) GSL=t ;;          -gsl) GSL=t ;;
1023    
1024          -verbose) verbose=2 ;;          -verbose) verbose=2 ;;
1025          -debug) debug=1 ;;          -debug) debug=1 ;;
# Line 928  for ac_option ; do Line 1027  for ac_option ; do
1027    
1028          -deldir | -dd) DELDIR=t ;;          -deldir | -dd) DELDIR=t ;;
1029    
1030          -ts) TS=t;;          -use_r4|-ur4) USE_R4=t ;;
1031    
1032            -ts) TS=t;;
1033          -papis) PAPIS=t;;          -papis) PAPIS=t;;
   
1034          -pcls) PCL=t;;          -pcls) PCL=t;;
1035    
1036          -*)          -*) echo "Error: unrecognized option: "$ac_option
1037              echo "Error: unrecognized option: "$ac_option              usage ;;
1038              usage          *)  echo "Error: unrecognized argument: "$ac_option
1039              ;;              usage ;;
1040            
         *)  
             echo "Error: unrecognized argument: "$ac_option  
             usage  
             ;;  
           
1041       esac       esac
1042        
1043  done  done
1044    
1045  if test "x$QUICK" = xt ; then  if test "x$QUICK" = xt ; then
# Line 954  if test "x$QUICK" = xt ; then Line 1048  if test "x$QUICK" = xt ; then
1048      NODEPEND=t      NODEPEND=t
1049  fi  fi
1050    
1051    #- check length of MPI machine file:
1052    if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then
1053        if test -r $MPI_MFILE ; then
1054            nl=`wc -l $MPI_MFILE | awk '{print $1}'`
1055            if [ $nl -lt $MPI ] ; then
1056              echo "Error: need at least $MPI nodes (currently only $nl) in MPI_MFILE=$MPI_FILE"
1057              usage
1058            fi
1059            if [ $verbose -gt 1 ]; then
1060                echo " MPI_MFILE=$MPI_MFILE : $nl procs for MPI=$MPI run"
1061            fi
1062        else
1063              echo "Error: cannot access MPI_MFILE=$MPI_FILE"
1064              usage
1065        fi
1066    fi
1067    
1068  #- setting for forward or ADM testing  #- setting for forward or ADM testing
1069  if test "x$ADM" = xt ; then  if test "x$ADM" = xt ; then
1070      code_dir=code_ad      code_dir=code_ad
# Line 972  else Line 1083  else
1083      EXECUTABLE="mitgcmuv"      EXECUTABLE="mitgcmuv"
1084  fi  fi
1085    
1086    xx=`echo $TESTDIRS | awk '{print $1}'`
1087  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
1088      LIST=`scandirs results/$ref_outp`      LIST=`scandirs results/$ref_outp`
1089    elif test $xx = 'start_from' ; then
1090        xx=`echo $TESTDIRS | awk '{print $2}'`
1091        LIST=`scandirs results/$ref_outp | sed -n "/$xx/,$ p"`
1092  else  else
1093      #- expand group of experiments:      #- expand group of experiments:
1094      LIST=" "      LIST=" "
# Line 988  else Line 1103  else
1103                   LIST=${LIST}" "`ls | grep 'tutorial_'` ;;                   LIST=${LIST}" "`ls | grep 'tutorial_'` ;;
1104          *)       LIST=${LIST}" "$xx ;;          *)       LIST=${LIST}" "$xx ;;
1105        esac        esac
1106      done      done
1107  fi  fi
1108  #echo 'LIST='${LIST}'<'  #echo 'LIST='${LIST}'<'
1109  #- skip dirs, remove duplicate and non-directory:  #- skip dirs, remove duplicate and non-directory:
# Line 1009  do Line 1124  do
1124          else count=1 ; echo "" ;  echo -n " skip: \"$xx\""          else count=1 ; echo "" ;  echo -n " skip: \"$xx\""
1125          fi          fi
1126      fi      fi
1127  done  done
1128  if test $count = 1 ; then echo "" ; echo -n " ... " ; fi  if test $count = 1 ; then echo "" ; echo -n " ... " ; fi
1129  #echo 'TESTDIRS='${TESTDIRS}'<'  #echo 'TESTDIRS='${TESTDIRS}'<'
1130    
# Line 1017  if test "x$OPTFILE" = xNONE -a "x$MITGCM Line 1132  if test "x$OPTFILE" = xNONE -a "x$MITGCM
1132      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
1133  fi  fi
1134    
1135  RUNLOG="run.log"  LOC_MFILE='tr_mpi_mfile'
1136    RUNLOG="run.tr_log"
1137  OUTPUTFILE=$ref_outp  OUTPUTFILE=$ref_outp
1138  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
1139      COMMAND="./$EXECUTABLE > $OUTPUTFILE"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
1140  fi  fi
1141  if test "x$MPI" = xt ; then  if test "x$MPI" != x0 ; then
1142      OUTPUTFILE="STDOUT.0000"      OUTPUTFILE="STDOUT.0000"
1143  fi  fi
1144    
# Line 1045  else Line 1161  else
1161  fi  fi
1162    
1163  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
1164  createcodelet  if test -x tr_cmpnum ; then
1165        echo "skipping comparison code build"
1166    else
1167        createcodelet
1168    fi
1169    
1170  #  build the mpack utility (if ADDRESSES = NONE, do it to test the build)  #  build the mpack utility (if ADDRESSES = NONE, do it to test the build)
1171  if test "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = x ; then
# Line 1111  if test "x$OPTFILE" != xNONE ; then Line 1231  if test "x$OPTFILE" != xNONE ; then
1231      fi      fi
1232  else  else
1233      echo >> $SUMMARY      echo >> $SUMMARY
1234      echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY      echo "No \"OPTFILE\" was specified ; genmake2 found and uses:" >> $SUMMARY
1235      echo "   so the genmake default will be used." >> $SUMMARY      #-note: to be filled later after 1rst run
1236  fi  fi
1237  echo  echo
1238  echo >> $SUMMARY  echo >> $SUMMARY
1239  if test "x$ADM" = x -a "x$OADM" = x; then  if test "x$ADM" = x -a "x$OADM" = x; then
1240      if [ $MATCH_CRIT -lt 10 ] ;      if [ $MATCH_CRIT -lt 10 ] ;
1241      then line_0="default  "$MATCH_CRIT ;      then line_0="default  "$MATCH_CRIT ;
1242      else line_0="default "$MATCH_CRIT ; fi      else line_0="default "$MATCH_CRIT ; fi
1243         line_0="$line_0  ----T-----  ----S-----  ----U-----  ----V-----"         line_0="$line_0  ----T-----  ----S-----  ----U-----  ----V-----"
 #   line_0="            ----T-----  ----S-----  ----U-----  ----V-----"  
1244      line_1="G D M    c        m  s        m  s        m  s        m  s"      line_1="G D M    c        m  s        m  s        m  s        m  s"
1245      line_2="E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  ."      line_2="E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  ."
1246      line_3="N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d"      line_3="N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d"
# Line 1142  if test "x$ADM" = x -a "x$OADM" = x; the Line 1261  if test "x$ADM" = x -a "x$OADM" = x; the
1261  else  else
1262      echo "ADJOINT=true" >> $SUMMARY      echo "ADJOINT=true" >> $SUMMARY
1263      echo >> $SUMMARY      echo >> $SUMMARY
1264      if [ $MATCH_CRIT -lt 10 ] ;      if [ $MATCH_CRIT -lt 10 ] ;
1265      then line_0="default     "$MATCH_CRIT ;      then line_0="default     "$MATCH_CRIT ;
1266      else line_0="default    "$MATCH_CRIT ; fi      else line_0="default    "$MATCH_CRIT ; fi
1267      echo "$line_0" | tee -a $SUMMARY      echo "$line_0" | tee -a $SUMMARY
1268      cat << EOF | tee -a $SUMMARY      cat << EOF | tee -a $SUMMARY
# Line 1154  N n k u  s  a Line 1273  N n k u  s  a
1273    
1274  EOF  EOF
1275  fi  fi
1276    echo "-------------------------------------------------------------------------------"
1277    
1278  #  ...and each test directory...  #  ...and each test directory...
1279  for dir in $TESTDIRS ; do  for dir in $TESTDIRS ; do
1280        
1281      # set builddir & rundir:      # set builddir & rundir:
1282      builddir="build"      builddir="build"
1283      if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi      if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi
1284      rundir="run"      rundir="run"
1285        pfxdir="tr_$rundir"
1286      if test ! -d $dir/$rundir ; then      if test ! -d $dir/$rundir ; then
1287          rundir=$builddir          rundir=$builddir
1288      fi      fi
# Line 1172  for dir in $TESTDIRS ; do Line 1293  for dir in $TESTDIRS ; do
1293      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
1294          echo -n '  --- dir:' $BUILD_DIR ': '          echo -n '  --- dir:' $BUILD_DIR ': '
1295          makeclean $BUILD_DIR          makeclean $BUILD_DIR
1296            (   cd $BUILD_DIR
1297                rm -f $EXECUTABLE *.bak
1298                rm -f genmake_state genmake_*optfile genmake.log
1299                rm -f SIZE.h.mpi genmake.tr_log make.tr_log
1300            )
1301          if test -d $dir/$rundir/CVS ; then          if test -d $dir/$rundir/CVS ; then
1302              echo -n '  --- dir:' $dir/$rundir ': '              echo -n '  --- dir:' $dir/$rundir ': '
1303              run_clean $dir/$rundir              run_clean $dir/$rundir
1304          fi          fi
1305          trdir=`( cd $dir ; find . -type d -name "tr_run.*" -print | sed 's/^.\///')`          trdir=`( cd $dir ; find . -type d -name "$pfxdir.*" -print | sed 's/^.\///')`
1306          ttd=`echo $trdir | wc -w`          ttd=`echo $trdir | wc -w`
1307          if test $ttd != 0 ; then          if test $ttd != 0 ; then
1308              echo '  --- rm dir:' $trdir              echo '  --- rm dir:' $trdir
# Line 1185  for dir in $TESTDIRS ; do Line 1311  for dir in $TESTDIRS ; do
1311          continue          continue
1312      fi      fi
1313    
1314      #  Verify that the testdir exists and contains previous      #  Verify that the testdir exists and contains previous
1315      #  results in the correct location--or skip this directory!      #  results in the correct location--or skip this directory!
1316      fout=$dir"/results/"$ref_outp      fout=$dir"/results/"$ref_outp
1317      if test ! -r $fout ; then      if test ! -r $fout ; then
# Line 1195  for dir in $TESTDIRS ; do Line 1321  for dir in $TESTDIRS ; do
1321    
1322      # Check for specific files for particular type of run      # Check for specific files for particular type of run
1323    
1324      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then      if test "x$MPI" != "x0" ; then
1325          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          if test -r $CODE_DIR"/SIZE.h_mpi" ; then
1326          continue              #- create new SIZE.h with no more than '$MPI' Procs
1327                mk_mpi_size $CODE_DIR"/SIZE.h_mpi" $BUILD_DIR"/tr_size.mpi" $MPI
1328                LOC_NPROC=$?
1329                (   cd $BUILD_DIR
1330                    if test -r SIZE.h.mpi ; then
1331                        cmp tr_size.mpi SIZE.h.mpi > /dev/null 2>&1 ; RETVAL=$?
1332                    else RETVAL=1
1333                    fi
1334                    if test "x$RETVAL" = x0 ; then
1335                        rm -f tr_size.mpi
1336                    else
1337                        rm -f SIZE.h.mpi ; mv tr_size.mpi SIZE.h.mpi
1338                    fi
1339                )
1340            else
1341                echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
1342                continue
1343            fi
1344            if test "x$MPI_MFILE" != x ; then
1345                #- create new MPI machine-file with the right number of Procs
1346                rm -f $LOC_MFILE
1347                cat $MPI_MFILE | sort | uniq | head -$LOC_NPROC > $LOC_MFILE
1348                nl=`wc -l $LOC_MFILE | awk '{print $1}'`
1349                if [ $nl -lt $LOC_NPROC ] ; then
1350                    rm -f $LOC_MFILE
1351                    cat $MPI_MFILE | head -$LOC_NPROC > $LOC_MFILE
1352                    #sed -n "1,$LOC_NPROC p" $MPI_MFILE > $LOC_MFILE
1353                fi
1354                if [ $verbose -gt 1 ]; then
1355                    nl=`wc -l $LOC_MFILE | awk '{print $1}'`
1356                    echo " new LOC_MFILE=$LOC_MFILE : $nl procs for LOC_NPROC=$LOC_NPROC"
1357                fi
1358            fi
1359      fi      fi
1360      if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then      if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then
1361          echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"          echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"
1362          continue          continue
1363      fi      fi
1364      if test "x$MPI" = "xt" -a "x$MULTI_THREAD" = "xt" ; then      if test "x$MPI" != "x0" -a "x$MULTI_THREAD" = "xt" ; then
1365        retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/input/eedata.mth"`          retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/input/eedata.mth"`
1366        if test $retv != 0 ; then          if test $retv != 0 ; then
1367          echo "input/eedata.mth tiling misfit -- skipping $dir"              echo "input/eedata.mth tiling misfit -- skipping $dir"
1368          continue              continue
1369        fi          fi
1370      fi      fi
1371    
1372      #  Check whether there are "extra runs" for this testdir      #  Check whether there are "extra runs" for this testdir
1373      extra_runs=      extra_runs=
1374      ex_run_dirs=`( cd $dir ; echo $inputdir.* )`      if test "x$NORUN" = xf ; then
1375            ex_run_dirs=`( cd $dir ; echo $inputdir.* )`
1376        fi
1377      #echo "ex_run_dirs='$ex_run_dirs'"      #echo "ex_run_dirs='$ex_run_dirs'"
1378      for exd in $ex_run_dirs ; do      for exd in $ex_run_dirs ; do
1379          name=`echo $exd | sed -e "s/$inputdir\.//"`          name=`echo $exd | sed -e "s/$inputdir\.//"`
1380          refExOut=`echo $ref_outp | sed "s/\./.${name}./"`          refExOut=`echo $ref_outp | sed "s/\./.${name}./"`
1381          outf="$dir/results/$refExOut"          outf="$dir/results/$refExOut"
1382          if test -f $outf -a -r $outf ; then          if test -f $outf -a -r $outf ; then
1383            if test "x$MULTI_THREAD" = "xt" ; then            if test "x$MULTI_THREAD" = "xt" ; then
1384              if test -r $dir"/"$exd"/eedata.mth" ; then              if test -r $dir"/"$exd"/eedata.mth" ; then
1385                if test "x$MPI" = "xt" ; then                if test "x$MPI" = "x0" ; then
1386                  retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/"$exd"/eedata.mth"`                  extra_runs="$extra_runs $name"
1387                  else
1388                    retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/"$exd"/eedata.mth"`
1389                  if test $retv = 0 ; then                  if test $retv = 0 ; then
1390                      extra_runs="$extra_runs $name"                      extra_runs="$extra_runs $name"
1391                  else                  else
1392                      echo $exd"/eedata.mth tiling misfit -- skipping $dir"                      echo $exd"/eedata.mth tiling misfit -- skipping $dir"
1393                  fi                  fi
               else  
                 extra_runs="$extra_runs $name"  
1394                fi                fi
1395              #else echo $dir"/"$exd"/eedata.mth: not found"              #else echo $dir"/"$exd"/eedata.mth: not found"
1396              fi              fi
# Line 1240  for dir in $TESTDIRS ; do Line 1400  for dir in $TESTDIRS ; do
1400          fi          fi
1401      done      done
1402    
     echo "-------------------------------------------------------------------------------"  
1403      echo      echo
1404      if test "x$extra_runs" = "x" ; then      if test "x$extra_runs" = "x" ; then
1405         echo "Experiment:  $dir"         echo "Experiment:  $dir"
1406      else      else
1407         echo "Experiment:  $dir ; extra_runs=$extra_runs"         echo "Experiment:  $dir ; extra_runs=$extra_runs"
# Line 1251  for dir in $TESTDIRS ; do Line 1410  for dir in $TESTDIRS ; do
1410      unset genmake makedepend make run      unset genmake makedepend make run
1411      results=$EMPTY_RESULTS      results=$EMPTY_RESULTS
1412    
1413      #  Create an output dir for each OPTFILE/tdir combination      #  Create an output dir & summary.txt file for each tested experiment (tdir)
1414      rel_CDIR=$DRESULTS"/"$dir      locDIR=$DRESULTS"/"$dir
1415      mkdir $rel_CDIR      mkdir $locDIR
1416      CDIR=`pwd`"/$rel_CDIR"      #- report to this experiment local summary file ---
1417            echo "DATE='$DATE' ; tdir='$dir'" > $locDIR"/summary.txt"
1418      if test "x$CLEANUP" = xt ; then      echo "MACH='$MACH'" >> $locDIR"/summary.txt"
1419          echo '====>>> this is to check that we never go through this part <<< ==='      echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"
1420          makeclean $dir/$builddir \      CDIR=`pwd`"/$locDIR"
1421              && run_clean $dir/$rundir  
1422        if test "x$NORUN" = xt ; then
1423                run=N
1424            genmakemodel $dir/$builddir && genmake=Y \
1425                && makeclean $dir/$builddir \
1426                && symlink_mpifiles $dir $code_dir $builddir \
1427                && makedependmodel $dir/$builddir && makedepend=Y \
1428                && makemodel $dir/$builddir && make=Y
1429      else      else
1430          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
1431              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
             && run_clean $dir/$rundir \  
1432              && symlink_mpifiles $dir $code_dir $builddir \              && symlink_mpifiles $dir $code_dir $builddir \
1433              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
1434              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
1435              && linkdata $dir/$rundir $inputdir input \              && run_clean $dir/$rundir \
1436                && linkdata $dir/$rundir $inputdir \
1437              && runmodel $dir/$rundir && run=Y \              && runmodel $dir/$rundir && run=Y \
1438              && results=`testoutput_run $dir $rundir $ref_outp`              && results=`testoutput_run $dir $rundir $ref_outp`
1439      fi      fi
1440            #echo "results='$results'"
1441      echo  
1442          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1443          echo          echo 1>&2
1444          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1445          touch $CDIR"/summary.txt"          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
         echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $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"  
         if test "x$ADM" = xt ; then  
             head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt"  
             grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \  
                                 >> $CDIR"/summary.txt"  
         fi  
1446    
1447          for ex in $extra_runs ; do          for ex in $extra_runs ; do
1448              unset run              unset run
1449              results=$EMPTY_RESULTS              results=$EMPTY_RESULTS
1450              #  reference output file              #  reference output file
1451              refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"`              refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"`
1452              #  Create an output dir for each OPTFILE/tdir.ex combination              #  Create an output dir & summary.txt file for each extra run (tdir.ex)
1453              rel_CDIR=$DRESULTS"/"$dir"."$ex              locDIR=$DRESULTS"/"$dir"."$ex
1454              mkdir $rel_CDIR              mkdir $locDIR
1455              CDIR=`pwd`"/$rel_CDIR"              #- report to this experiment local summary file ---
1456              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"              echo "DATE='$DATE' ; tdir='$dir.$ex'" > $locDIR"/summary.txt"
1457              run_clean $dir/tr_run.$ex              #echo "MACH='$MACH'" >> $locDIR"/summary.txt"
1458              linkdata $dir/tr_run.$ex $inputdir.$ex $inputdir input              #echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"
1459              runmodel $dir/tr_run.$ex && run=Y \              CDIR=`pwd`"/$locDIR"
1460              && results=`testoutput_run $dir tr_run.$ex $refExOut`              test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex"
1461                run_clean $dir/$pfxdir.$ex
1462                linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir
1463                runmodel $dir/$pfxdir.$ex && run=Y \
1464                && results=`testoutput_run $dir $pfxdir.$ex $refExOut`
1465              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1466              fres="$fres.$ex"              fres="$fres.$ex"
1467              echo              echo 1>&2
1468              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1469              touch $CDIR"/summary.txt"              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
1470              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt"              if test "x$POSTCLEAN" = x2 ; then
1471              echo "MACH='$MACH'" >> $CDIR"/summary.txt"                  run_clean $dir/$pfxdir.$ex
             echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"  
             echo "DATE='$DATE'" >> $CDIR"/summary.txt"  
             echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt"  
             if test "x$ADM" = xt ; then  
                 head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt"  
                 grep -A3 'Seconds in section "ALL' $dir/tr_run.$ex/$OUTPUTFILE \  
                                    >> $CDIR"/summary.txt"  
             fi  
             if test "x$POSTCLEAN" = xt ; then  
                 run_clean $dir/tr_run.$ex  
1472              fi              fi
1473          done          done
1474    
1475        if test -f $DRESULTS"/"genmake_state ; then : ; else
1476            if test -f $dir/$builddir/Makefile ; then
1477                mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'`
1478                echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state
1479                sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state
1480                echo " $mkOpt" >> $DRESULTS/genmake_state
1481                if test "x$OPTFILE" = xNONE ; then
1482                    eval $mkOpt
1483                    sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\
1484                            $SUMMARY > tr_0.tmp_log
1485                    RETVAL=$?
1486                    if test "x$RETVAL" = x0 ; then rm -f $SUMMARY
1487                            cp tr_0.tmp_log $SUMMARY
1488                    else rm -f tr_0.tmp_log
1489                    fi
1490                fi
1491                gmkLog=$dir/$builddir/genmake.log
1492                grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1
1493                RETVAL=$?
1494                if test "x$RETVAL" = x0 ; then
1495                    echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state
1496                    sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \
1497                           | grep -v '^... compiler version ' > tr_1.tmp_log
1498                    sed -n '1,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \
1499                            >> $DRESULTS/genmake_state
1500                    rm -f tr_1.tmp_log
1501                fi
1502            fi
1503        fi
1504      #postclean $dir/$builddir      #postclean $dir/$builddir
1505      if test "x$POSTCLEAN" = xt ; then      if test "x$POSTCLEAN" = x2 ; then
1506          makeclean $dir/$builddir \          makeclean $dir/$builddir \
1507              && run_clean $dir/$rundir              && run_clean $dir/$rundir
1508      fi      fi
1509            if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then rm -f $LOC_MFILE ; fi
1510    
1511      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
1512        
1513  done  done
1514    
1515  printf "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
# Line 1358  else Line 1538  else
1538              echo "An email containing results was sent to the following addresses:"              echo "An email containing results was sent to the following addresses:"
1539              echo "  \"$ADDRESSES\""              echo "  \"$ADDRESSES\""
1540              echo              echo
1541                test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"
1542                test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"
1543          fi          fi
         test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"  
         test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"  
1544      fi      fi
1545  fi  fi
1546    
1547  rm -f tr_cmpnum.c tr_cmpnum  if test "x$QUICK" = xf -a "x$NORUN" = xf ; then
1548        rm -f tr_cmpnum.c tr_cmpnum
1549    fi
1550    
1551  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
1552      cat $SUMMARY | sed 's/ \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \. //'      cat $SUMMARY | sed 's/ \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \. //'

Legend:
Removed from v.1.127  
changed lines
  Added in v.1.158

  ViewVC Help
Powered by ViewVC 1.1.22