/[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 2294 by jfenwick, Mon Mar 2 03:44:27 2009 UTC revision 2296 by jfenwick, Thu Mar 5 05:47:34 2009 UTC
# Line 10  Usage: escript [options] script.py [argu Line 10  Usage: escript [options] script.py [argu
10      -l 'launcher'   MPI launcher, usually -l 'mpirun -np' or -l 'mpiexec -n'      -l 'launcher'   MPI launcher, usually -l 'mpirun -np' or -l 'mpiexec -n'
11      -L /path    Prepend /path to library search path      -L /path    Prepend /path to library search path
12      -P /path    Prepend /path to python module search path      -P /path    Prepend /path to python module search path
13        -e      Print export statements for environment and exit
14      script.py   Your python script      script.py   Your python script
15      arguments...    The optional command-line arguments to your python script      arguments...    The optional command-line arguments to your python script
16  "  "
# Line 19  if [ "$1" = "--help" ]; then Line 20  if [ "$1" = "--help" ]; then
20    exit 0    exit 0
21  fi  fi
22    
23    #Now we find the location of this script
24    #Note that this location should be absolute but does not need to be unique
25    scriptdir=""
26    CURDIR=`pwd`
27    
28    #Need to match if the name contains /
29    if [[ $0 =~ / ]]
30    then
31        # We are not using the PATH to find the script
32        cd `dirname $0`
33        scriptdir=`pwd`
34        cd $CURDIR
35    else
36        # name does not contain / therefore we are using
37        tscriptdir=`which $0`
38        if [ $? != 0 ]
39        then
40            echo "Error unable to determine script directory. Exiting."
41        exit 1
42        fi
43        scriptdir=`dirname $tscriptdir`
44    fi
45    
46    cd $scriptname/..
47    ESCRIPT_ROOT=`pwd`
48    cd $CURDIR
49    
50  PYTHON_CMD="@@PYTHON_CMD@@"  PYTHON_CMD="@@PYTHON_CMD@@"
51    
52  ESCRIPT_ROOT="@@ESCRIPT_ROOT@@"  #ESCRIPT_ROOT="@@ESCRIPT_ROOT@@"
53    
54  export PATH="@@PATH@@"  export PATH="@@PATH@@"
55    
56  export LD_LIBRARY_PATH="@@LD_LIBRARY_PATH@@"  export LD_LIBRARY_PATH="@@LD_LIBRARY_PATH@@"
57    
58    if [ `uname` == Darwin ]
59    then
60        export DYLD_LIBRARY_PATH="@@LD_LIBRARY_PATH@@"
61    fi
62    
63  export PYTHONPATH="@@PYTHONPATH@@"  export PYTHONPATH="@@PYTHONPATH@@"
64    
65  # Avoid bug in hybrid runs with MPT MPI  # Avoid bug in hybrid runs with MPT MPI
# Line 45  OMP_NUM_THREADS=1 Line 78  OMP_NUM_THREADS=1
78  MPI_NUM_PROCS=1  MPI_NUM_PROCS=1
79    
80  # Parse the command-line options  # Parse the command-line options
81  while getopts 'L:P:O:M:l:' option  # option e should not be followed by a :
82    while getopts 'L:P:O:M:l:e' option
83  do  do
84      case "$option" in      case "$option" in
85        "L")  export LD_LIBRARY_PATH="$OPTARG:$LD_LIBRARY_PATH"        "L")  export LD_LIBRARY_PATH="$OPTARG:$LD_LIBRARY_PATH"
# Line 58  do Line 92  do
92          ;;          ;;
93        "l")  mpi_launcher="$OPTARG"        "l")  mpi_launcher="$OPTARG"
94          ;;          ;;
95          "e")  echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
96            echo "export PYTHONPATH=$PYTHONPATH"
97            echo "export PATH=$PATH"
98            if [ `uname` == Darwin ]
99            then
100                echo "export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
101            fi
102            exit 0
103            ;;
104        ?)    echo "$HELP_TEXT"        ?)    echo "$HELP_TEXT"
105          exit 1          exit 1
106          ;;          ;;

Legend:
Removed from v.2294  
changed lines
  Added in v.2296

  ViewVC Help
Powered by ViewVC 1.1.26