/[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.155 by jmc, Wed Jan 19 22:12:55 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 "  (-ieee/-noieee)          if possible, use IEEE compiler flags"
18      echo "                             (DEF=\"-ieee\")"      echo "                             (DEF=\"-ieee\")"
19      echo "  (-gsl)                   compile with \"-gsl\" flag"      echo "  (-gsl)                   compile with \"-gsl\" flag"
20      echo "  (-of=|-optfile=)STRING   list of optfiles to use"      echo "  (-use_r4|-ur4)           if allowed, use real*4 type for '_RS' variable"
21      echo "  (-a|-addr) STRING        list of email recipients"      echo "  (-optfile|-of) STRING    list of optfiles to use"
22        echo "  (-addr|-a) STRING        list of email recipients"
23      echo "                             (DEF=\"\" no email is sent)"      echo "                             (DEF=\"\" no email is sent)"
24      echo "  (-mpd|-mpackdir) DIR     location of the mpack utility"      echo "  (-mpackdir|-mpd) DIR     location of the mpack utility"
25      echo "                             (DEF=\"../tools/mpack-1.6\")"      echo "                             (DEF=\"../tools/mpack-1.6\")"
26      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"
27      echo "                             (recognized groups: basic, tutorials)"      echo "                             (recognized groups: basic, tutorials)"
28      echo "                             (DEF=\"\" which test all)"      echo "                             (DEF=\"\" which test all)"
29      echo "  (-skd|-skipdir) STRING   list of exp. dirs to skip"      echo "                             (if list= 'start_from THIS_EXP' then"
30        echo "                              test THIS_EXP + all the following)"
31        echo "  (-skipdir|-skd) STRING   list of exp. dirs to skip"
32      echo "                             (DEF=\"\" which test all)"      echo "                             (DEF=\"\" which test all)"
33      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"      echo "  (-bash|-b) STRING        preferred location of a \"bash\" or"
34      echo "                             Bourne-compatible \"sh\" shell"      echo "                             Bourne-compatible \"sh\" shell"
35      echo "                             (DEF=\"\" for \"bash\")"      echo "                             (DEF=\"\" for \"bash\")"
36      echo "  (-adm|-ad)               perform an adjoint run"      echo "  (-adm|-ad)               perform an adjoint run"
37      echo "  (-oad)                   perform an OpenAD adjoint run"      echo "  (-oad)                   perform an OpenAD adjoint run"
38      echo "  (-command) STRING        command to run"      echo "  (-command|-c) STRING     command to run"
39      echo "                             (DEF=\"make output.txt\")"      echo "  (-makedepend|-md) STRING command to use for \"makedepend\""
40      echo "  (-m|-make) STRING        command to use for \"make\""      echo "  (-make|-m) STRING        command to use for \"make\""
41      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
42      echo "  (-odir) STRING           used to build output directory name"      echo "  (-odir) STRING           used to build output directory name"
43      echo "                             (DEF=\"hostname\")"      echo "                             (DEF=\"hostname\")"
44      echo "  (-ptr|-ptracers) STRING  specify which ptracers to test"      echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"
45      echo "                             (DEF=\"1 2 3 4 5\")"      echo "                             (DEF=\"1 2 3 4 5\")"
46      echo "  (-match) NUMBER          Matching Criteria (number of digits)"      echo "  (-match) NUMBER          Matching Criteria (number of digits)"
47      echo "                             (DEF=\"12\")"      echo "                             (DEF=\"$MATCH_CRIT\")"
48      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
49      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\""
50        echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"
51        echo "  (-runonly|-ro)           *ONLY* run stage (=\"-quick\" without make)"
52      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
53      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
54      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
# Line 104  testoutput_var() Line 110  testoutput_var()
110  {  {
111      # testoutput_var dir s1 label subdir reference_output      # testoutput_var dir s1 label subdir reference_output
112      #      #
113      #  compares 1 variable output selected from file $dir/$subdir/$OUTPUTFILE      #  compares 1 variable output selected from file $dir/$subdir/$OUTPUTFILE
114      #     with same output from reference file $dir/results/$reference_output      #     with same output from reference file $dir/results/$reference_output
115      #  using search strings s1 and text label      #  using search strings s1 and text label
116    
# Line 176  testoutput_var() Line 182  testoutput_var()
182          fi          fi
183      fi      fi
184      rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt      rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt
185        
186      return $digits_of_similarity      return $digits_of_similarity
187  }  }
188    
# Line 229  testoutput_run() Line 235  testoutput_run()
235            listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"`            listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"`
236          fi          fi
237          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
238          echo "listVar='$listVar'" > $CDIR"/summary.txt"          #- report to this experiment local summary file ---
239            echo "MACH='$MACH'" > $locDIR"/summary.txt"
240            echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"
241            echo "DATE='$DATE'" >> $locDIR"/summary.txt"
242            grep '(PID\.TID 0000\.0001)      n.. =' $1/$2/$OUTPUTFILE \
243             | sed 's/(PID.TID 0000.0001)     //' >> $locDIR"/summary.txt"
244            echo "listVar='$listVar'" >> $locDIR"/summary.txt"
245            #---
246          allargs=""          allargs=""
247          for xx in $listVar          for xx in $listVar
248          do          do
# Line 264  testoutput_run() Line 277  testoutput_run()
277             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=$? ;;
278          '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/..$//'`
279             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=$? ;;
280           'Qntmn') testoutput_var $1 "extforcing_qnet_min" "Qnet minimum"  $2 $3; yy=$? ;;           'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum"  $2 $3; yy=$? ;;
281           'Qntmx') testoutput_var $1 "extforcing_qnet_max" "Qnet maximum"  $2 $3; yy=$? ;;           'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum"  $2 $3; yy=$? ;;
282           'Qntav') testoutput_var $1 "extforcing_qnet_mean" "Qnet mean"    $2 $3; yy=$? ;;           'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean"       $2 $3; yy=$? ;;
283           '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=$? ;;
284           '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=$? ;;
285           '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=$? ;;
286           '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 304  testoutput_run()
304          done          done
305    
306          nbVar=`echo $listVar | awk '{print NF}'`          nbVar=`echo $listVar | awk '{print NF}'`
307          if [ $nbVar -lt $LEN_CHECK_LIST ] ; then          if [ $nbVar -lt $LEN_CHECK_LIST ] ; then
308          #-- fill line (up to standard length) with dot:          #-- fill line (up to standard length) with dot:
309            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 "."}}'`
310            echo $allargs $adNul            echo $allargs $adNul
311          else          else
312            echo $allargs            echo $allargs
313          fi          fi
314  # <-- same processing for adjoint & forward test  # <-- same processing for adjoint & forward test
315  }  }
316    
# Line 315  genmakemodel() Line 328  genmakemodel()
328          (          (
329              cd $1;              cd $1;
330              command="$GENMAKE2  -ds -m $MAKE"              command="$GENMAKE2  -ds -m $MAKE"
331                if test "x$MKDEPEND" != x ; then
332                    command="$command -makedepend=$MKDEPEND"
333                fi
334              if test "x$ADM" = xt ; then              if test "x$ADM" = xt ; then
335                  command="$command --mods=../code_ad"                  command="$command --mods=../code_ad"
336              elif test "x$OADM" = xt ; then              elif test "x$OADM" = xt ; then
# Line 331  genmakemodel() Line 347  genmakemodel()
347              if test "x$GSL" = xt ; then              if test "x$GSL" = xt ; then
348                  command="$command -gsl"                  command="$command -gsl"
349              fi              fi
350              if test "x$MPI" = xt ; then              if test "x$MPI" != x0 ; then
351                  command="$command -mpi"                  command="$command -mpi"
352              fi              fi
353              if test "x$MULTI_THREAD" = xt ; then              if test "x$MULTI_THREAD" = xt ; then
354              #- run multi-threaded using OpenMP:              #- run multi-threaded using OpenMP:
355                  command="$command -omp"                  command="$command -omp"
356              fi              fi
357                if test "x$USE_R4" = xt ; then
358                    command="$command -use_r4"
359                fi
360              if test "x$TS" = xt ; then              if test "x$TS" = xt ; then
361                  command="$command -ts"                  command="$command -ts"
362              fi              fi
363              if test "x$PAPIS" = xt ; then              if test "x$PAPIS" = xt ; then
364                  command="$command -papis"                  command="$command -papis"
365              else              else
366              if test "x$PCLS" = xt ; then              if test "x$PCLS" = xt ; then
367                  command="$command -pcls"                  command="$command -pcls"
368              fi              fi
369              fi              fi
370              printf 'genmake ... ' 1>&2              printf 'genmake ... '
371              # $command > make.log 2>&1              eval $command > genmake.tr_log 2>&1
             eval $command > make.log 2>&1  
372              RETVAL=$?              RETVAL=$?
373              #  Reduce the size of the testing emails!              #  Reduce the size of the testing emails!
374              head -100 Makefile > $CDIR/Makefile_head              head -100 Makefile > $CDIR/Makefile_head
375              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
376                  tail make.log                  tail genmake.tr_log
377                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed"
378                  cp genmake_* make.log $CDIR                  cp genmake.log genmake_* genmake.tr_log $CDIR
379                  return 1                  return 1
380              else              else
381                  echo "successful" 1>&2                  echo "successful"
382              fi              fi
383          )          )
384      fi      fi
# Line 369  genmakemodel() Line 387  genmakemodel()
387  makeclean()  makeclean()
388  {  {
389      # makeclean directory      # makeclean directory
390        if test "x$NODEPEND" = xf ; then rm -f $1/make.tr_log ; fi
391      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
392          echo "make Clean skipped!"          echo "make Clean skipped!"
393      else      else
# Line 376  makeclean() Line 395  makeclean()
395              cd $1;              cd $1;
396              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi
397              if test -r Makefile ; then              if test -r Makefile ; then
398                  printf 'clean build-dir: make Clean ... ' 2>&1                  printf 'clean build-dir: make Clean ... '
399                  $MAKE Clean >> make.log 2>&1                  $MAKE Clean >> make.tr_log 2>&1
400                  RETVAL=$?                  RETVAL=$?
401                  if test "x$RETVAL" != x0 ; then                  if test "x$RETVAL" != x0 ; then
402                      tail make.log                      tail make.tr_log
403                      echo "makeclean: \"make Clean\" failed" 1>&2                      echo "makeclean: \"make Clean\" failed"
404                      cp make.log $CDIR"/make.log"                      cp make.tr_log genmake.log genmake.tr_log $CDIR
405                      return 1                      return 1
406                  fi                  fi
407                  echo successful 1>&2                  echo successful
408              else              else
409                  echo ''                  echo ''
410              fi              fi
# Line 402  run_clean() Line 421  run_clean()
421      else      else
422          (          (
423              cd $1;              cd $1;
424              printf 'clean run-dir ... ' 2>&1              printf 'clean run-dir ... '
425              # part of what is done after "make clean" when doing "make CLEAN"              # part of what is done after "make clean" when doing "make CLEAN"
426              find . -name "*.meta" -exec rm {} \;              find . -name "*.meta" -exec rm {} \;
427              find . -name "*.data" -exec rm {} \;              find . -name "*.data" -exec rm {} \;
428              find . -name "fort.*" -exec rm {} \;              find . -name "fort.*" -exec rm {} \;
429              find . -type l -exec rm {} \;              find . -type l -exec rm {} \;
430              rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime              rm -f $EXECUTABLE $RUNLOG *.txt STD* *diagnostics.log datetime
431              rm -rf mnc_test_*              rm -rf mnc_test_*
432              rm -f *_MIT_CE_000.opt0000 costfunction*0000              rm -f *_MIT_CE_000.opt0000 costfunction*0000
433              echo successful 1>&2              echo successful
434              exit 0              exit 0
435          )          )
436      fi      fi
# Line 425  makedependmodel() Line 444  makedependmodel()
444      else      else
445          (          (
446              cd $1;              cd $1;
447              printf 'make depend ... ' 1>&2              printf 'make depend ... '
448              $MAKE depend >> make.log 2>&1              $MAKE depend >> make.tr_log 2>&1
449              RETVAL=$?              RETVAL=$?
450              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
451                  tail make.log                  tail make.tr_log
452                  echo "makedependmodel: make depend failed" 1>&2                  echo "makedependmodel: make depend failed"
453                  cp make.log $CDIR"/make.log"                  cp make.tr_log genmake.log genmake.tr_log $CDIR
454                  return 1                  return 1
455              else              else
456                  echo successful 1>&2                  echo successful
457              fi              fi
458          )          )
459      fi      fi
# Line 444  makemodel() Line 463  makemodel()
463  {  {
464      # makemodel directory      # makemodel directory
465      (      (
466        if test "x$NOMAKE" = xt ; then
467            cd $1;
468            if test -x $EXECUTABLE ; then
469                echo "make skipped!"
470            else
471                echo "no executable!"
472                return 2
473            fi
474        else
475          cd $1;          cd $1;
476          if test -r Makefile ; then          if test -r Makefile ; then
477              printf 'make ... ' 1>&2              printf 'make ... '
478              if test "x$ADM" = xt ; then              if test "x$ADM" = xt ; then
479                  $MAKE adall >> make.log 2>&1                  $MAKE adall >> make.tr_log 2>&1
480              elif test "x$OADM" = xt ; then              elif test "x$OADM" = xt ; then
481                  $MAKE adAll >> make.log 2>&1                  $MAKE adAll >> make.tr_log 2>&1
482              else              else
483                  if test "x$JOBS" = x ; then                  if test "x$JOBS" = x ; then
484                      $MAKE >> make.log 2>&1                      $MAKE >> make.tr_log 2>&1
485                  else                  else
486                      $MAKE -j $JOBS >> make.log 2>&1                      $MAKE -j $JOBS >> make.tr_log 2>&1
487                  fi                  fi
488              fi              fi
489              RETVAL=$?              RETVAL=$?
490              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
491                  tail make.log                  tail make.tr_log
492                  echo failed 1>&2                  echo failed
493                  cp make.log $CDIR"/make.log"                  cp make.tr_log genmake.log genmake.tr_log $CDIR
494                    rm -f $EXECUTABLE
495                  return 1                  return 1
496              else              else
497                  echo successful 1>&2                  echo successful
498              fi              fi
499          fi          fi
500        fi
501      )      )
502  }  }
503    
504    mk_mpi_size()
505    {
506        # mk_mpi_size input_file output_file proc_Nb
507        #
508        # make new SIZE.h (=output_file) from SIZE.h_mpi (=input_file)
509        #     for an MPI build with no more than proc_Nb processors ;
510        # return the effective number of processors.
511    
512        inp=$1
513        out=$2
514        np=$3
515        tmp=TTT.$$
516    
517        px=`grep "^     & *nPx *=" $inp | sed "s/^     & *nPx *= *//" | sed 's/, *$//'`
518        py=`grep "^     & *nPy *=" $inp | sed "s/^     & *nPy *= *//" | sed 's/, *$//'`
519        sx=`grep "^     & *nSx *=" $inp | sed "s/^     & *nSx *= *//" | sed 's/, *$//'`
520        sy=`grep "^     & *nSy *=" $inp | sed "s/^     & *nSy *= *//" | sed 's/, *$//'`
521    
522        #- find the largest divisor of input_file proc Nb, but not larger than $np
523        pp=0
524        i=1
525        while [ $i -le $px ] ; do
526          if [ `expr $px % $i` -eq 0 ] ; then
527            j=1
528            while [ $j -le $py ] ; do
529              if [ `expr $py % $j` -eq 0 ] ; then
530                ij=`expr $i \* $j`
531                if [ $ij -gt $pp ] ; then
532                  if [ $ij -le $np ] ; then
533                    ix=$i ; jy=$j ; pp=$ij
534                    #echo "  ix,jy= $ix,$jy"
535                  fi
536                fi
537              fi
538              j=`expr $j + 1`
539            done
540          fi
541          i=`expr $i + 1`
542        done
543    
544        #- create new SIZE.h type file:
545        sx=`expr $sx \* $px / $ix`
546        sy=`expr $sy \* $py / $jy`
547        if [ $verbose -gt 1 ]; then
548            echo " px,py,np= $px,$py,$np : New MPI size: px,py= $ix,$jy : sx,sy= $sx,$sy"
549        fi
550        sed "/^     \& *nPx *=/s/[0-9]*,/$ix,/" $inp > $tmp
551        sed "/^     \& *nPy *=/s/[0-9]*,/$jy,/" $tmp > $out
552        sed "/^     \& *nSx *=/s/[0-9]*,/$sx,/" $out > $tmp
553        sed "/^     \& *nSy *=/s/[0-9]*,/$sy,/" $tmp > $out
554        rm -f $tmp
555        return $pp
556    }
557    
558  symlink_mpifiles()  symlink_mpifiles()
559  {  {
560      # 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 563  symlink_mpifiles()
563    
564      dir=$1      dir=$1
565      code_dir=$2      code_dir=$2
566      BUILD_DIR=$dir/$3      build_dir=$dir/$3
567      CODE_DIR=$dir/$code_dir  
       
568      # These are files that should replace their counter-part when using -mpi      # These are files that should replace their counter-part when using -mpi
569      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)`      MPI_FILES=`(cd $dir/$code_dir; find . -name "*_mpi" -print)`
570    
571      #  Is this an MPI run?      for ii in $MPI_FILES ; do
572      if test "x$MPI" = xt ; then          i=`echo $ii | sed 's:^\./::'`
573          # YES: We symbolically link these files to the build          name=`echo $i | sed 's:_mpi::'`
574          # dir so long as there is no real file in place          file="../$code_dir/$i"
575          for ii in $MPI_FILES ; do          if test $name = 'SIZE.h' ; then file="SIZE.h.mpi" ; fi
576              i=`echo $ii | sed 's:^\./::'`  
577              name=`echo $i | sed 's:_mpi::' `          #  Is this an MPI run?
578              cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1          if test "x$MPI" = x0 ; then
579              RETVAL=$?              # NO: We undo any _mpi symbolically linked files
580              if test "x$RETVAL" != x0 ; then              if test -L $build_dir/$name ; then
581                  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  
582                  RETVAL=$?                  RETVAL=$?
583                  if test "x$RETVAL" = x0 ; then                  if test "x$RETVAL" = x0 ; then
584                      #echo Un-linking $name from $linktarg                      if [ $verbose -gt 1 ]; then
585                      rm -f $BUILD_DIR/$name                          echo "  Un-linking $name from ../$code_dir" ; fi
586                        rm -f $build_dir/$name
587                  fi                  fi
588              fi              fi
589          done          else
590      fi              # YES: We symbolically link these files to the build
591                    # dir so long as there is no real file in place
592                ( cd $build_dir ; cmp $name $file > /dev/null 2>&1 )
593                RETVAL=$?
594                if [ $verbose -gt 1 ]; then echo "  cmp $name $file returns: $RETVAL" ; fi
595                if test "x$RETVAL" != x0 ; then
596                    if test -h $build_dir/$name ; then rm -f $build_dir/$name ; fi
597                    if test ! -r $build_dir/$name ; then
598                        if [ $verbose -gt 1 ]; then echo "  Linking $name to $file" ; fi
599                        (cd $build_dir; ln -sf $file $name)
600                    fi
601                fi
602            fi
603        done
604  }  }
605    
606  linkdata()  linkdata()
# Line 527  linkdata() Line 611  linkdata()
611      if test -d $1 ; then      if test -d $1 ; then
612          (          (
613              cd $1 ; shift              cd $1 ; shift
614                echo 'linkdata from dirs:' $*
615              inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')`              inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')`
616              for xx in $inpMPI ; do              for xx in $inpMPI ; do
617                if test -r "../"$1"/"$xx ; then                if test -r "../"$1"/"$xx ; then
618                  # 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
619                  yy=`echo $xx | sed 's:\.mpi$::'`                  yy=`echo $xx | sed 's:\.mpi$::'`
620                  if test "x$MPI" = "xt" ; then                  if test "x$MPI" = "x0" ; then
621                  # mpi test: remove symbolic link & link _mpi sfx file                      # not mpi test: remove symbolic link
622                      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  
623                  else                  else
624                  # not mpi test: remove symbolic link                      # mpi test: remove symbolic link & link .mpi sfx file
625                      if test -h $yy ; then rm -f $yy ; fi                      if test -h $yy ; then rm -f $yy ; fi
626                        if test ! -r $yy ; then
627                            ln -sf "../"$1"/"$xx $yy ;
628                            printf " $xx" 1>&2
629                        fi
630                  fi                  fi
631                fi                fi
632              done              done
# Line 550  linkdata() Line 635  linkdata()
635                  if test "x$MULTI_THREAD" = "xt" ; then                  if test "x$MULTI_THREAD" = "xt" ; then
636                  # multi-threaded test: remove symbolic link & link eedata.mth                  # multi-threaded test: remove symbolic link & link eedata.mth
637                      if test -h eedata ; then rm -f eedata ; fi                      if test -h eedata ; then rm -f eedata ; fi
638                      if test ! -r eedata ; then                      if test ! -r eedata ; then
639                          ln -sf "../"$1"/eedata.mth" eedata ;                          ln -sf "../"$1"/eedata.mth" eedata ;
640                          printf 'eedata.mth ' 1>&2                          printf ' eedata.mth' 1>&2
641                      fi                      fi
642                  else                  else
643                  # not multi-threaded test: remove eedata symbolic link                  # not multi-threaded test: remove eedata symbolic link
# Line 562  linkdata() Line 647  linkdata()
647              prevDir='NONE'              prevDir='NONE'
648              for ldir in $* ; do              for ldir in $* ; do
649                  if test -d "../"$ldir -a $ldir != $prevDir ; then                  if test -d "../"$ldir -a $ldir != $prevDir ; then
650                      printf 'ldir='${ldir} 1>&2                      printf " ldir=${ldir}:" 1>&2
651                      files=`( cd "../"$ldir ; ls -1 | grep -v CVS )`                      files=`( cd "../"$ldir ; ls -1 | grep -v CVS )`
652                      for i in $files ; do                      for i in $files ; do
653                          if test ! -d "../"$ldir/$i ; then                          if test ! -d "../"$ldir/$i ; then
# Line 572  linkdata() Line 657  linkdata()
657                              fi                              fi
658                          fi                          fi
659                      done                      done
660                        printf ' ;' 1>&2
661                      if test -x "../"$ldir"/"prepare_run ; then                      if test -x "../"$ldir"/"prepare_run ; then
662                          "../"$ldir"/"prepare_run                          "../"$ldir"/"prepare_run 1>&2
663                        else
664                            echo '' 1>&2
665                      fi                      fi
                     printf ' ; ' 1>&2  
666                  fi                  fi
667                  prevDir=$ldir                  prevDir=$ldir
668              done              done
# Line 587  runmodel() Line 674  runmodel()
674  {  {
675      # runmodel directory      # runmodel directory
676      #      #
677      #  runs "$COMMAND in "directory"      #  runs $COMMAND in "directory"
678      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
679      (      (
680          cd $1          cd $1
681          printf 'runmodel in %s ...' $1 1>&2          printf 'runmodel in %s ... ' $1
682          # make output.txt          if test -L $EXECUTABLE ; then
683          echo            if test -x "../"$builddir"/"$EXECUTABLE ; then
684          if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then              cmp $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1
685              diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1              outD=$? ; if test "x$outD" != x0 ; then rm -f $EXECUTABLE ; fi
686              outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi            else rm -f $EXECUTABLE
687              fi
688          fi          fi
689          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
690              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp
691              ln -sf "../"$builddir"/"$EXECUTABLE .              ln -sf "../"$builddir"/"$EXECUTABLE .
692          fi          fi
693            if test "x$MPI" != x0 ; then
694                #- adjust the MPI run command with the right number of Procs
695                #echo "COMMAND='$COMMAND'"
696                COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $NPROC_MPI /"`
697                #COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / $MFILE_MPI /"`
698                #echo "COMMAND='$COMMAND'"
699            fi
700          if test ! -x $EXECUTABLE ; then          if test ! -x $EXECUTABLE ; then
701                  rm -f $RUNLOG ; touch $RUNLOG                  rm -f $RUNLOG ; touch $RUNLOG
702                  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
# Line 620  runmodel() Line 715  runmodel()
715                  if test -f $RUNLOG ; then                  if test -f $RUNLOG ; then
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                      echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1                      echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1
718                  else                  else
719                      touch $RUNLOG                      touch $RUNLOG
720                      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
721                      echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1                      echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1
722                      echo " no previous $RUNLOG: assume NORMAL END" >> $RUNLOG 2>&1                      echo " no previous $RUNLOG: assume NORMAL END" >> $RUNLOG 2>&1
723                  fi                  fi
724              fi              fi
725              ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'`              #ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'`
726                ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`
727          fi          fi
728          rm -f run.log_tmp          rm -f run.log_tmp
         #if test "x$RETVAL" = x0 ; then  
729          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
730              tail $RUNLOG              echo successful
731              echo successful 1>&2              printf '=> output from running in %s :\n' $1 1>&2
732                tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
733              # === Reduce the size of the testing emails!              # === Reduce the size of the testing emails!
734              #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE              #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE
735              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
736              return 0              return 0
737            elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then
738                #-- for some weird cases (run is finihed but with error code)
739                echo 'finished with error (run:' $RETVAL ' end:' $ENDVAL ')'
740                printf '=> output from running in %s :\n' $1 1>&2
741                tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
742                return 0
743          else          else
744              tail $RUNLOG              echo 'failed (run:' $RETVAL ' end:' $ENDVAL ')'
745              echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2              printf '=> output from running in %s :\n' $1 1>&2
746                tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
747              cp $RUNLOG $CDIR"/"$RUNLOG              cp $RUNLOG $CDIR"/"$RUNLOG
748              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi              if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
749              return 1              return 1
# Line 692  EOF Line 795  EOF
795          return 0          return 0
796      else      else
797          echo          echo
798          echo "ERROR: failed to compile comparison code -- please specify"          echo "ERROR: failed to compile comparison code -- please specify"
799          echo "  a C compiler using the CC environment variable."          echo "  a C compiler using the CC environment variable."
800          exit 1          exit 1
801      fi      fi
# Line 711  formatresults() Line 814  formatresults()
814      printf '%3s' $listPrt      printf '%3s' $listPrt
815  #   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
816  #   printf '%3s' $listPrt | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</'  #   printf '%3s' $listPrt | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</'
817        
818      if [ $xx = '..' ]; then      if [ $xx = '..' ]; then
819          printf ' N/O '          printf ' N/O '
820      elif [ $xx = '--' ]; then      elif [ $xx = '--' ]; then
# Line 727  formatresults() Line 830  formatresults()
830      fi      fi
831      printf '  %s' $nm      printf '  %s' $nm
832      printf '\n'      printf '\n'
833        
834  }  }
835    
836  scandirs()  scandirs()
# Line 786  fi Line 889  fi
889  GSL=f  GSL=f
890    
891  CLEANUP=f  CLEANUP=f
892    NORUN=f
893  QUICK=f  QUICK=f
894    NOMAKE=f
895  NOGENMAKE=f  NOGENMAKE=f
896  NOCLEAN=f  NOCLEAN=f
897  NODEPEND=f  NODEPEND=f
# Line 801  MPACKDIR="../tools/mpack-1.6" Line 906  MPACKDIR="../tools/mpack-1.6"
906  HAVE_MPACK=  HAVE_MPACK=
907  MPACK=  MPACK=
908  COMMAND=  COMMAND=
909    MKDEPEND=
910  if test "x$MAKE" = x ; then  if test "x$MAKE" = x ; then
911      MAKE=make      MAKE=make
912  fi  fi
# Line 808  if test "x$CC" = x ; then Line 914  if test "x$CC" = x ; then
914      CC=cc      CC=cc
915  fi  fi
916  JOBS=  JOBS=
917  MPI=f  MPI=0
918  MULTI_THREAD=f  MULTI_THREAD=f
919  OUTDIR=  OUTDIR=
920  DELDIR=  DELDIR=
921    USE_R4=
922    
923  ADM=  ADM=
924  OADM=  OADM=
# Line 819  OADM= Line 926  OADM=
926  # list of pTracers to check for monitor output  # list of pTracers to check for monitor output
927  PTRACERS_NUM="1 2 3 4 5"  PTRACERS_NUM="1 2 3 4 5"
928    
929  MATCH_CRIT=13  MATCH_CRIT=10
930    
931  printf "parsing options...  "  printf "parsing options...  "
932    
# Line 834  for ac_option ; do Line 941  for ac_option ; do
941      fi      fi
942    
943      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
944        
945      case $ac_option in      case $ac_option in
946                    
947          -help | --help | -h | --h)          -help | --help | -h | --h)
# Line 847  for ac_option ; do Line 954  for ac_option ; do
954                    
955          -addr | --addr | -a | --a)          -addr | --addr | -a | --a)
956              ac_prev=ADDRESSES ;;              ac_prev=ADDRESSES ;;
957          -addr=* | --addr=*)          -addr=* | --addr=* | -a=* | --a=*)
958              ADDRESSES=$ac_optarg ;;              ADDRESSES=$ac_optarg ;;
959          -mpackdir | --mpackdir | -mpd | --mpd)          -mpackdir | --mpackdir | -mpd | --mpd)
960              ac_prev=MPACKDIR ;;              ac_prev=MPACKDIR ;;
# Line 856  for ac_option ; do Line 963  for ac_option ; do
963    
964          -tdir | --tdir | -t | --t)          -tdir | --tdir | -t | --t)
965              ac_prev=TESTDIRS ;;              ac_prev=TESTDIRS ;;
966          -tdir=* | --tdir=*)          -tdir=* | --tdir=* | -t=* | --t=*)
967              TESTDIRS=$ac_optarg ;;              TESTDIRS=$ac_optarg ;;
968    
969          -skipdir | --skipdir | -skd | --skd)          -skipdir | --skipdir | -skd | --skd)
970              ac_prev=SKIPDIRS ;;              ac_prev=SKIPDIRS ;;
971          -skipdir=* | --skipdir=*)          -skipdir=* | --skipdir=* | -skd=* | --skd=*)
972              SKIPDIRS=$ac_optarg ;;              SKIPDIRS=$ac_optarg ;;
973    
974          -bash | --bash | -b | --b)          -bash | --bash | -b | --b)
975              ac_prev=BASH ;;              ac_prev=BASH ;;
976          -bash=* | --bash=*)          -bash=* | --bash=* | -b=* | --b=*)
977              BASH=$ac_optarg ;;              BASH=$ac_optarg ;;
978    
979          -command | --command | -c | --c)          -command | --command | -c | --c)
980              ac_prev=COMMAND ;;              ac_prev=COMMAND ;;
981          -command=* | --command=*)          -command=* | --command=* | -c=* | --c=*)
982              COMMAND=$ac_optarg ;;              COMMAND=$ac_optarg ;;
983    
984            -makedepend | --makedepend | -md | --md)
985                ac_prev=MKDEPEND ;;
986            -makedepend=* | --makedepend=* | -md=* | --md=*)
987                MKDEPEND=$ac_optarg ;;
988    
989          -make | --make | -m | --m)          -make | --make | -m | --m)
990              ac_prev=MAKE ;;              ac_prev=MAKE ;;
991          -make=* | --make=*)          -make=* | --make=* | -m=* | --m=*)
992              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
993    
994          -odir | --odir)          -odir | --odir)
# Line 892  for ac_option ; do Line 1004  for ac_option ; do
1004          -match | --match ) ac_prev=MATCH_CRIT ;;          -match | --match ) ac_prev=MATCH_CRIT ;;
1005          -match=* | --match=* ) MATCH_CRIT=$ac_optarg ;;          -match=* | --match=* ) MATCH_CRIT=$ac_optarg ;;
1006    
1007          -j) ac_prev=JOBS ;;          -j | --j) ac_prev=JOBS ;;
1008          -j=*) JOBS=$ac_optarg ;;          -j=* | --j=*) JOBS=$ac_optarg ;;
1009    
1010          -clean | --clean)          -clean | --clean)
1011              CLEANUP=t ; DELDIR=t ;;              CLEANUP=t ; DELDIR=t ;;
1012    
1013            -norun | --norun | -nr | --nr)
1014                NORUN=t ;;
1015            -runonly | --runonly | -ro | --ro)
1016                QUICK=t ; NOMAKE=t ;;
1017          -quick | --quick | -q | --q)          -quick | --quick | -q | --q)
1018              QUICK=t ;;              QUICK=t ;;
1019          -nogenmake | --nogenmake | -ng | --ng)          -nogenmake | --nogenmake | -ng | --ng)
# Line 910  for ac_option ; do Line 1026  for ac_option ; do
1026          -postclean | --postclean | -pc | --pc)          -postclean | --postclean | -pc | --pc)
1027              POSTCLEAN=t ;;              POSTCLEAN=t ;;
1028    
1029          -mpi) MPI=t ;;          -mpi | --mpi) MPI=2 ;;
1030            -MPI | --MPI) ac_prev=MPI ;;
1031            -MPI=* | --MPI=*) MPI=$ac_optarg ;;
1032    
1033          -mth) MULTI_THREAD=t ;;          -mth) MULTI_THREAD=t ;;
1034    
# Line 928  for ac_option ; do Line 1046  for ac_option ; do
1046    
1047          -deldir | -dd) DELDIR=t ;;          -deldir | -dd) DELDIR=t ;;
1048    
1049          -ts) TS=t;;          -use_r4|-ur4) USE_R4=t ;;
1050    
1051            -ts) TS=t;;
1052          -papis) PAPIS=t;;          -papis) PAPIS=t;;
   
1053          -pcls) PCL=t;;          -pcls) PCL=t;;
1054    
1055          -*)          -*)
1056              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
1057              usage              usage
1058              ;;              ;;
1059            
1060          *)          *)
1061              echo "Error: unrecognized argument: "$ac_option              echo "Error: unrecognized argument: "$ac_option
1062              usage              usage
1063              ;;              ;;
1064            
1065       esac       esac
1066        
1067  done  done
1068    
1069  if test "x$QUICK" = xt ; then  if test "x$QUICK" = xt ; then
# Line 972  else Line 1090  else
1090      EXECUTABLE="mitgcmuv"      EXECUTABLE="mitgcmuv"
1091  fi  fi
1092    
1093    xx=`echo $TESTDIRS | awk '{print $1}'`
1094  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
1095      LIST=`scandirs results/$ref_outp`      LIST=`scandirs results/$ref_outp`
1096    elif test $xx = 'start_from' ; then
1097        xx=`echo $TESTDIRS | awk '{print $2}'`
1098        LIST=`scandirs results/$ref_outp | sed -n "/$xx/,$ p"`
1099  else  else
1100      #- expand group of experiments:      #- expand group of experiments:
1101      LIST=" "      LIST=" "
# Line 988  else Line 1110  else
1110                   LIST=${LIST}" "`ls | grep 'tutorial_'` ;;                   LIST=${LIST}" "`ls | grep 'tutorial_'` ;;
1111          *)       LIST=${LIST}" "$xx ;;          *)       LIST=${LIST}" "$xx ;;
1112        esac        esac
1113      done      done
1114  fi  fi
1115  #echo 'LIST='${LIST}'<'  #echo 'LIST='${LIST}'<'
1116  #- skip dirs, remove duplicate and non-directory:  #- skip dirs, remove duplicate and non-directory:
# Line 1009  do Line 1131  do
1131          else count=1 ; echo "" ;  echo -n " skip: \"$xx\""          else count=1 ; echo "" ;  echo -n " skip: \"$xx\""
1132          fi          fi
1133      fi      fi
1134  done  done
1135  if test $count = 1 ; then echo "" ; echo -n " ... " ; fi  if test $count = 1 ; then echo "" ; echo -n " ... " ; fi
1136  #echo 'TESTDIRS='${TESTDIRS}'<'  #echo 'TESTDIRS='${TESTDIRS}'<'
1137    
# Line 1017  if test "x$OPTFILE" = xNONE -a "x$MITGCM Line 1139  if test "x$OPTFILE" = xNONE -a "x$MITGCM
1139      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
1140  fi  fi
1141    
1142  RUNLOG="run.log"  RUNLOG="run.tr_log"
1143  OUTPUTFILE=$ref_outp  OUTPUTFILE=$ref_outp
1144  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
1145      COMMAND="./$EXECUTABLE > $OUTPUTFILE"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
1146  fi  fi
1147  if test "x$MPI" = xt ; then  if test "x$MPI" != x0 ; then
1148      OUTPUTFILE="STDOUT.0000"      OUTPUTFILE="STDOUT.0000"
1149  fi  fi
1150    
# Line 1045  else Line 1167  else
1167  fi  fi
1168    
1169  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
1170  createcodelet  if test -x tr_cmpnum ; then
1171        echo "skipping comparison code build"
1172    else
1173        createcodelet
1174    fi
1175    
1176  #  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)
1177  if test "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = x ; then
# Line 1111  if test "x$OPTFILE" != xNONE ; then Line 1237  if test "x$OPTFILE" != xNONE ; then
1237      fi      fi
1238  else  else
1239      echo >> $SUMMARY      echo >> $SUMMARY
1240      echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY      echo "No \"OPTFILE\" was specified ; genmake2 found and uses:" >> $SUMMARY
1241      echo "   so the genmake default will be used." >> $SUMMARY      #-note: to be filled later after 1rst run
1242  fi  fi
1243  echo  echo
1244  echo >> $SUMMARY  echo >> $SUMMARY
1245  if test "x$ADM" = x -a "x$OADM" = x; then  if test "x$ADM" = x -a "x$OADM" = x; then
1246      if [ $MATCH_CRIT -lt 10 ] ;      if [ $MATCH_CRIT -lt 10 ] ;
1247      then line_0="default  "$MATCH_CRIT ;      then line_0="default  "$MATCH_CRIT ;
1248      else line_0="default "$MATCH_CRIT ; fi      else line_0="default "$MATCH_CRIT ; fi
1249         line_0="$line_0  ----T-----  ----S-----  ----U-----  ----V-----"         line_0="$line_0  ----T-----  ----S-----  ----U-----  ----V-----"
 #   line_0="            ----T-----  ----S-----  ----U-----  ----V-----"  
1250      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"
1251      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  ."
1252      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 1267  if test "x$ADM" = x -a "x$OADM" = x; the
1267  else  else
1268      echo "ADJOINT=true" >> $SUMMARY      echo "ADJOINT=true" >> $SUMMARY
1269      echo >> $SUMMARY      echo >> $SUMMARY
1270      if [ $MATCH_CRIT -lt 10 ] ;      if [ $MATCH_CRIT -lt 10 ] ;
1271      then line_0="default     "$MATCH_CRIT ;      then line_0="default     "$MATCH_CRIT ;
1272      else line_0="default    "$MATCH_CRIT ; fi      else line_0="default    "$MATCH_CRIT ; fi
1273      echo "$line_0" | tee -a $SUMMARY      echo "$line_0" | tee -a $SUMMARY
1274      cat << EOF | tee -a $SUMMARY      cat << EOF | tee -a $SUMMARY
# Line 1154  N n k u  s  a Line 1279  N n k u  s  a
1279    
1280  EOF  EOF
1281  fi  fi
1282    echo "-------------------------------------------------------------------------------"
1283    
1284  #  ...and each test directory...  #  ...and each test directory...
1285  for dir in $TESTDIRS ; do  for dir in $TESTDIRS ; do
1286        
1287      # set builddir & rundir:      # set builddir & rundir:
1288      builddir="build"      builddir="build"
1289      if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi      if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi
1290      rundir="run"      rundir="run"
1291        pfxdir="tr_$rundir"
1292      if test ! -d $dir/$rundir ; then      if test ! -d $dir/$rundir ; then
1293          rundir=$builddir          rundir=$builddir
1294      fi      fi
# Line 1172  for dir in $TESTDIRS ; do Line 1299  for dir in $TESTDIRS ; do
1299      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
1300          echo -n '  --- dir:' $BUILD_DIR ': '          echo -n '  --- dir:' $BUILD_DIR ': '
1301          makeclean $BUILD_DIR          makeclean $BUILD_DIR
1302            (   cd $BUILD_DIR
1303                rm -f $EXECUTABLE *.bak
1304                rm -f genmake_state genmake_*optfile genmake.log
1305                rm -f SIZE.h.mpi genmake.tr_log make.tr_log
1306            )
1307          if test -d $dir/$rundir/CVS ; then          if test -d $dir/$rundir/CVS ; then
1308              echo -n '  --- dir:' $dir/$rundir ': '              echo -n '  --- dir:' $dir/$rundir ': '
1309              run_clean $dir/$rundir              run_clean $dir/$rundir
1310          fi          fi
1311          trdir=`( cd $dir ; find . -type d -name "tr_run.*" -print | sed 's/^.\///')`          trdir=`( cd $dir ; find . -type d -name "$pfxdir.*" -print | sed 's/^.\///')`
1312          ttd=`echo $trdir | wc -w`          ttd=`echo $trdir | wc -w`
1313          if test $ttd != 0 ; then          if test $ttd != 0 ; then
1314              echo '  --- rm dir:' $trdir              echo '  --- rm dir:' $trdir
# Line 1185  for dir in $TESTDIRS ; do Line 1317  for dir in $TESTDIRS ; do
1317          continue          continue
1318      fi      fi
1319    
1320      #  Verify that the testdir exists and contains previous      #  Verify that the testdir exists and contains previous
1321      #  results in the correct location--or skip this directory!      #  results in the correct location--or skip this directory!
1322      fout=$dir"/results/"$ref_outp      fout=$dir"/results/"$ref_outp
1323      if test ! -r $fout ; then      if test ! -r $fout ; then
# Line 1195  for dir in $TESTDIRS ; do Line 1327  for dir in $TESTDIRS ; do
1327    
1328      # Check for specific files for particular type of run      # Check for specific files for particular type of run
1329    
1330      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then      if test "x$MPI" != "x0" ; then
1331          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          if test -r $CODE_DIR"/SIZE.h_mpi" ; then
1332          continue              #- create new SIZE.h with no more than '$MPI' Procs
1333                mk_mpi_size $CODE_DIR"/SIZE.h_mpi" $BUILD_DIR"/tr_size.mpi" $MPI
1334                NPROC_MPI=$?
1335                (   cd $BUILD_DIR
1336                    if test -r SIZE.h.mpi ; then
1337                        cmp tr_size.mpi SIZE.h.mpi > /dev/null 2>&1 ; RETVAL=$?
1338                    else RETVAL=1
1339                    fi
1340                    if test "x$RETVAL" = x0 ; then
1341                        rm -f tr_size.mpi
1342                    else
1343                        rm -f SIZE.h.mpi ; mv tr_size.mpi SIZE.h.mpi
1344                    fi
1345                )
1346            else
1347                echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
1348                continue
1349            fi
1350      fi      fi
1351      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
1352          echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"          echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"
1353          continue          continue
1354      fi      fi
1355      if test "x$MPI" = "xt" -a "x$MULTI_THREAD" = "xt" ; then      if test "x$MPI" != "x0" -a "x$MULTI_THREAD" = "xt" ; then
1356        retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/input/eedata.mth"`          retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/input/eedata.mth"`
1357        if test $retv != 0 ; then          if test $retv != 0 ; then
1358          echo "input/eedata.mth tiling misfit -- skipping $dir"              echo "input/eedata.mth tiling misfit -- skipping $dir"
1359          continue              continue
1360        fi          fi
1361      fi      fi
1362    
1363      #  Check whether there are "extra runs" for this testdir      #  Check whether there are "extra runs" for this testdir
1364      extra_runs=      extra_runs=
1365      ex_run_dirs=`( cd $dir ; echo $inputdir.* )`      if test "x$NORUN" = xf ; then
1366            ex_run_dirs=`( cd $dir ; echo $inputdir.* )`
1367        fi
1368      #echo "ex_run_dirs='$ex_run_dirs'"      #echo "ex_run_dirs='$ex_run_dirs'"
1369      for exd in $ex_run_dirs ; do      for exd in $ex_run_dirs ; do
1370          name=`echo $exd | sed -e "s/$inputdir\.//"`          name=`echo $exd | sed -e "s/$inputdir\.//"`
1371          refExOut=`echo $ref_outp | sed "s/\./.${name}./"`          refExOut=`echo $ref_outp | sed "s/\./.${name}./"`
1372          outf="$dir/results/$refExOut"          outf="$dir/results/$refExOut"
1373          if test -f $outf -a -r $outf ; then          if test -f $outf -a -r $outf ; then
1374            if test "x$MULTI_THREAD" = "xt" ; then            if test "x$MULTI_THREAD" = "xt" ; then
1375              if test -r $dir"/"$exd"/eedata.mth" ; then              if test -r $dir"/"$exd"/eedata.mth" ; then
1376                if test "x$MPI" = "xt" ; then                if test "x$MPI" = "x0" ; then
1377                  retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/"$exd"/eedata.mth"`                  extra_runs="$extra_runs $name"
1378                  else
1379                    retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/"$exd"/eedata.mth"`
1380                  if test $retv = 0 ; then                  if test $retv = 0 ; then
1381                      extra_runs="$extra_runs $name"                      extra_runs="$extra_runs $name"
1382                  else                  else
1383                      echo $exd"/eedata.mth tiling misfit -- skipping $dir"                      echo $exd"/eedata.mth tiling misfit -- skipping $dir"
1384                  fi                  fi
               else  
                 extra_runs="$extra_runs $name"  
1385                fi                fi
1386              #else echo $dir"/"$exd"/eedata.mth: not found"              #else echo $dir"/"$exd"/eedata.mth: not found"
1387              fi              fi
# Line 1240  for dir in $TESTDIRS ; do Line 1391  for dir in $TESTDIRS ; do
1391          fi          fi
1392      done      done
1393    
     echo "-------------------------------------------------------------------------------"  
1394      echo      echo
1395      if test "x$extra_runs" = "x" ; then      if test "x$extra_runs" = "x" ; then
1396         echo "Experiment:  $dir"         echo "Experiment:  $dir"
1397      else      else
1398         echo "Experiment:  $dir ; extra_runs=$extra_runs"         echo "Experiment:  $dir ; extra_runs=$extra_runs"
# Line 1252  for dir in $TESTDIRS ; do Line 1402  for dir in $TESTDIRS ; do
1402      results=$EMPTY_RESULTS      results=$EMPTY_RESULTS
1403    
1404      #  Create an output dir for each OPTFILE/tdir combination      #  Create an output dir for each OPTFILE/tdir combination
1405      rel_CDIR=$DRESULTS"/"$dir      locDIR=$DRESULTS"/"$dir
1406      mkdir $rel_CDIR      mkdir $locDIR
1407      CDIR=`pwd`"/$rel_CDIR"      CDIR=`pwd`"/$locDIR"
1408        
1409      if test "x$CLEANUP" = xt ; then      if test "x$NORUN" = xt ; then
1410          echo '====>>> this is to check that we never go through this part <<< ==='              run=N
1411          makeclean $dir/$builddir \          genmakemodel $dir/$builddir && genmake=Y \
1412              && run_clean $dir/$rundir              && makeclean $dir/$builddir \
1413                && symlink_mpifiles $dir $code_dir $builddir \
1414                && makedependmodel $dir/$builddir && makedepend=Y \
1415                && makemodel $dir/$builddir && make=Y
1416      else      else
1417          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
1418              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
             && run_clean $dir/$rundir \  
1419              && symlink_mpifiles $dir $code_dir $builddir \              && symlink_mpifiles $dir $code_dir $builddir \
1420              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
1421              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
1422              && linkdata $dir/$rundir $inputdir input \              && run_clean $dir/$rundir \
1423                && linkdata $dir/$rundir $inputdir \
1424              && runmodel $dir/$rundir && run=Y \              && runmodel $dir/$rundir && run=Y \
1425              && results=`testoutput_run $dir $rundir $ref_outp`              && results=`testoutput_run $dir $rundir $ref_outp`
1426      fi      fi
1427            #echo "results='$results'"
1428      echo  
1429          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1430          echo          echo 1>&2
1431          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1432          touch $CDIR"/summary.txt"          touch $locDIR"/summary.txt"
1433          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt"          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
1434          echo "MACH='$MACH'" >> $CDIR"/summary.txt"          echo "tdir='$dir'" >> $locDIR"/summary.txt"
         echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"  
         echo "DATE='$DATE'" >> $CDIR"/summary.txt"  
         echo "tdir='$dir'" >> $CDIR"/summary.txt"  
1435          if test "x$ADM" = xt ; then          if test "x$ADM" = xt ; then
1436              head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt"              head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"
1437              grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \              grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \
1438                                  >> $CDIR"/summary.txt"                                  >> $locDIR"/summary.txt"
1439          fi          fi
1440    
1441          for ex in $extra_runs ; do          for ex in $extra_runs ; do
# Line 1294  for dir in $TESTDIRS ; do Line 1444  for dir in $TESTDIRS ; do
1444              #  reference output file              #  reference output file
1445              refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"`              refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"`
1446              #  Create an output dir for each OPTFILE/tdir.ex combination              #  Create an output dir for each OPTFILE/tdir.ex combination
1447              rel_CDIR=$DRESULTS"/"$dir"."$ex              locDIR=$DRESULTS"/"$dir"."$ex
1448              mkdir $rel_CDIR              mkdir $locDIR
1449              CDIR=`pwd`"/$rel_CDIR"              CDIR=`pwd`"/$locDIR"
1450              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"              test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex"
1451              run_clean $dir/tr_run.$ex              run_clean $dir/$pfxdir.$ex
1452              linkdata $dir/tr_run.$ex $inputdir.$ex $inputdir input              linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir
1453              runmodel $dir/tr_run.$ex && run=Y \              runmodel $dir/$pfxdir.$ex && run=Y \
1454              && results=`testoutput_run $dir tr_run.$ex $refExOut`              && results=`testoutput_run $dir $pfxdir.$ex $refExOut`
1455              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1456              fres="$fres.$ex"              fres="$fres.$ex"
1457              echo              echo 1>&2
1458              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1459              touch $CDIR"/summary.txt"              touch $locDIR"/summary.txt"
1460              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt"              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
1461              echo "MACH='$MACH'" >> $CDIR"/summary.txt"              echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt"
             echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"  
             echo "DATE='$DATE'" >> $CDIR"/summary.txt"  
             echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt"  
1462              if test "x$ADM" = xt ; then              if test "x$ADM" = xt ; then
1463                  head -1 $dir/$builddir/taf_ad.log >> $CDIR"/summary.txt"                  head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"
1464                  grep -A3 'Seconds in section "ALL' $dir/tr_run.$ex/$OUTPUTFILE \                  grep -A3 'Seconds in section "ALL' $dir/$pfxdir.$ex/$OUTPUTFILE \
1465                                     >> $CDIR"/summary.txt"                                     >> $locDIR"/summary.txt"
1466              fi              fi
1467              if test "x$POSTCLEAN" = xt ; then              if test "x$POSTCLEAN" = xt ; then
1468                  run_clean $dir/tr_run.$ex                  run_clean $dir/$pfxdir.$ex
1469              fi              fi
1470          done          done
1471    
1472        if test -f $DRESULTS"/"genmake_state ; then : ; else
1473            if test -f $dir/$builddir/Makefile ; then
1474                mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'`
1475                echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state
1476                sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state
1477                echo " $mkOpt" >> $DRESULTS/genmake_state
1478                if test "x$OPTFILE" = xNONE ; then
1479                    eval $mkOpt
1480                    sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\
1481                            $SUMMARY > tr_0.tmp_log
1482                    RETVAL=$?
1483                    if test "x$RETVAL" = x0 ; then rm -f $SUMMARY
1484                            cp tr_0.tmp_log $SUMMARY
1485                    else rm -f tr_0.tmp_log
1486                    fi
1487                fi
1488                gmkLog=$dir/$builddir/genmake.log
1489                grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1
1490                RETVAL=$?
1491                if test "x$RETVAL" = x0 ; then
1492                    echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state
1493                    sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \
1494                           | grep -v '^... compiler version ' > tr_1.tmp_log
1495                    sed -n '1,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \
1496                            >> $DRESULTS/genmake_state
1497                    rm -f tr_1.tmp_log
1498                fi
1499            fi
1500        fi
1501      #postclean $dir/$builddir      #postclean $dir/$builddir
1502      if test "x$POSTCLEAN" = xt ; then      if test "x$POSTCLEAN" = xt ; then
1503          makeclean $dir/$builddir \          makeclean $dir/$builddir \
1504              && run_clean $dir/$rundir              && run_clean $dir/$rundir
1505      fi      fi
1506        
1507      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
1508        
1509  done  done
1510    
1511  printf "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
# Line 1358  else Line 1534  else
1534              echo "An email containing results was sent to the following addresses:"              echo "An email containing results was sent to the following addresses:"
1535              echo "  \"$ADDRESSES\""              echo "  \"$ADDRESSES\""
1536              echo              echo
1537                test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"
1538                test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"
1539          fi          fi
         test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"  
         test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"  
1540      fi      fi
1541  fi  fi
1542    
1543  rm -f tr_cmpnum.c tr_cmpnum  if test "x$QUICK" = xf -a "x$NORUN" = xf ; then
1544        rm -f tr_cmpnum.c tr_cmpnum
1545    fi
1546    
1547  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
1548      cat $SUMMARY | sed 's/ \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \. //'      cat $SUMMARY | sed 's/ \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \. //'

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

  ViewVC Help
Powered by ViewVC 1.1.22