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

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

  ViewVC Help
Powered by ViewVC 1.1.22