/[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.26 by edhill, Fri Dec 5 14:56:45 2003 UTC revision 1.31 by edhill, Sun Dec 7 05:30:37 2003 UTC
# Line 319  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 628  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        build_mpack
680    fi
681    
682  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
683  MACH=`hostname`  MACH=`hostname`
# Line 727  for dir in $TESTDIRS ; do Line 776  for dir in $TESTDIRS ; do
776          continue          continue
777      fi      fi
778    
     echo "-------------------------------------------------------------------------------"  
     echo  
     echo "Experiment:  $dir"  
     echo  
     unset genmake makedepend make run  
     results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'  
   
779      builddir="input"      builddir="input"
780      rundir="input"      rundir="input"
781      use_seperate_build=0      use_seperate_build=0
# Line 745  for dir in $TESTDIRS ; do Line 787  for dir in $TESTDIRS ; do
787      fi      fi
788            
789      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
790            code_dir=code
791          CODE_DIR=$dir/code          CODE_DIR=$dir/code
792      else      else
793            code_dir=code_ad
794          CODE_DIR=$dir/code_ad          CODE_DIR=$dir/code_ad
795      fi      fi
796      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"  
797    
798      #  Is this an MPI run?      if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then
799      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)"  
800          continue          continue
801      fi      fi
802        
803      #  If we have the $FILES and they differ, copy the $FILES to $BUILD_DIR      echo "-------------------------------------------------------------------------------"
804      if test "x$have_files" = xt ; then      echo
805          for i in $FILES ; do      echo "Experiment:  $dir"
806              sstr="s|$endings||"      echo
807              name=`echo $i | sed -e $sstr `      unset genmake makedepend make run
808              cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
809              RETVAL=$?  
             if test "x$RETVAL" != x0 ; then  
                 cp $CODE_DIR/$i $BUILD_DIR/$name  
             fi  
         done  
     fi  
       
810      #  Create an output dir for each OPTFILE/tdir combination      #  Create an output dir for each OPTFILE/tdir combination
811      rel_CDIR=$DRESULTS"/"$dir      rel_CDIR=$DRESULTS"/"$dir
812      mkdir $rel_CDIR      mkdir $rel_CDIR
# Line 798  for dir in $TESTDIRS ; do Line 817  for dir in $TESTDIRS ; do
817      else      else
818          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
819              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
820                && symlink_mpifiles $dir $code_dir $builddir \
821              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
822              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
823              && linkdata $use_seperate_build $dir/$rundir \              && linkdata $use_seperate_build $dir/$rundir \

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.22