/[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.146 by jmc, Tue Nov 2 22:53:11 2010 UTC revision 1.167 by jmc, Mon Sep 26 12:58:48 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 "                             (DEF=\"-ieee\")"      echo "  (-mfile|-mf) STRING      MPI: file with list of possible machines to run on"
18        echo "  (-fast)                  use optfile default for compiler flags (no '-ieee')"
19        echo "                            DEF=off => use IEEE numerics option (if available)"
20        echo "  (-devel)                 use optfile developement flags (if available)"
21      echo "  (-gsl)                   compile with \"-gsl\" flag"      echo "  (-gsl)                   compile with \"-gsl\" flag"
22      echo "  (-use_r4|-ur4)           if allowed, use real*4 type for '_RS' variable"      echo "  (-use_r4|-ur4)           if allowed, use real*4 type for '_RS' variable"
23      echo "  (-optfile|-of) STRING    list of optfiles to use"      echo "  (-optfile|-of) STRING    list of optfiles to use"
# Line 25  usage() Line 28  usage()
28      echo "  (-tdir|-t) STRING        list of group and/or exp. dirs to test"      echo "  (-tdir|-t) STRING        list of group and/or exp. dirs to test"
29      echo "                             (recognized groups: basic, tutorials)"      echo "                             (recognized groups: basic, tutorials)"
30      echo "                             (DEF=\"\" which test all)"      echo "                             (DEF=\"\" which test all)"
31        echo "                             (if list= 'start_from THIS_EXP' then"
32        echo "                              test THIS_EXP + all the following)"
33      echo "  (-skipdir|-skd) STRING   list of exp. dirs to skip"      echo "  (-skipdir|-skd) STRING   list of exp. dirs to skip"
34      echo "                             (DEF=\"\" which test all)"      echo "                             (DEF=\"\" which test all)"
35      echo "  (-bash|-b) STRING        preferred location of a \"bash\" or"      echo "  (-bash|-b) STRING        preferred location of a \"bash\" or"
# Line 38  usage() Line 43  usage()
43      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
44      echo "  (-odir) STRING           used to build output directory name"      echo "  (-odir) STRING           used to build output directory name"
45      echo "                             (DEF=\"hostname\")"      echo "                             (DEF=\"hostname\")"
46      echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"  #   echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"
47      echo "                             (DEF=\"1 2 3 4 5\")"  #   echo "                             (DEF=\"1 2 3 4 5\")"
48      echo "  (-match) NUMBER          Matching Criteria (number of digits)"      echo "  (-match) NUMBER          Matching Criteria (number of digits)"
49      echo "                             (DEF=\"$MATCH_CRIT\")"      echo "                             (DEF=\"$MATCH_CRIT\")"
50      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
51      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-ef) STRING             used as genmake2 \"-extra_flag\" argument"
52        echo "  (-clean)                 *ONLY* run \"make CLEAN\" & clean run-dir"
53      echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"      echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"
54        echo "  (-obj)                   only produces objects (=norun & no executable)"
55      echo "  (-runonly|-ro)           *ONLY* run stage (=\"-quick\" without make)"      echo "  (-runonly|-ro)           *ONLY* run stage (=\"-quick\" without make)"
56      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
57      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
58      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
59      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
60        echo "  (-postclean|-pc)         after each exp. test, clean build-dir & run-dir"
61        echo "  (-deloutp|-do)           delete output files after successful run"
62      echo "  (-deldir|-dd)            on success, delete the output directory"      echo "  (-deldir|-dd)            on success, delete the output directory"
63      echo "  (-ts)                    provide timing information per timestep"      echo "  (-ts)                    provide timing information per timestep"
64      echo "  (-papis)                 provide MFlop/s per timestep using PAPI"      echo "  (-papis)                 provide MFlop/s per timestep using PAPI"
# Line 232  testoutput_run() Line 241  testoutput_run()
241            listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"`            listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"`
242          fi          fi
243          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
244          echo "listVar='$listVar'" > $locDIR"/summary.txt"          echo "listVar='$listVar'" >> $locDIR"/summary.txt"
245            #---
246          allargs=""          allargs=""
247          for xx in $listVar          for xx in $listVar
248          do          do
# Line 241  testoutput_run() Line 251  testoutput_run()
251                    then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi                    then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi
252                    testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$?                    testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$?
253                    if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;;                    if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;;
254            'Cost') testoutput_var $1 "ADM  precision_derivative_cost" "ADM Cost" $2 $3; yy=$? ;;            'Cost') testoutput_var $1 "ADM  ref_cost_function" "ADM CostFct" $2 $3; yy=$? ;;
255            'Grad') testoutput_var $1 "ADM  precision_derivative_grad" "ADM Grad" $2 $3; yy=$? ;;           'AdGrd') testoutput_var $1 "ADM  adjoint_gradient"  "ADM Ad Grad" $2 $3; yy=$? ;;
256             'FDGrd') testoutput_var $1 "ADM  finite-diff_grad"  "ADM FD Grad" $2 $3; yy=$? ;;
257             'Tmn') testoutput_var $1 "dynstat_theta_min"  "Theta minimum"  $2 $3; yy=$? ;;             'Tmn') testoutput_var $1 "dynstat_theta_min"  "Theta minimum"  $2 $3; yy=$? ;;
258             'Tmx') testoutput_var $1 "dynstat_theta_max"  "Theta maximum"  $2 $3; yy=$? ;;             'Tmx') testoutput_var $1 "dynstat_theta_max"  "Theta maximum"  $2 $3; yy=$? ;;
259             'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean"     $2 $3; yy=$? ;;             'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean"     $2 $3; yy=$? ;;
# Line 331  genmakemodel() Line 342  genmakemodel()
342              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
343                  command="$command -optfile=$OPTFILE"                  command="$command -optfile=$OPTFILE"
344              fi              fi
345              if test "x$IEEE" != x ; then              if test $OptLev = 1 ; then
346                  command="$command -ieee"                  command="$command -ieee"
347                fi
348                if test $OptLev = 0 ; then
349                    command="$command -devel"
350              fi              fi
351              if test "x$GSL" = xt ; then              if test "x$GSL" = xt ; then
352                  command="$command -gsl"                  command="$command -gsl"
353              fi              fi
354              if test "x$MPI" = xt ; then              if test "x$MPI" != x0 ; then
355                  command="$command -mpi"                  command="$command -mpi"
356              fi              fi
357              if test "x$MULTI_THREAD" = xt ; then              if test "x$MULTI_THREAD" = xt ; then
# Line 347  genmakemodel() Line 361  genmakemodel()
361              if test "x$USE_R4" = xt ; then              if test "x$USE_R4" = xt ; then
362                  command="$command -use_r4"                  command="$command -use_r4"
363              fi              fi
364                if test "x$EXTRFLG" != x ; then
365                    command="$command -extra_flag $EXTRFLG"
366                fi
367              if test "x$TS" = xt ; then              if test "x$TS" = xt ; then
368                  command="$command -ts"                  command="$command -ts"
369              fi              fi
# Line 365  genmakemodel() Line 382  genmakemodel()
382              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
383                  tail genmake.tr_log                  tail genmake.tr_log
384                  echo "genmakemodel: genmake failed"                  echo "genmakemodel: genmake failed"
385                  cp genmake_* genmake.tr_log $CDIR                  cp genmake.log genmake_* genmake.tr_log $CDIR
386                  return 1                  return 1
387              else              else
388                  echo "successful"                  echo "successful"
# Line 386  makeclean() Line 403  makeclean()
403              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi
404              if test -r Makefile ; then              if test -r Makefile ; then
405                  printf 'clean build-dir: make Clean ... '                  printf 'clean build-dir: make Clean ... '
                 rm -f Makefile.old  
406                  $MAKE Clean >> make.tr_log 2>&1                  $MAKE Clean >> make.tr_log 2>&1
407                  RETVAL=$?                  RETVAL=$?
408                  if test "x$RETVAL" != x0 ; then                  if test "x$RETVAL" != x0 ; then
409                      tail make.tr_log                      tail make.tr_log
410                      echo "makeclean: \"make Clean\" failed"                      echo "makeclean: \"make Clean\" failed"
411                      cp make.tr_log $CDIR"/make.tr_log"                      cp make.tr_log genmake.log genmake.tr_log $CDIR
412                      return 1                      return 1
413                  fi                  fi
414                  echo successful                  echo successful
# Line 418  run_clean() Line 434  run_clean()
434              find . -name "*.data" -exec rm {} \;              find . -name "*.data" -exec rm {} \;
435              find . -name "fort.*" -exec rm {} \;              find . -name "fort.*" -exec rm {} \;
436              find . -type l -exec rm {} \;              find . -type l -exec rm {} \;
437              rm -f $EXECUTABLE $RUNLOG *.txt STD* *diagnostics.log datetime              #- should remove executable only if sym-link (alredy done above)
438                rm -f $RUNLOG *.txt STD* *diagnostics.log datetime
439              rm -rf mnc_test_*              rm -rf mnc_test_*
440              rm -f *_MIT_CE_000.opt0000 costfunction*0000              rm -f *_MIT_CE_000.opt0000 costfunction*0000
441              echo successful              echo successful
# Line 441  makedependmodel() Line 458  makedependmodel()
458              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
459                  tail make.tr_log                  tail make.tr_log
460                  echo "makedependmodel: make depend failed"                  echo "makedependmodel: make depend failed"
461                  cp make.tr_log $CDIR"/make.tr_log"                  cp make.tr_log genmake.log genmake.tr_log $CDIR
462                  return 1                  return 1
463              else              else
464                  echo successful                  echo successful
# Line 454  makemodel() Line 471  makemodel()
471  {  {
472      # makemodel directory      # makemodel directory
473      (      (
474        mk_fail=0
475      if test "x$NOMAKE" = xt ; then      if test "x$NOMAKE" = xt ; then
476          cd $1;          cd $1;
477          if test -x $EXECUTABLE ; then          if test -x $EXECUTABLE ; then
478              echo "make skipped!"              echo "make skipped!"
479          else          else
480              echo "no executable!"              echo "no executable!"
481              return 2              mk_fail=3
482          fi          fi
483      else      else
484          cd $1;          cd $1;
# Line 472  makemodel() Line 490  makemodel()
490                  $MAKE adAll >> make.tr_log 2>&1                  $MAKE adAll >> make.tr_log 2>&1
491              else              else
492                  if test "x$JOBS" = x ; then                  if test "x$JOBS" = x ; then
493                      $MAKE >> make.tr_log 2>&1                      $MAKE $TARG >> make.tr_log 2>&1
494                  else                  else
495                      $MAKE -j $JOBS >> make.tr_log 2>&1                      $MAKE -j $JOBS $TARG >> make.tr_log 2>&1
496                  fi                  fi
497              fi              fi
498              RETVAL=$?              RETVAL=$?
499              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
500                  tail make.tr_log                  tail make.tr_log
501                  echo failed                  echo failed
502                  cp make.tr_log $CDIR"/make.tr_log"                  cp genmake.log genmake.tr_log $CDIR
503                    tail -$NBLINES_MKLOG make.tr_log > $CDIR"/make.tr_log_tail"
504                  rm -f $EXECUTABLE                  rm -f $EXECUTABLE
505                  return 1                  mk_fail=1
506              else              else
507                  echo successful                  echo successful
508              fi              fi
509            else
510                echo "no Makefile !"
511                mk_fail=2
512          fi          fi
513      fi      fi
514        if test "x$ADM" = xt -a -f taf_ad.log ; then
515                head -1 taf_ad.log >> $CDIR"/summary.txt"
516                nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log`
517                nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log`
518                echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \
519                                    >> $CDIR"/summary.txt"
520        fi
521        if test $mk_fail != 0 ; then return $mk_fail ; fi
522      )      )
523  }  }
524    
525    mk_mpi_size()
526    {
527        # mk_mpi_size input_file output_file proc_Nb prefer_to_split_X
528        #
529        # make new SIZE.h (=output_file) from SIZE.h_mpi (=input_file)
530        #     for an MPI build with no more than proc_Nb processors ;
531        # return the effective number of processors.
532    
533        inp=$1
534        out=$2
535        np=$3
536        dirX=$4
537        tmp=TTT.$$
538    
539        px=`grep "^     & *nPx *=" $inp | sed "s/^     & *nPx *= *//" | sed 's/, *$//'`
540        py=`grep "^     & *nPy *=" $inp | sed "s/^     & *nPy *= *//" | sed 's/, *$//'`
541        sx=`grep "^     & *nSx *=" $inp | sed "s/^     & *nSx *= *//" | sed 's/, *$//'`
542        sy=`grep "^     & *nSy *=" $inp | sed "s/^     & *nSy *= *//" | sed 's/, *$//'`
543    
544        #- find the largest divisor of input_file proc Nb, but not larger than $np
545        pp=0
546        i=1
547        while [ $i -le $px ] ; do
548          if [ `expr $px % $i` -eq 0 ] ; then
549            j=1
550            while [ $j -le $py ] ; do
551              if [ `expr $py % $j` -eq 0 ] ; then
552                ij=`expr $i \* $j`
553                if [ $ij -gt $pp ] ; then
554                    flag=1
555                elif [ $ij -eq $pp ] ; then
556                    flag=$dirX
557                else
558                    flag=0
559                fi
560                if test $flag = 1 ; then
561                  if [ $ij -le $np ] ; then
562                    ix=$i ; jy=$j ; pp=$ij
563                    #echo "  ix,jy= $ix,$jy"
564                  fi
565                fi
566              fi
567              j=`expr $j + 1`
568            done
569          fi
570          i=`expr $i + 1`
571        done
572    
573        #- create new SIZE.h type file:
574        sx=`expr $sx \* $px / $ix`
575        sy=`expr $sy \* $py / $jy`
576        if [ $verbose -gt 1 ]; then
577            echo " px,py,np= $px,$py,$np : New MPI size: px,py= $ix,$jy : sx,sy= $sx,$sy"
578        fi
579        sed "/^     \& *nPx *=/s/[0-9]*,/$ix,/" $inp > $tmp
580        sed "/^     \& *nPy *=/s/[0-9]*,/$jy,/" $tmp > $out
581        sed "/^     \& *nSx *=/s/[0-9]*,/$sx,/" $out > $tmp
582        sed "/^     \& *nSy *=/s/[0-9]*,/$sy,/" $tmp > $out
583        rm -f $tmp
584        return $pp
585    }
586    
587  symlink_mpifiles()  symlink_mpifiles()
588  {  {
589      # Put special links so that MPI specific files are used      # Put special links so that MPI specific files are used
# Line 500  symlink_mpifiles() Line 592  symlink_mpifiles()
592    
593      dir=$1      dir=$1
594      code_dir=$2      code_dir=$2
595      BUILD_DIR=$dir/$3      build_dir=$dir/$3
     CODE_DIR=$dir/$code_dir  
596    
597      # These are files that should replace their counter-part when using -mpi      # These are files that should replace their counter-part when using -mpi
598      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)`      MPI_FILES=`(cd $dir/$code_dir; find . -name "*_mpi" -print)`
599    
600      #  Is this an MPI run?      for ii in $MPI_FILES ; do
601      if test "x$MPI" = xt ; then          i=`echo $ii | sed 's:^\./::'`
602          # YES: We symbolically link these files to the build          name=`echo $i | sed 's:_mpi::'`
603          # dir so long as there is no real file in place          file="../$code_dir/$i"
604          for ii in $MPI_FILES ; do          if test $name = 'SIZE.h' ; then file="SIZE.h.mpi" ; fi
605              i=`echo $ii | sed 's:^\./::'`  
606              name=`echo $i | sed 's:_mpi::' `          #  Is this an MPI run?
607              cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1          if test "x$MPI" = x0 ; then
608              RETVAL=$?              # NO: We undo any _mpi symbolically linked files
609              if test "x$RETVAL" != x0 ; then              if test -L $build_dir/$name ; then
610                  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  
611                  RETVAL=$?                  RETVAL=$?
612                  if test "x$RETVAL" = x0 ; then                  if test "x$RETVAL" = x0 ; then
613                      #echo Un-linking $name from $linktarg                      if [ $verbose -gt 1 ]; then
614                      rm -f $BUILD_DIR/$name                          echo "  Un-linking $name from ../$code_dir" ; fi
615                        rm -f $build_dir/$name
616                  fi                  fi
617              fi              fi
618          done          else
619      fi              # YES: We symbolically link these files to the build
620                # dir so long as there is no real file in place
621                ( cd $build_dir ; cmp $name $file > /dev/null 2>&1 )
622                RETVAL=$?
623                if [ $verbose -gt 1 ]; then echo "  cmp $name $file returns: $RETVAL" ; fi
624                if test "x$RETVAL" != x0 ; then
625                    if test -h $build_dir/$name ; then rm -f $build_dir/$name ; fi
626                    if test ! -r $build_dir/$name ; then
627                        if [ $verbose -gt 1 ]; then echo "  Linking $name to $file" ; fi
628                        (cd $build_dir; ln -sf $file $name)
629                    fi
630                fi
631            fi
632        done
633  }  }
634    
635  linkdata()  linkdata()
# Line 554  linkdata() Line 646  linkdata()
646                if test -r "../"$1"/"$xx ; then                if test -r "../"$1"/"$xx ; then
647                  # 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
648                  yy=`echo $xx | sed 's:\.mpi$::'`                  yy=`echo $xx | sed 's:\.mpi$::'`
649                  if test "x$MPI" = "xt" ; then                  if test "x$MPI" = "x0" ; then
650                  # mpi test: remove symbolic link & link _mpi sfx file                      # not mpi test: remove symbolic link
651                        if test -h $yy ; then rm -f $yy ; fi
652                    else
653                        # mpi test: remove symbolic link & link .mpi sfx file
654                      if test -h $yy ; then rm -f $yy ; fi                      if test -h $yy ; then rm -f $yy ; fi
655                      if test ! -r $yy ; then                      if test ! -r $yy ; then
656                          ln -sf "../"$1"/"$xx $yy ;                          ln -sf "../"$1"/"$xx $yy ;
657                          printf " $xx" 1>&2                          printf " $xx" 1>&2
658                      fi                      fi
                 else  
                 # not mpi test: remove symbolic link  
                     if test -h $yy ; then rm -f $yy ; fi  
659                  fi                  fi
660                fi                fi
661              done              done
# Line 611  runmodel() Line 703  runmodel()
703  {  {
704      # runmodel directory      # runmodel directory
705      #      #
706      #  runs "$COMMAND in "directory"      #  runs $COMMAND in "directory"
707      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
708      (      (
709          cd $1          cd $1
710          printf 'runmodel in %s ... ' $1          printf 'runmodel in %s ... ' $1
711            if test "x$MPI" != x0 ; then
712                #- adjust the MPI run command with the right number of Procs
713                #echo '' ; echo "  COMMAND='$COMMAND'"
714                COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"`
715                if test "x$MPI_MFILE" != x ; then
716                  COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`
717                fi
718                #echo "  COMMAND='$COMMAND'"
719            fi
720          if test -L $EXECUTABLE ; then          if test -L $EXECUTABLE ; then
721            if test -x "../"$builddir"/"$EXECUTABLE ; then            if test -x "../"$builddir"/"$EXECUTABLE ; then
722              diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1              cmp $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1
723              outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi              outD=$? ; if test "x$outD" != x0 ; then rm -f $EXECUTABLE ; fi
724            else rm -f $EXECUTABLE            else rm -f $EXECUTABLE
725            fi            fi
726          fi          fi
# Line 628  runmodel() Line 729  runmodel()
729              ln -sf "../"$builddir"/"$EXECUTABLE .              ln -sf "../"$builddir"/"$EXECUTABLE .
730          fi          fi
731          if test ! -x $EXECUTABLE ; then          if test ! -x $EXECUTABLE ; then
732                  rm -f $RUNLOG ; touch $RUNLOG              rm -f $RUNLOG ; touch $RUNLOG
733                  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
734                  echo " no executable:" $EXECUTABLE >> $RUNLOG              echo " no executable:" $EXECUTABLE >> $RUNLOG
735                  RETVAL=8              RETVAL=8
736                  ENDVAL=-1              ENDVAL=-1
737          else          else
738              if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then            if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then
739                # output do not exist or is older than executable:              # output do not exist or is older than executable:
740                  rm -f $RUNLOG ; touch $RUNLOG              rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG
741                  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
742                  ( eval $COMMAND ) >> $RUNLOG 2>&1              ( eval $COMMAND ) >> $RUNLOG 2>&1
743                  RETVAL=$?              RETVAL=$?
744              else              ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`
745                  RETVAL=0              if [ $POSTCLEAN -eq 1 -a $ENDVAL -gt 0 ] ; then
746                  if test -f $RUNLOG ; then                  find . -name "*.meta" -exec rm {} \;
747                      if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi                  find . -name "*.data" -exec rm {} \;
748                      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  
749              fi              fi
750              ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'`            else
751                RETVAL=0
752                ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`
753                touch $RUNLOG
754                if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
755                echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1
756              fi
757          fi          fi
758          rm -f run.log_tmp          rm -f run.log_tmp
759            #- in all cases where OutputFile exists, report SIZE (and AD time)
760            if test -f $OUTPUTFILE ; then
761              grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \
762                    | sed 's/(PID.TID 0000.0001)     //' >> $CDIR"/summary.txt"
763              if test "x$ADM" = xt ; then
764                grep -A3 'Seconds in section "ALL' $OUTPUTFILE >> $CDIR"/summary.txt"
765              fi
766            fi
767            if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
768          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
769              echo successful              echo successful
770              printf '=> output from running in %s :\n' $1 1>&2              printf '=> output from running in %s :\n' $1 1>&2
771              tail $RUNLOG | sed 's/^.*/> &/g' 1>&2              tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
             # === Reduce the size of the testing emails!  
             #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE  
             if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi  
772              return 0              return 0
773          elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then          elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then
774              #-- for some weird cases (run is finihed but with error code)              #-- for some weird cases (run is finihed but with error code)
# Line 674  runmodel() Line 781  runmodel()
781              printf '=> output from running in %s :\n' $1 1>&2              printf '=> output from running in %s :\n' $1 1>&2
782              tail $RUNLOG | sed 's/^.*/> &/g' 1>&2              tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
783              cp $RUNLOG $CDIR"/"$RUNLOG              cp $RUNLOG $CDIR"/"$RUNLOG
             if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi  
784              return 1              return 1
785          fi          fi
786      )      )
# Line 776  scandirs() Line 882  scandirs()
882    
883  check_eedata()  check_eedata()
884  {  {
885      # check_eedata size.h eedata      # check_eedata eedata size.h
886      if [ $# -eq 2 ] ; then      if [ $# -eq 2 ] ; then
887        if test -f $1 -a -f $2 ; then       if test -f $1 -a -f $2 ; then
888        sx=`grep "^     & *nSx *=" $1 | sed "s/^     & *nSx *=//" | sed 's/, *$//'`        nx=`grep "^ *nTx *=" $1 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"`
889        nx=`grep "^ *nTx *=" $2 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"`        sx=`grep "^     & *nSx *=" $2 | sed "s/^     & *nSx *=//" | sed 's/, *$//'`
890        if test "x$nx" = x ; then        if test "x$nx" = x ; then
891          rx=10          rx=10
892        else        else
893          rx=`expr $sx % $nx`          rx=`expr $sx % $nx`
894        fi        fi
895        sy=`grep "^     & *nSy *=" $1 | sed "s/^     & *nSy *=//" | sed 's/, *$//'`        ny=`grep "^ *nTy *=" $1 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"`
896        ny=`grep "^ *nTy *=" $2 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"`        sy=`grep "^     & *nSy *=" $2 | sed "s/^     & *nSy *=//" | sed 's/, *$//'`
897        if test "x$ny" = x ; then        if test "x$ny" = x ; then
898          ry=20          ry=20
899        else        else
900          ry=`expr $sy % $ny`          ry=`expr $sy % $ny`
901        fi        fi
902        echo `expr $rx + $ry`        echo `expr $rx + $ry`
903      else       else
904        echo '-1'        echo '-1'
905        fi       fi
906        elif [ $# -eq 1 ] ; then
907         if test -f $1 ; then
908          nx=`grep "^ *nTx *=" $1 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"`
909          if test "x$nx" = x ; then nx=1 ; fi
910          ny=`grep "^ *nTy *=" $1 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"`
911          if test "x$ny" = x ; then ny=1 ; fi
912         #echo $nx $ny
913          echo $nx
914         else
915          echo '-1'
916         fi
917      else      else
918        echo '-2'        echo '-2'
919      fi      fi
# Line 809  check_eedata() Line 926  check_eedata()
926  #  Default properties  #  Default properties
927  debug=0  debug=0
928  verbose=1  verbose=1
929  clean=0  NBLINES_MKLOG=16000
930    
931  IEEE=true  IEEE=true
932  if test "x$MITGCM_IEEE" != x ; then  if test "x$MITGCM_IEEE" != x ; then
933      IEEE=$MITGCM_IEEE      IEEE=$MITGCM_IEEE
934  fi  fi
935    OptLev=1
936  GSL=f  GSL=f
937    
938  CLEANUP=f  CLEANUP=f
# Line 824  NOMAKE=f Line 942  NOMAKE=f
942  NOGENMAKE=f  NOGENMAKE=f
943  NOCLEAN=f  NOCLEAN=f
944  NODEPEND=f  NODEPEND=f
945  POSTCLEAN=f  POSTCLEAN=0
946    
947  BASH=  BASH=
948  OPTFILE=NONE  OPTFILE=NONE
# Line 843  if test "x$CC" = x ; then Line 961  if test "x$CC" = x ; then
961      CC=cc      CC=cc
962  fi  fi
963  JOBS=  JOBS=
964  MPI=f  TARG=
965    MPI=0
966    MPI_MFILE=
967  MULTI_THREAD=f  MULTI_THREAD=f
968  OUTDIR=  OUTDIR=
969  DELDIR=  DELDIR=
970  USE_R4=  USE_R4=
971    EXTRFLG=
972    
973  ADM=  ADM=
974  OADM=  OADM=
# Line 855  OADM= Line 976  OADM=
976  # list of pTracers to check for monitor output  # list of pTracers to check for monitor output
977  PTRACERS_NUM="1 2 3 4 5"  PTRACERS_NUM="1 2 3 4 5"
978    
979  MATCH_CRIT=13  MATCH_CRIT=10
980    
981  printf "parsing options...  "  printf "parsing options...  "
982    
# Line 873  for ac_option ; do Line 994  for ac_option ; do
994    
995      case $ac_option in      case $ac_option in
996                    
997          -help | --help | -h | --h)          -help | --help | -h | --h) usage ;;
998              usage ;;  
999                    -optfile | --optfile | -of | --of) ac_prev=OPTFILE ;;
1000          -optfile | --optfile | -of | --of)          -optfile=* | --optfile=* | -of=* | --of=*) OPTFILE=$ac_optarg ;;
1001              ac_prev=OPTFILE ;;  
1002          -optfile=* | --optfile=* | -of=* | --of=*)          -addr | --addr | -a | --a) ac_prev=ADDRESSES ;;
1003              OPTFILE=$ac_optarg ;;          -addr=* | --addr=* | -a=* | --a=*) ADDRESSES=$ac_optarg ;;
1004                    -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;;
1005          -addr | --addr | -a | --a)          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;;
1006              ac_prev=ADDRESSES ;;  
1007          -addr=* | --addr=* | -a=* | --a=*)          -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;;
1008              ADDRESSES=$ac_optarg ;;          -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;;
1009          -mpackdir | --mpackdir | -mpd | --mpd)          -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;;
1010              ac_prev=MPACKDIR ;;          -skipdir=* | --skipdir=* | -skd=* | --skd=*) SKIPDIRS=$ac_optarg ;;
1011          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*)  
1012              MPACKDIR=$ac_optarg ;;          -bash | --bash | -b | --b) ac_prev=BASH ;;
1013            -bash=* | --bash=* | -b=* | --b=*) BASH=$ac_optarg ;;
1014          -tdir | --tdir | -t | --t)  
1015              ac_prev=TESTDIRS ;;          -command | --command | -c | --c) ac_prev=COMMAND ;;
1016          -tdir=* | --tdir=* | -t=* | --t=*)          -command=* | --command=* | -c=* | --c=*) COMMAND=$ac_optarg ;;
1017              TESTDIRS=$ac_optarg ;;  
1018            -makedepend | --makedepend | -md | --md) ac_prev=MKDEPEND ;;
1019          -skipdir | --skipdir | -skd | --skd)          -makedepend=* | --makedepend=* | -md=* | --md=*) MKDEPEND=$ac_optarg ;;
1020              ac_prev=SKIPDIRS ;;  
1021          -skipdir=* | --skipdir=* | -skd=* | --skd=*)          -make | --make | -m | --m) ac_prev=MAKE ;;
1022              SKIPDIRS=$ac_optarg ;;          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;
1023    
1024          -bash | --bash | -b | --b)          -odir | --odir) ac_prev=OUTDIR ;;
1025              ac_prev=BASH ;;          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;
1026          -bash=* | --bash=* | -b=* | --b=*)  
1027              BASH=$ac_optarg ;;          -ptracers | --ptracers | -ptr | --ptr) ac_prev=PTRACERS_NUM ;;
1028            -ptracers=* | --ptracers=* | -ptr=* | --ptr=*) PTRACERS_NUM=$ac_optarg ;;
         -command | --command | -c | --c)  
             ac_prev=COMMAND ;;  
         -command=* | --command=* | -c=* | --c=*)  
             COMMAND=$ac_optarg ;;  
   
         -makedepend | --makedepend | -md | --md)  
             ac_prev=MKDEPEND ;;  
         -makedepend=* | --makedepend=* | -md=* | --md=*)  
             MKDEPEND=$ac_optarg ;;  
   
         -make | --make | -m | --m)  
             ac_prev=MAKE ;;  
         -make=* | --make=* | -m=* | --m=*)  
             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 ;;  
1029    
1030          -match | --match ) ac_prev=MATCH_CRIT ;;          -match | --match ) ac_prev=MATCH_CRIT ;;
1031          -match=* | --match=* ) MATCH_CRIT=$ac_optarg ;;          -match=* | --match=* ) MATCH_CRIT=$ac_optarg ;;
# Line 936  for ac_option ; do Line 1033  for ac_option ; do
1033          -j | --j) ac_prev=JOBS ;;          -j | --j) ac_prev=JOBS ;;
1034          -j=* | --j=*) JOBS=$ac_optarg ;;          -j=* | --j=*) JOBS=$ac_optarg ;;
1035    
1036          -clean | --clean)          -ef | --ef) ac_prev=EXTRFLG ;;
1037              CLEANUP=t ; DELDIR=t ;;          -ef=* | --ef=*) EXTRFLG=$ac_optarg ;;
1038    
1039          -norun | --norun | -nr | --nr)          -clean | --clean) CLEANUP=t ; DELDIR=t ;;
             NORUN=t ;;  
         -runonly | --runonly | -ro | --ro)  
             QUICK=t ; NOMAKE=t ;;  
         -quick | --quick | -q | --q)  
             QUICK=t ;;  
         -nogenmake | --nogenmake | -ng | --ng)  
             NOGENMAKE=t ;;  
         -noclean | --noclean | -nc | --nc)  
             NOCLEAN=t ;;  
         -nodepend | --nodepend | -nd | --nd)  
             NODEPEND=t ;;  
1040    
1041          -postclean | --postclean | -pc | --pc)          -norun | --norun | -nr | --nr) NORUN=t ;;
1042              POSTCLEAN=t ;;          -obj | --obj ) TARG='obj' ; NORUN=t ;;
1043            -runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;;
1044            -quick | --quick | -q | --q) QUICK=t ;;
1045            -nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;;
1046            -noclean | --noclean | -nc | --nc) NOCLEAN=t ;;
1047            -nodepend | --nodepend | -nd | --nd) NODEPEND=t ;;
1048    
1049            -postclean | --postclean | -pc | --pc) POSTCLEAN=2 ;;
1050            -deloutp | --deloutp | -do | --do) POSTCLEAN=1 ;;
1051    
1052            -mpi | --mpi) MPI=2 ;;
1053            -MPI | --MPI) ac_prev=MPI ;;
1054            -MPI=* | --MPI=*) MPI=$ac_optarg ;;
1055    
1056          -mpi) MPI=t ;;          -mfile | --mfile | -mf | --mf) ac_prev=MPI_MFILE ;;
1057            -mfile=* | --mfile=* | -mf=* | --mf=*) MPI_MFILE=$ac_optarg ;;
1058    
1059          -mth) MULTI_THREAD=t ;;          -mth) MULTI_THREAD=t ;;
1060    
1061          -adm | -ad) ADM=t ;;          -adm | -ad) ADM=t ;;
   
1062          -oad) OADM=t; NODEPEND=t ;;          -oad) OADM=t; NODEPEND=t ;;
1063    
1064          -ieee) IEEE=true ;;          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"
1065          -noieee) IEEE= ;;                   printf " ... " ;;
1066          -gsl) GSL=t ;;          -noieee) echo "Warning: will use option '-fast' instead of '-noieee' (obsolete)"
1067                     printf " ... " ; OptLev=`expr $OptLev \* 2` ;;
1068            -fast)  OptLev=`expr $OptLev \* 2` ;;
1069            -devel) OptLev=0 ;;
1070            -gsl) GSL=t ;;
1071    
1072          -verbose) verbose=2 ;;          -verbose) verbose=2 ;;
1073          -debug) debug=1 ;;          -debug) debug=1 ;;
# Line 979  for ac_option ; do Line 1081  for ac_option ; do
1081          -papis) PAPIS=t;;          -papis) PAPIS=t;;
1082          -pcls) PCL=t;;          -pcls) PCL=t;;
1083    
1084          -*)          -*) echo "Error: unrecognized option: "$ac_option
1085              echo "Error: unrecognized option: "$ac_option              usage ;;
1086              usage          *)  echo "Error: unrecognized argument: "$ac_option
1087              ;;              usage ;;
   
         *)  
             echo "Error: unrecognized argument: "$ac_option  
             usage  
             ;;  
1088    
1089       esac       esac
1090    
# Line 999  if test "x$QUICK" = xt ; then Line 1096  if test "x$QUICK" = xt ; then
1096      NODEPEND=t      NODEPEND=t
1097  fi  fi
1098    
1099    #- check length of MPI machine file:
1100    if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then
1101        if test -r $MPI_MFILE ; then
1102            nl=`wc -l $MPI_MFILE | awk '{print $1}'`
1103            if [ $nl -lt $MPI ] ; then
1104              echo "Error: need at least $MPI nodes (currently only $nl) in MPI_MFILE=$MPI_FILE"
1105              usage
1106            fi
1107            if [ $verbose -gt 1 ]; then
1108                echo " MPI_MFILE=$MPI_MFILE : $nl procs for MPI=$MPI run"
1109            fi
1110        else
1111              echo "Error: cannot access MPI_MFILE=$MPI_FILE"
1112              usage
1113        fi
1114    fi
1115    
1116  #- setting for forward or ADM testing  #- setting for forward or ADM testing
1117  if test "x$ADM" = xt ; then  if test "x$ADM" = xt ; then
1118      code_dir=code_ad      code_dir=code_ad
# Line 1066  if test "x$OPTFILE" = xNONE -a "x$MITGCM Line 1180  if test "x$OPTFILE" = xNONE -a "x$MITGCM
1180      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
1181  fi  fi
1182    
1183    LOC_MFILE='tr_mpi_mfile'
1184  RUNLOG="run.tr_log"  RUNLOG="run.tr_log"
1185  OUTPUTFILE=$ref_outp  OUTPUTFILE=$ref_outp
1186  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
1187      COMMAND="./$EXECUTABLE > $OUTPUTFILE"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
1188  fi  fi
1189  if test "x$MPI" = xt ; then  if test "x$MPI" != x0 ; then
1190      OUTPUTFILE="STDOUT.0000"      OUTPUTFILE="STDOUT.0000"
1191  fi  fi
1192    
# Line 1088  if test "x$ADM" = x -a "x$OADM" = x; the Line 1203  if test "x$ADM" = x -a "x$OADM" = x; the
1203      ii=`echo $EMPTY_RESULTS | awk '{print NF}'`      ii=`echo $EMPTY_RESULTS | awk '{print NF}'`
1204      EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf "  ."}}'`      EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf "  ."}}'`
1205  else  else
1206      DEF_CHECK_LIST='Grad Cost Grad'      DEF_CHECK_LIST='AdGrd Cost AdGrd FDGrd'
1207      EMPTY_RESULTS='.. ..'      EMPTY_RESULTS='.. ..'
1208      LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'`      LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'`
1209  fi  fi
# Line 1164  if test "x$OPTFILE" != xNONE ; then Line 1279  if test "x$OPTFILE" != xNONE ; then
1279      fi      fi
1280  else  else
1281      echo >> $SUMMARY      echo >> $SUMMARY
1282      echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY      echo "No \"OPTFILE\" was specified ; genmake2 found and uses:" >> $SUMMARY
1283      echo "   so the genmake default will be used." >> $SUMMARY      #-note: to be filled later after 1rst run
1284  fi  fi
1285  echo  echo
1286  echo >> $SUMMARY  echo >> $SUMMARY
# Line 1175  if test "x$ADM" = x -a "x$OADM" = x; the Line 1290  if test "x$ADM" = x -a "x$OADM" = x; the
1290      else line_0="default "$MATCH_CRIT ; fi      else line_0="default "$MATCH_CRIT ; fi
1291         line_0="$line_0  ----T-----  ----S-----  ----U-----  ----V-----"         line_0="$line_0  ----T-----  ----S-----  ----U-----  ----V-----"
1292      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"
1293      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  ."
1294      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"
1295      line_4="2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  ."      line_4="2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  ."
1296      for ii in $PTRACERS_NUM ; do      for ii in $PTRACERS_NUM ; do
1297          line_0="$line_0  --PTR 0"$ii"--"          line_0="$line_0  --PTR 0"$ii"--"
# Line 1199  else Line 1314  else
1314      else line_0="default    "$MATCH_CRIT ; fi      else line_0="default    "$MATCH_CRIT ; fi
1315      echo "$line_0" | tee -a $SUMMARY      echo "$line_0" | tee -a $SUMMARY
1316      cat << EOF | tee -a $SUMMARY      cat << EOF | tee -a $SUMMARY
1317  G D M    C  G  G D M    C  A  F
1318  E p a R  o  r  e p a R  o  d  D
1319  N n k u  s  a  n n k u  s  G  G
1320  2 d e n  t  d  2 d e n  t  r  r
1321    
1322  EOF  EOF
1323  fi  fi
# Line 1229  for dir in $TESTDIRS ; do Line 1344  for dir in $TESTDIRS ; do
1344          (   cd $BUILD_DIR          (   cd $BUILD_DIR
1345              rm -f $EXECUTABLE *.bak              rm -f $EXECUTABLE *.bak
1346              rm -f genmake_state genmake_*optfile genmake.log              rm -f genmake_state genmake_*optfile genmake.log
1347              rm -f genmake.tr_log make.tr_log              rm -f SIZE.h.mpi genmake.tr_log make.tr_log
1348          )          )
1349          if test -d $dir/$rundir/CVS ; then          if test -d $dir/$rundir/CVS ; then
1350              echo -n '  --- dir:' $dir/$rundir ': '              echo -n '  --- dir:' $dir/$rundir ': '
# Line 1254  for dir in $TESTDIRS ; do Line 1369  for dir in $TESTDIRS ; do
1369    
1370      # Check for specific files for particular type of run      # Check for specific files for particular type of run
1371    
1372      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then      if test ! -r $CODE_DIR"/SIZE.h_mpi"  -a "x$MPI" != "x0" ; then
1373          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
1374          continue          continue
1375      fi      fi
# Line 1262  for dir in $TESTDIRS ; do Line 1377  for dir in $TESTDIRS ; do
1377          echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"          echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"
1378          continue          continue
1379      fi      fi
1380      if test "x$MPI" = "xt" -a "x$MULTI_THREAD" = "xt" ; then  
1381        retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/input/eedata.mth"`      if test "x$MPI" != "x0" ; then
1382        if test $retv != 0 ; then          prefer_X=0
1383          echo "input/eedata.mth tiling misfit -- skipping $dir"          if test "x$MULTI_THREAD" = "xt" ; then
1384          continue              retv=`check_eedata $dir"/input/eedata.mth"`
1385        fi              if test $retv = 1 ; then prefer_X=1 ; fi
1386            fi
1387            #- create new SIZE.h with no more than '$MPI' Procs
1388            mk_mpi_size $CODE_DIR"/SIZE.h_mpi" $BUILD_DIR"/tr_size.mpi" $MPI $prefer_X
1389            LOC_NPROC=$?
1390            (   cd $BUILD_DIR
1391                if test -r SIZE.h.mpi ; then
1392                    cmp tr_size.mpi SIZE.h.mpi > /dev/null 2>&1 ; RETVAL=$?
1393                else RETVAL=1
1394                fi
1395                if test "x$RETVAL" = x0 ; then
1396                    rm -f tr_size.mpi
1397                else
1398                    rm -f SIZE.h.mpi ; mv tr_size.mpi SIZE.h.mpi
1399                fi
1400            )
1401            if test "x$MPI_MFILE" != x ; then
1402                #- create new MPI machine-file with the right number of Procs
1403                rm -f $LOC_MFILE
1404                cat $MPI_MFILE | sort | uniq | head -$LOC_NPROC > $LOC_MFILE
1405                nl=`wc -l $LOC_MFILE | awk '{print $1}'`
1406                if [ $nl -lt $LOC_NPROC ] ; then
1407                    rm -f $LOC_MFILE
1408                    cat $MPI_MFILE | head -$LOC_NPROC > $LOC_MFILE
1409                    #sed -n "1,$LOC_NPROC p" $MPI_MFILE > $LOC_MFILE
1410                fi
1411                if [ $verbose -gt 1 ]; then
1412                    nl=`wc -l $LOC_MFILE | awk '{print $1}'`
1413                    echo " new LOC_MFILE=$LOC_MFILE : $nl procs for LOC_NPROC=$LOC_NPROC"
1414                fi
1415            fi
1416            if test "x$MULTI_THREAD" = "xt" ; then
1417                retv=`check_eedata $dir"/input/eedata.mth" $BUILD_DIR"/SIZE.h.mpi"`
1418                if test $retv != 0 ; then
1419                    echo "input/eedata.mth tiling misfit -- skipping $dir"
1420                    continue
1421                fi
1422            fi
1423      fi      fi
1424    
1425      #  Check whether there are "extra runs" for this testdir      #  Check whether there are "extra runs" for this testdir
# Line 1283  for dir in $TESTDIRS ; do Line 1435  for dir in $TESTDIRS ; do
1435          if test -f $outf -a -r $outf ; then          if test -f $outf -a -r $outf ; then
1436            if test "x$MULTI_THREAD" = "xt" ; then            if test "x$MULTI_THREAD" = "xt" ; then
1437              if test -r $dir"/"$exd"/eedata.mth" ; then              if test -r $dir"/"$exd"/eedata.mth" ; then
1438                if test "x$MPI" = "xt" ; then                if test "x$MPI" = "x0" ; then
1439                  retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/"$exd"/eedata.mth"`                  extra_runs="$extra_runs $name"
1440                  else
1441                    retv=`check_eedata $dir"/"$exd"/eedata.mth" $BUILD_DIR"/SIZE.h.mpi"`
1442                  if test $retv = 0 ; then                  if test $retv = 0 ; then
1443                      extra_runs="$extra_runs $name"                      extra_runs="$extra_runs $name"
1444                  else                  else
1445                      echo $exd"/eedata.mth tiling misfit -- skipping $dir"                      echo $exd"/eedata.mth tiling misfit -- skipping $dir"
1446                  fi                  fi
               else  
                 extra_runs="$extra_runs $name"  
1447                fi                fi
1448              #else echo $dir"/"$exd"/eedata.mth: not found"              #else echo $dir"/"$exd"/eedata.mth: not found"
1449              fi              fi
# Line 1311  for dir in $TESTDIRS ; do Line 1463  for dir in $TESTDIRS ; do
1463      unset genmake makedepend make run      unset genmake makedepend make run
1464      results=$EMPTY_RESULTS      results=$EMPTY_RESULTS
1465    
1466      #  Create an output dir for each OPTFILE/tdir combination      #  Create an output dir & summary.txt file for each tested experiment (tdir)
1467      locDIR=$DRESULTS"/"$dir      locDIR=$DRESULTS"/"$dir
1468      mkdir $locDIR      mkdir $locDIR
1469        #- report to this experiment local summary file ---
1470        echo "DATE='$DATE' ; tdir='$dir'" > $locDIR"/summary.txt"
1471        echo "MACH='$MACH'" >> $locDIR"/summary.txt"
1472        echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"
1473      CDIR=`pwd`"/$locDIR"      CDIR=`pwd`"/$locDIR"
1474    
1475      if test "x$NORUN" = xt ; then      if test "x$NORUN" = xt ; then
# Line 1339  for dir in $TESTDIRS ; do Line 1495  for dir in $TESTDIRS ; do
1495          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1496          echo 1>&2          echo 1>&2
1497          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
         touch $locDIR"/summary.txt"  
1498          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
         echo "MACH='$MACH'" >> $locDIR"/summary.txt"  
         echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"  
         echo "DATE='$DATE'" >> $locDIR"/summary.txt"  
         echo "tdir='$dir'" >> $locDIR"/summary.txt"  
         if test "x$ADM" = xt ; then  
             head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"  
             grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \  
                                 >> $locDIR"/summary.txt"  
         fi  
1499    
1500          for ex in $extra_runs ; do          for ex in $extra_runs ; do
1501              unset run              unset run
1502              results=$EMPTY_RESULTS              results=$EMPTY_RESULTS
1503              #  reference output file              #  reference output file
1504              refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"`              refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"`
1505              #  Create an output dir for each OPTFILE/tdir.ex combination              #  Create an output dir & summary.txt file for each extra run (tdir.ex)
1506              locDIR=$DRESULTS"/"$dir"."$ex              locDIR=$DRESULTS"/"$dir"."$ex
1507              mkdir $locDIR              mkdir $locDIR
1508                #- report to this experiment local summary file ---
1509                echo "DATE='$DATE' ; tdir='$dir.$ex'" > $locDIR"/summary.txt"
1510                #echo "MACH='$MACH'" >> $locDIR"/summary.txt"
1511                #echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"
1512              CDIR=`pwd`"/$locDIR"              CDIR=`pwd`"/$locDIR"
1513              test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex"              test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex"
1514              run_clean $dir/$pfxdir.$ex              run_clean $dir/$pfxdir.$ex
# Line 1369  for dir in $TESTDIRS ; do Line 1519  for dir in $TESTDIRS ; do
1519              fres="$fres.$ex"              fres="$fres.$ex"
1520              echo 1>&2              echo 1>&2
1521              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
             touch $locDIR"/summary.txt"  
1522              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
1523              echo "MACH='$MACH'" >> $locDIR"/summary.txt"              if test "x$POSTCLEAN" = x2 ; then
             echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"  
             echo "DATE='$DATE'" >> $locDIR"/summary.txt"  
             echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt"  
             if test "x$ADM" = xt ; then  
                 head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"  
                 grep -A3 'Seconds in section "ALL' $dir/$pfxdir.$ex/$OUTPUTFILE \  
                                    >> $locDIR"/summary.txt"  
             fi  
             if test "x$POSTCLEAN" = xt ; then  
1524                  run_clean $dir/$pfxdir.$ex                  run_clean $dir/$pfxdir.$ex
1525              fi              fi
1526          done          done
# Line 1390  for dir in $TESTDIRS ; do Line 1530  for dir in $TESTDIRS ; do
1530              mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'`              mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'`
1531              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state
1532              sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state              sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state
1533              echo $mkOpt >> $DRESULTS/genmake_state              echo " $mkOpt" >> $DRESULTS/genmake_state
1534                if test "x$OPTFILE" = xNONE ; then
1535                    eval $mkOpt
1536                    sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\
1537                            $SUMMARY > tr_0.tmp_log
1538                    RETVAL=$?
1539                    if test "x$RETVAL" = x0 ; then rm -f $SUMMARY
1540                            cp tr_0.tmp_log $SUMMARY
1541                    else rm -f tr_0.tmp_log
1542                    fi
1543                fi
1544                gmkLog=$dir/$builddir/genmake.log
1545                grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1
1546                RETVAL=$?
1547                if test "x$RETVAL" = x0 ; then
1548                    echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state
1549                    sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \
1550                            | grep -v '^... compiler version ' > tr_1.tmp_log
1551                    sed -n '1p' tr_1.tmp_log >> $DRESULTS/genmake_state
1552                    sed -n '2,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \
1553                            >> $DRESULTS/genmake_state
1554                    rm -f tr_1.tmp_log
1555                fi
1556          fi          fi
1557      fi      fi
1558      #postclean $dir/$builddir      #postclean $dir/$builddir
1559      if test "x$POSTCLEAN" = xt ; then      if test "x$POSTCLEAN" = x2 ; then
1560          makeclean $dir/$builddir \          makeclean $dir/$builddir \
1561              && run_clean $dir/$rundir              && run_clean $dir/$rundir
1562      fi      fi
1563        if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then rm -f $LOC_MFILE ; fi
1564    
1565      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
1566    

Legend:
Removed from v.1.146  
changed lines
  Added in v.1.167

  ViewVC Help
Powered by ViewVC 1.1.22