/[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.153 by jmc, Wed Dec 29 22:35:50 2010 UTC revision 1.154 by jmc, Fri Jan 14 23:55:00 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 "  (-MPI)  NUMBER           use MPI to compile and run on max NUMBER procs"
17      echo "  (-ieee/-noieee)          if possible, use IEEE compiler flags"      echo "  (-ieee/-noieee)          if possible, use IEEE compiler flags"
18      echo "                             (DEF=\"-ieee\")"      echo "                             (DEF=\"-ieee\")"
19      echo "  (-gsl)                   compile with \"-gsl\" flag"      echo "  (-gsl)                   compile with \"-gsl\" flag"
# Line 234  testoutput_run() Line 235  testoutput_run()
235            listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"`            listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"`
236          fi          fi
237          if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(M)='$listVar'" 1>&2 ; fi          if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(M)='$listVar'" 1>&2 ; fi
238          echo "listVar='$listVar'" > $locDIR"/summary.txt"          #- report to this experiment local summary file ---
239            echo "MACH='$MACH'" > $locDIR"/summary.txt"
240            echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"
241            echo "DATE='$DATE'" >> $locDIR"/summary.txt"
242            grep '(PID\.TID 0000\.0001)      n.. =' $1/$2/$OUTPUTFILE \
243             | sed 's/(PID.TID 0000.0001)     //' >> $locDIR"/summary.txt"
244            echo "listVar='$listVar'" >> $locDIR"/summary.txt"
245            #---
246          allargs=""          allargs=""
247          for xx in $listVar          for xx in $listVar
248          do          do
# Line 339  genmakemodel() Line 347  genmakemodel()
347              if test "x$GSL" = xt ; then              if test "x$GSL" = xt ; then
348                  command="$command -gsl"                  command="$command -gsl"
349              fi              fi
350              if test "x$MPI" = xt ; then              if test "x$MPI" != x0 ; then
351                  command="$command -mpi"                  command="$command -mpi"
352              fi              fi
353              if test "x$MULTI_THREAD" = xt ; then              if test "x$MULTI_THREAD" = xt ; then
# Line 388  makeclean() Line 396  makeclean()
396              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi
397              if test -r Makefile ; then              if test -r Makefile ; then
398                  printf 'clean build-dir: make Clean ... '                  printf 'clean build-dir: make Clean ... '
                 rm -f Makefile.old  
399                  $MAKE Clean >> make.tr_log 2>&1                  $MAKE Clean >> make.tr_log 2>&1
400                  RETVAL=$?                  RETVAL=$?
401                  if test "x$RETVAL" != x0 ; then                  if test "x$RETVAL" != x0 ; then
# Line 494  makemodel() Line 501  makemodel()
501      )      )
502  }  }
503    
504    mk_mpi_size()
505    {
506        # mk_mpi_size input_file output_file proc_Nb
507        #
508        # make new SIZE.h (=output_file) from SIZE.h_mpi (=input_file)
509        #     for an MPI build with no more than proc_Nb processors ;
510        # return the effective number of processors.
511    
512        inp=$1
513        out=$2
514        np=$3
515        tmp=TTT.$$
516    
517        px=`grep "^     & *nPx *=" $inp | sed "s/^     & *nPx *= *//" | sed 's/, *$//'`
518        py=`grep "^     & *nPy *=" $inp | sed "s/^     & *nPy *= *//" | sed 's/, *$//'`
519        sx=`grep "^     & *nSx *=" $inp | sed "s/^     & *nSx *= *//" | sed 's/, *$//'`
520        sy=`grep "^     & *nSy *=" $inp | sed "s/^     & *nSy *= *//" | sed 's/, *$//'`
521    
522        #- find the largest divisor of input_file proc Nb, but not larger than $np
523        pp=0
524        for i in `seq 1 $px` ; do
525          if [ `expr $px % $i` -eq 0 ] ; then
526            for j in `seq 1 $py` ; do
527              if [ `expr $py % $j` -eq 0 ] ; then
528                ij=`expr $i \* $j`
529                if [ $ij -gt $pp ] ; then
530                  if [ $ij -le $np ] ; then
531                    ix=$i ; jy=$j ; pp=$ij
532                    #echo "  ix,jy= $ix,$jy"
533                  fi
534                fi
535              fi
536            done
537          fi
538        done
539    
540        #- create new SIZE.h type file:
541        sx=`expr $sx \* $px / $ix`
542        sy=`expr $sy \* $py / $jy`
543        if [ $verbose -gt 1 ]; then
544            echo " px,py,np= $px,$py,$np : New MPI size: px,py= $ix,$jy : sx,sy= $sx,$sy"
545        fi
546        sed "/^     \& *nPx *=/s/[0-9]*,/$ix,/" $inp > $tmp
547        sed "/^     \& *nPy *=/s/[0-9]*,/$jy,/" $tmp > $out
548        sed "/^     \& *nSx *=/s/[0-9]*,/$sx,/" $out > $tmp
549        sed "/^     \& *nSy *=/s/[0-9]*,/$sy,/" $tmp > $out
550        rm -f $tmp
551        return $pp
552    }
553    
554  symlink_mpifiles()  symlink_mpifiles()
555  {  {
556      # Put special links so that MPI specific files are used      # Put special links so that MPI specific files are used
# Line 502  symlink_mpifiles() Line 559  symlink_mpifiles()
559    
560      dir=$1      dir=$1
561      code_dir=$2      code_dir=$2
562      BUILD_DIR=$dir/$3      build_dir=$dir/$3
     CODE_DIR=$dir/$code_dir  
563    
564      # These are files that should replace their counter-part when using -mpi      # These are files that should replace their counter-part when using -mpi
565      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi" -print)`      MPI_FILES=`(cd $dir/$code_dir; find . -name "*_mpi" -print)`
566    
567      #  Is this an MPI run?      for ii in $MPI_FILES ; do
568      if test "x$MPI" = xt ; then          i=`echo $ii | sed 's:^\./::'`
569          # YES: We symbolically link these files to the build          name=`echo $i | sed 's:_mpi::'`
570          # dir so long as there is no real file in place          file="../$code_dir/$i"
571          for ii in $MPI_FILES ; do          if test $name = 'SIZE.h' ; then file="SIZE.h.mpi" ; fi
572              i=`echo $ii | sed 's:^\./::'`  
573              name=`echo $i | sed 's:_mpi::' `          #  Is this an MPI run?
574              cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1          if test "x$MPI" = x0 ; then
575              RETVAL=$?              # NO: We undo any _mpi symbolically linked files
576              if test "x$RETVAL" != x0 ; then              if test -L $build_dir/$name ; then
577                  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  
578                  RETVAL=$?                  RETVAL=$?
579                  if test "x$RETVAL" = x0 ; then                  if test "x$RETVAL" = x0 ; then
580                      #echo Un-linking $name from $linktarg                      if [ $verbose -gt 1 ]; then
581                      rm -f $BUILD_DIR/$name                          echo "  Un-linking $name from ../$code_dir" ; fi
582                        rm -f $build_dir/$name
583                  fi                  fi
584              fi              fi
585          done          else
586      fi              # YES: We symbolically link these files to the build
587                # dir so long as there is no real file in place
588                ( cd $build_dir ; cmp $name $file > /dev/null 2>&1 )
589                RETVAL=$?
590                if [ $verbose -gt 1 ]; then echo "  cmp $name $file returns: $RETVAL" ; fi
591                if test "x$RETVAL" != x0 ; then
592                    if test -h $build_dir/$name ; then rm -f $build_dir/$name ; fi
593                    if test ! -r $build_dir/$name ; then
594                        if [ $verbose -gt 1 ]; then echo "  Linking $name to $file" ; fi
595                        (cd $build_dir; ln -sf $file $name)
596                    fi
597                fi
598            fi
599        done
600  }  }
601    
602  linkdata()  linkdata()
# Line 556  linkdata() Line 613  linkdata()
613                if test -r "../"$1"/"$xx ; then                if test -r "../"$1"/"$xx ; then
614                  # 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
615                  yy=`echo $xx | sed 's:\.mpi$::'`                  yy=`echo $xx | sed 's:\.mpi$::'`
616                  if test "x$MPI" = "xt" ; then                  if test "x$MPI" = "x0" ; then
617                  # mpi test: remove symbolic link & link _mpi sfx file                      # not mpi test: remove symbolic link
618                        if test -h $yy ; then rm -f $yy ; fi
619                    else
620                        # mpi test: remove symbolic link & link .mpi sfx file
621                      if test -h $yy ; then rm -f $yy ; fi                      if test -h $yy ; then rm -f $yy ; fi
622                      if test ! -r $yy ; then                      if test ! -r $yy ; then
623                          ln -sf "../"$1"/"$xx $yy ;                          ln -sf "../"$1"/"$xx $yy ;
624                          printf " $xx" 1>&2                          printf " $xx" 1>&2
625                      fi                      fi
                 else  
                 # not mpi test: remove symbolic link  
                     if test -h $yy ; then rm -f $yy ; fi  
626                  fi                  fi
627                fi                fi
628              done              done
# Line 613  runmodel() Line 670  runmodel()
670  {  {
671      # runmodel directory      # runmodel directory
672      #      #
673      #  runs "$COMMAND in "directory"      #  runs $COMMAND in "directory"
674      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
675      (      (
676          cd $1          cd $1
677          printf 'runmodel in %s ... ' $1          printf 'runmodel in %s ... ' $1
678          if test -L $EXECUTABLE ; then          if test -L $EXECUTABLE ; then
679            if test -x "../"$builddir"/"$EXECUTABLE ; then            if test -x "../"$builddir"/"$EXECUTABLE ; then
680              diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1              cmp $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1
681              outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi              outD=$? ; if test "x$outD" != x0 ; then rm -f $EXECUTABLE ; fi
682            else rm -f $EXECUTABLE            else rm -f $EXECUTABLE
683            fi            fi
684          fi          fi
# Line 629  runmodel() Line 686  runmodel()
686              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp
687              ln -sf "../"$builddir"/"$EXECUTABLE .              ln -sf "../"$builddir"/"$EXECUTABLE .
688          fi          fi
689            if test "x$MPI" != x0 ; then
690                #- adjust the MPI run command with the right number of Procs
691                #echo "COMMAND='$COMMAND'"
692                COMMAND=`echo $COMMAND | sed "s/-np * XX /-np $NPROC_MPI /"`
693                #echo "COMMAND='$COMMAND'"
694            fi
695          if test ! -x $EXECUTABLE ; then          if test ! -x $EXECUTABLE ; then
696                  rm -f $RUNLOG ; touch $RUNLOG                  rm -f $RUNLOG ; touch $RUNLOG
697                  if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi                  if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
# Line 846  if test "x$CC" = x ; then Line 909  if test "x$CC" = x ; then
909      CC=cc      CC=cc
910  fi  fi
911  JOBS=  JOBS=
912  MPI=f  MPI=0
913  MULTI_THREAD=f  MULTI_THREAD=f
914  OUTDIR=  OUTDIR=
915  DELDIR=  DELDIR=
# Line 958  for ac_option ; do Line 1021  for ac_option ; do
1021          -postclean | --postclean | -pc | --pc)          -postclean | --postclean | -pc | --pc)
1022              POSTCLEAN=t ;;              POSTCLEAN=t ;;
1023    
1024          -mpi) MPI=t ;;          -mpi | --mpi) MPI=2 ;;
1025            -MPI | --MPI) ac_prev=MPI ;;
1026            -MPI=* | --MPI=*) MPI=$ac_optarg ;;
1027    
1028          -mth) MULTI_THREAD=t ;;          -mth) MULTI_THREAD=t ;;
1029    
# Line 1074  OUTPUTFILE=$ref_outp Line 1139  OUTPUTFILE=$ref_outp
1139  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
1140      COMMAND="./$EXECUTABLE > $OUTPUTFILE"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
1141  fi  fi
1142  if test "x$MPI" = xt ; then  if test "x$MPI" != x0 ; then
1143      OUTPUTFILE="STDOUT.0000"      OUTPUTFILE="STDOUT.0000"
1144  fi  fi
1145    
# Line 1232  for dir in $TESTDIRS ; do Line 1297  for dir in $TESTDIRS ; do
1297          (   cd $BUILD_DIR          (   cd $BUILD_DIR
1298              rm -f $EXECUTABLE *.bak              rm -f $EXECUTABLE *.bak
1299              rm -f genmake_state genmake_*optfile genmake.log              rm -f genmake_state genmake_*optfile genmake.log
1300              rm -f genmake.tr_log make.tr_log              rm -f SIZE.h.mpi genmake.tr_log make.tr_log
1301          )          )
1302          if test -d $dir/$rundir/CVS ; then          if test -d $dir/$rundir/CVS ; then
1303              echo -n '  --- dir:' $dir/$rundir ': '              echo -n '  --- dir:' $dir/$rundir ': '
# Line 1257  for dir in $TESTDIRS ; do Line 1322  for dir in $TESTDIRS ; do
1322    
1323      # Check for specific files for particular type of run      # Check for specific files for particular type of run
1324    
1325      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then      if test "x$MPI" != "x0" ; then
1326          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          if test -r $CODE_DIR"/SIZE.h_mpi" ; then
1327          continue              #- create new SIZE.h with no more than '$MPI' Procs
1328                mk_mpi_size $CODE_DIR"/SIZE.h_mpi" $BUILD_DIR"/tr_size.mpi" $MPI
1329                NPROC_MPI=$?
1330                (   cd $BUILD_DIR
1331                    if test -r SIZE.h.mpi ; then
1332                        cmp tr_size.mpi SIZE.h.mpi > /dev/null 2>&1 ; RETVAL=$?
1333                    else RETVAL=1
1334                    fi
1335                    if test "x$RETVAL" = x0 ; then
1336                        rm -f tr_size.mpi
1337                    else
1338                        rm -f SIZE.h.mpi ; mv tr_size.mpi SIZE.h.mpi
1339                    fi
1340                )
1341            else
1342                echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
1343                continue
1344            fi
1345      fi      fi
1346      if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then      if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then
1347          echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"          echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"
1348          continue          continue
1349      fi      fi
1350      if test "x$MPI" = "xt" -a "x$MULTI_THREAD" = "xt" ; then      if test "x$MPI" != "x0" -a "x$MULTI_THREAD" = "xt" ; then
1351        retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/input/eedata.mth"`          retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/input/eedata.mth"`
1352        if test $retv != 0 ; then          if test $retv != 0 ; then
1353          echo "input/eedata.mth tiling misfit -- skipping $dir"              echo "input/eedata.mth tiling misfit -- skipping $dir"
1354          continue              continue
1355        fi          fi
1356      fi      fi
1357    
1358      #  Check whether there are "extra runs" for this testdir      #  Check whether there are "extra runs" for this testdir
# Line 1286  for dir in $TESTDIRS ; do Line 1368  for dir in $TESTDIRS ; do
1368          if test -f $outf -a -r $outf ; then          if test -f $outf -a -r $outf ; then
1369            if test "x$MULTI_THREAD" = "xt" ; then            if test "x$MULTI_THREAD" = "xt" ; then
1370              if test -r $dir"/"$exd"/eedata.mth" ; then              if test -r $dir"/"$exd"/eedata.mth" ; then
1371                if test "x$MPI" = "xt" ; then                if test "x$MPI" = "x0" ; then
1372                  retv=`check_eedata $CODE_DIR"/SIZE.h_mpi" $dir"/"$exd"/eedata.mth"`                  extra_runs="$extra_runs $name"
1373                  else
1374                    retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/"$exd"/eedata.mth"`
1375                  if test $retv = 0 ; then                  if test $retv = 0 ; then
1376                      extra_runs="$extra_runs $name"                      extra_runs="$extra_runs $name"
1377                  else                  else
1378                      echo $exd"/eedata.mth tiling misfit -- skipping $dir"                      echo $exd"/eedata.mth tiling misfit -- skipping $dir"
1379                  fi                  fi
               else  
                 extra_runs="$extra_runs $name"  
1380                fi                fi
1381              #else echo $dir"/"$exd"/eedata.mth: not found"              #else echo $dir"/"$exd"/eedata.mth: not found"
1382              fi              fi
# Line 1344  for dir in $TESTDIRS ; do Line 1426  for dir in $TESTDIRS ; do
1426          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1427          touch $locDIR"/summary.txt"          touch $locDIR"/summary.txt"
1428          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"  
1429          echo "tdir='$dir'" >> $locDIR"/summary.txt"          echo "tdir='$dir'" >> $locDIR"/summary.txt"
1430          if test "x$ADM" = xt ; then          if test "x$ADM" = xt ; then
1431              head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"              head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"
# Line 1374  for dir in $TESTDIRS ; do Line 1453  for dir in $TESTDIRS ; do
1453              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1454              touch $locDIR"/summary.txt"              touch $locDIR"/summary.txt"
1455              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"  
1456              echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt"              echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt"
1457              if test "x$ADM" = xt ; then              if test "x$ADM" = xt ; then
1458                  head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"                  head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"

Legend:
Removed from v.1.153  
changed lines
  Added in v.1.154

  ViewVC Help
Powered by ViewVC 1.1.22