/[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.24 by edhill, Sun Nov 30 01:28:51 2003 UTC revision 1.32 by edhill, Sun Dec 7 07:06:13 2003 UTC
# Line 55  build_mpack() Line 55  build_mpack()
55              HAVE_MPACK=f              HAVE_MPACK=f
56          fi          fi
57          echo -n "building mpack...  "          echo -n "building mpack...  "
58          ( cd $MPACKDIR && ./configure && $MAKE ) > build_mpack.out 2>&1          if test "x$CC" = x ; then
59                export CC=cc
60            fi
61            ( cd $MPACKDIR && ./configure && $MAKE ) > tr_build_mpack.out 2>&1
62          RETVAL=$?          RETVAL=$?
63          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
64              echo              echo
# Line 63  build_mpack() Line 66  build_mpack()
66              echo              echo
67              HAVE_MPACK=f              HAVE_MPACK=f
68          else          else
69                rm -f tr_build_mpack.out
70              HAVE_MPACK=t              HAVE_MPACK=t
71          fi          fi
72      else      else
# Line 315  makemodel() Line 319  makemodel()
319      )      )
320  }  }
321    
322    symlink_mpifiles()
323    {
324        # Put special links so that MPI specific files are used
325        # This MUST be invoked between makeclean and makelinks because
326        # the Makefile will link to non-mpi files by default
327    
328        dir=$1
329        code_dir=$2
330        BUILD_DIR=$dir/$3
331        CODE_DIR=$dir/$code_dir
332    
333        # These are files that should replace their counter-part when using -mpi
334        MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`
335    
336        #  Is this an MPI run?
337        if test "x$MPI" = xt ; then
338            # YES: We symbolically link these files to the build
339            # dir so long as there is no real file in place
340            for ii in $MPI_FILES ; do
341                i=`echo $ii | sed 's:^\./::'`
342                name=`echo $i | sed 's:_mpi::' `
343                cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1
344                RETVAL=$?
345                if test "x$RETVAL" != x0 ; then
346                    if ! test -f $BUILD_DIR/$i ; then
347                    #echo Linking $name to $i
348                        (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)
349                    fi
350                fi
351            done
352        else
353        # NO: We undo any _mpi symbolically linked files
354            for ii in $MPI_FILES ; do
355                i=`echo $ii | sed 's:^\./::'`
356                name=`echo $i | sed 's:_mpi::' `
357                if test -L $BUILD_DIR/$name ; then
358                    linktarg=`(cd $BUILD_DIR; readlink $name)`
359                    if test $linktarg = "../$code_dir/$name"_mpi ; then
360                    #echo Un-linking $name from $linktarg
361                        rm -f $BUILD_DIR/$name
362                    fi
363                fi
364            done
365        fi
366        
367    }
368    
369  linkdata()  linkdata()
370  {  {
371      # linkdata flag      # linkdata flag
# Line 624  echo "OK" Line 675  echo "OK"
675  createcodelet  createcodelet
676    
677  #  build the mpack utility  #  build the mpack utility
678  build_mpack  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
679        echo "skipping mpack build"
680    else
681        build_mpack
682    fi
683    
684  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
685  MACH=`hostname`  MACH=`hostname`
686  UNAMEA=`uname -a`  UNAMEA=`uname -a`
687  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
688  BASE=$MACH"_"$DATE"_"  BASE="tr_"$MACH"_"$DATE"_"
689  DNUM=0  DNUM=0
690  DRESULTS="$BASE$DNUM"  DRESULTS="$BASE$DNUM"
691  while test -e $DRESULTS ; do  while test -e $DRESULTS ; do
# Line 723  for dir in $TESTDIRS ; do Line 778  for dir in $TESTDIRS ; do
778          continue          continue
779      fi      fi
780    
     echo "-------------------------------------------------------------------------------"  
     echo  
     echo "Experiment:  $dir"  
     echo  
     unset genmake makedepend make run  
     results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'  
   
781      builddir="input"      builddir="input"
782      rundir="input"      rundir="input"
783      use_seperate_build=0      use_seperate_build=0
# Line 741  for dir in $TESTDIRS ; do Line 789  for dir in $TESTDIRS ; do
789      fi      fi
790            
791      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
792            code_dir=code
793          CODE_DIR=$dir/code          CODE_DIR=$dir/code
794      else      else
795            code_dir=code_ad
796          CODE_DIR=$dir/code_ad          CODE_DIR=$dir/code_ad
797      fi      fi
798      BUILD_DIR=$dir/$builddir      BUILD_DIR=$dir/$builddir
     MPI_FILES="CPP_EEOPTIONS.h_mpi SIZE.h_mpi"  
     NOMPI_FILES="CPP_EEOPTIONS.h_nompi SIZE.h_nompi"  
799    
800      #  Is this an MPI run?      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then
801      if test "x$MPI" = xt ; then          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
         FILES=$MPI_FILES  
         endings="_mpi"  
     else  
         FILES=$NOMPI_FILES  
         endings="_nompi"  
     fi  
       
     #  Check to see that we have the files  
     have_files=t  
     for i in $FILES ; do  
         if test ! -r $CODE_DIR/$i ; then  
             echo "Warning: can't read file $CODE_DIR/$i"  
             have_files=f  
         fi  
     done  
     if test "x$have_files" != xt -a "x$MPI" = xt ; then  
         echo "Skipping $dir due to lack of input files (see above warning)"  
802          continue          continue
803      fi      fi
804        
805      #  If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR      echo "-------------------------------------------------------------------------------"
806      if test "x$have_files" = xt ; then      echo
807          for i in $FILES ; do      echo "Experiment:  $dir"
808              sstr="s|$endings||"      echo
809              name=`echo $i | sed -e $sstr `      unset genmake makedepend make run
810              cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
811              RETVAL=$?  
             if test "x$RETVAL" != x0 ; then  
                 cp $CODE_DIR/$i $BUILD_DIR/$name  
             fi  
         done  
     fi  
       
812      #  Create an output dir for each OPTFILE/tdir combination      #  Create an output dir for each OPTFILE/tdir combination
813      rel_CDIR=$DRESULTS"/"$dir      rel_CDIR=$DRESULTS"/"$dir
814      mkdir $rel_CDIR      mkdir $rel_CDIR
# Line 794  for dir in $TESTDIRS ; do Line 819  for dir in $TESTDIRS ; do
819      else      else
820          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
821              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
822                && symlink_mpifiles $dir $code_dir $builddir \
823              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
824              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
825              && linkdata $use_seperate_build $dir/$rundir \              && linkdata $use_seperate_build $dir/$rundir \
# Line 857  rm -f tmp_cmpnum.c tmp_cmpnum Line 883  rm -f tmp_cmpnum.c tmp_cmpnum
883    
884  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
885      cat $SUMMARY      cat $SUMMARY
886      if test -e tr.out ; then      if test -e tr_out.txt ; then
887          mv tr.out tr.out.old          mv tr_out.txt tr_out.txt.old
888      fi      fi
889      cat $SUMMARY > tr.out      cat $SUMMARY > tr_out.txt
890  fi  fi
891    

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.32

  ViewVC Help
Powered by ViewVC 1.1.22