/[escript]/trunk/scripts/finley_wrapper_template
ViewVC logotype

Diff of /trunk/scripts/finley_wrapper_template

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2357 by gross, Wed Apr 1 06:01:56 2009 UTC revision 2359 by jfenwick, Thu Apr 2 03:50:33 2009 UTC
# Line 9  Line 9 
9  #set to 1 if performing this is a standalone build and /packages contains the relevant tools  #set to 1 if performing this is a standalone build and /packages contains the relevant tools
10  STANDALONE=0  STANDALONE=0
11    
12    #set to 1 if this is part of a packaged build (.deb) and files will be installed in standard locations
13    #rather than everything in a single directory
14    #Do not use this together with $STANDALONE
15    STDLOCATION=0
16    
17  #Now we find the location of this script  #Now we find the location of this script
18  #Note that this location should be absolute but does not need to be unique  #Note that this location should be absolute but does not need to be unique
19  scriptdir=""  scriptdir=""
# Line 19  CURDIR=`pwd` Line 24  CURDIR=`pwd`
24    
25  HOSTFILE=/tmp/escript.$$  HOSTFILE=/tmp/escript.$$
26    
27    #Begin finding ESCRIPT_ROOT
28  #Need to match if the name contains /  if [ $STDLOCATION != 0 ]
 if [[ $0 =~ / ]]  
29  then  then
30      # We are not using the PATH to find the script      ESCRIPT_ROOT=/usr/lib/escript
     cd `dirname $0`  
     scriptdir=`pwd`  
     cd $CURDIR  
31  else  else
32      # name does not contain / therefore we are using    #We don't know the escript root so we need to work it out from the invocation
33      tscriptdir=`which $0`    #Need to match if the name contains /
34      if [ $? != 0 ]    if [[ $0 =~ / ]]
35      then    then
36          echo "Error unable to determine script directory. Exiting."        # We are not using the PATH to find the script
37      exit 1        cd `dirname $0`
38      fi        scriptdir=`pwd`
39      scriptdir=`dirname $tscriptdir`        cd $CURDIR
40  fi    else
41          # name does not contain / therefore we are using
42          tscriptdir=`which $0`
43          if [ $? != 0 ]
44          then
45              echo "Error unable to determine script directory. Exiting."
46          exit 1
47          fi
48          scriptdir=`dirname $tscriptdir`
49      fi
50    
51  cd $scriptdir/..    cd $scriptdir/..
52  ESCRIPT_ROOT=`pwd`    ESCRIPT_ROOT=`pwd`
53  cd ..    cd ..
54  ESCRIPT_PARENT=`pwd`    ESCRIPT_PARENT=`pwd`
55  cd $CURDIR    cd $CURDIR
56    
57    fi
58  ##### End finding ESCRIPT_ROOT  ########  ##### End finding ESCRIPT_ROOT  ########
59    
60  PYTHON_MPI="$ESCRIPT_ROOT/lib/pythonMPI"  PYTHON_MPI="$ESCRIPT_ROOT/lib/pythonMPI"
# Line 159  if [ -f "$ESCRIPT_ROOT/lib/Compiled.with Line 171  if [ -f "$ESCRIPT_ROOT/lib/Compiled.with
171  then  then
172      ESCRIPT_WITH_OPENMP="yes"      ESCRIPT_WITH_OPENMP="yes"
173  fi  fi
174  if [ ! -z $ESCRIPT_VERBOSE ] && [ ! -z $ESCRIPT_WITH_OPENMP ]; then echo "OpenMP enbaled."; fi  if [ ! -z $ESCRIPT_VERBOSE ] && [ ! -z $ESCRIPT_WITH_OPENMP ]; then echo "OpenMP enabled."; fi
175  #  #
176  #  extend path variables  #  extend path variables
177  #  #
# Line 179  then Line 191  then
191      echo "PYTHONPATH = $PYTHONPATH "      echo "PYTHONPATH = $PYTHONPATH "
192      if [ ! -z $DYLD_LIBRARY_PATH ]; then echo "DYLD_LIBRARY_PATH = $DYLD_LIBRARY_PATH "; fi      if [ ! -z $DYLD_LIBRARY_PATH ]; then echo "DYLD_LIBRARY_PATH = $DYLD_LIBRARY_PATH "; fi
193  fi  fi
 set -x  
194  #==============================================  #==============================================
195  #  #
196  #  Ensure the variables have sensible values  #  Ensure the variables have sensible values
# Line 328  fi Line 339  fi
339  #=============== no MPI ===================================  #=============== no MPI ===================================
340  if [ $MPI_FLAVOUR  == "none" ]  if [ $MPI_FLAVOUR  == "none" ]
341  then  then
342       echo $EXEC_CMD
343     $EXEC_CMD     $EXEC_CMD
344    
345  #=============== OpenMPI ===================================  #=============== OpenMPI ===================================
# Line 351  then Line 363  then
363     fi     fi
364     $CMD="mpiexec -n $ESCRIPT_NUM_PROCS -perhost $ESCRIPT_NUM_PROCS -envall -$EXEC_CMD"     $CMD="mpiexec -n $ESCRIPT_NUM_PROCS -perhost $ESCRIPT_NUM_PROCS -envall -$EXEC_CMD"
365     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is $CMD."; fi     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is $CMD."; fi
366       echo $CMD
367     $CMD     $CMD
368     if [ ! -z $HOSTFILE ]     if [ ! -z $HOSTFILE ]
369     then     then
# Line 370  then Line 383  then
383        CMD="mpirun -np $TOTPROC $EXEC_CMD"        CMD="mpirun -np $TOTPROC $EXEC_CMD"
384     fi     fi
385     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is $CMD."; fi     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is $CMD."; fi
386       echo $CMD
387     $CMD     $CMD
388  #=============== SGI's MPICH ===================================  #=============== SGI's MPICH ===================================
389  elif [ $MPI_FLAVOUR == "MPICH" ]  elif [ $MPI_FLAVOUR == "MPICH" ]

Legend:
Removed from v.2357  
changed lines
  Added in v.2359

  ViewVC Help
Powered by ViewVC 1.1.26