/[escript]/branches/4.0fordebian/run-escript.in
ViewVC logotype

Annotation of /branches/4.0fordebian/run-escript.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5266 - (hide annotations)
Mon Nov 17 06:45:01 2014 UTC (4 years, 5 months ago) by caltinay
Original Path: trunk/run-escript.in
File size: 14659 byte(s)
New options 'launcher', 'prelaunch' and 'postlaunch'.
The idea is to avoid system/env-specific hacks to run-escript and provide
a means to configure launchers (i.e. mpirun and friends) at build-time.
Thus bin/run-escript now lives as a template run-escript.in and the actual
launcher is created using the above options when running scons.
Technically not much should have changed as I have tried to set the defaults
to what they were in the original launcher.

Only wheezy_options updated so far until I get feedback...


1 caltinay 4927 #!/usr/bin/env sh
2 jfenwick 2409
3 caltinay 5266 ##############################################################################
4     #
5     # Copyright (c) 2003-2014 by University of Queensland
6     # http://www.uq.edu.au
7     #
8     # Primary Business: Queensland, Australia
9     # Licensed under the Open Software License version 3.0
10     # http://www.opensource.org/licenses/osl-3.0.php
11     #
12     # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
13     # Development 2012-2013 by School of Earth Sciences
14     # Development from 2014 by Centre for Geoscience Computing (GeoComp)
15     #
16     ##############################################################################
17 jfenwick 2409
18 caltinay 5266 # Escript wrapper for python
19     # Sets LD_LIBRARY_PATH and PYTHONPATH and then runs either python or the MPI
20     # launcher.
21 jfenwick 2409
22 caltinay 5266 # Extra paths can be configured about a page further down
23     # Search for EXTRA_PATH=""
24    
25     # set to 1 if this is a standalone build and ../../pkg contains the relevant
26     # tools
27 caltinay 4362 STANDALONE=0
28 jfenwick 2409
29 caltinay 5266 # set to 1 if this is part of a packaged build (.deb) and files will be
30     # installed in standard locations rather than everything in a single directory
31     # Do not use this together with STANDALONE
32 jfenwick 2409 STDLOCATION=0
33    
34 caltinay 5266 # Now we find the location of this script
35     # Note that this location should be absolute but does not need to be unique
36 jfenwick 2409 scriptdir=""
37 caltinay 4970 CURDIR=$(pwd)
38 jfenwick 2409
39 caltinay 5266 # Environment vars which control operations:
40 jfenwick 2409 # ESCRIPT_NUM_NODES, ESCRIPT_NUM_PROCS, ESCRIPT_NUM_THREADS, ESCRIPT_HOSTFILE, ESCRIPT_CREATESTDFILES
41    
42 jfenwick 3047 HOSTFILE=/tmp/escript.$USER.$$
43 jfenwick 2409
44 caltinay 5266 die () {
45     echo "Error: $@" 1>&2
46     exit 1
47     }
48    
49 jfenwick 2409 #Begin finding ESCRIPT_ROOT
50 caltinay 2806 if [ $STDLOCATION -ne 0 ]
51 jfenwick 2409 then
52 caltinay 4491 ESCRIPT_ROOT=/usr/lib/python-escript
53 jfenwick 2409 else
54 caltinay 4031 # We don't know the escript root so we need to work it out from the invocation
55     # Need to match if the name contains /
56 caltinay 4927 if $(echo $0|grep -q /)
57 jfenwick 2409 then
58     # We are not using the PATH to find the script
59 caltinay 4970 cd "$(dirname $0)"
60     scriptdir=$(pwd)
61 caltinay 3388 cd "$CURDIR"
62 jfenwick 2409 else
63 caltinay 4927 # name does not contain / therefore we are using
64 caltinay 4970 tscriptdir=$(which $0)
65 caltinay 3096 if [ $? -ne 0 ]
66 jfenwick 2409 then
67 caltinay 5266 die "Unable to determine script directory!"
68 jfenwick 2409 fi
69 caltinay 4970 scriptdir=$(dirname $tscriptdir)
70 jfenwick 2409 fi
71    
72 caltinay 3388 cd "$scriptdir/.."
73 caltinay 4970 ESCRIPT_ROOT=$(pwd)
74 jfenwick 2409 cd ..
75 caltinay 4970 ESCRIPT_PARENT=$(pwd)
76 caltinay 3388 cd "$CURDIR"
77 jfenwick 2409
78     fi
79 caltinay 4031 ##### End finding ESCRIPT_ROOT ########
80 jfenwick 2409
81     PYTHON_MPI_NULL="$ESCRIPT_ROOT/lib/pythonMPI"
82     PYTHON_MPI_REDIRECT="$ESCRIPT_ROOT/lib/pythonMPIredirect"
83     PYTHON_CMD=python
84    
85     # if possible please express paths relative to $ESCRIPT_ROOT unless
86     # they are in an unrelated location
87    
88     EXTRA_DYLD_LIBRARY_PATH=""
89     EXTRA_PATH=$ESCRIPT_ROOT/bin
90     EXTRA_PYTHONPATH=$ESCRIPT_ROOT
91    
92 jfenwick 4078 if [ $STDLOCATION -eq 1 ]
93     then
94 caltinay 4491 EXTRA_LD_LIBRARY_PATH=/usr/lib/python-escript
95 jfenwick 4078 else
96     EXTRA_LD_LIBRARY_PATH=$ESCRIPT_ROOT/lib
97     fi
98    
99    
100 caltinay 2806 if [ $STANDALONE -eq 1 ]
101 jfenwick 2409 then
102 jfenwick 3335 EXTRA_PATH=$ESCRIPT_PARENT/pkg/python/bin:$ESCRIPT_PARENT/pkg/scons/bin:$EXTRA_PATH
103 jfenwick 2530 EXTRA_LD_LIBRARY_PATH=$ESCRIPT_PARENT/pkg/boost/lib:$ESCRIPT_PARENT/pkg/netcdf/lib/:$EXTRA_LD_LIBRARY_PATH
104 jfenwick 2541 EXTRA_LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH
105 jfenwick 2530 EXTRA_LD_LIBRARY_PATH=$ESCRIPT_PARENT/pkg/python/lib:$EXTRA_LD_LIBRARY_PATH
106 jfenwick 2541 EXTRA_PYTHONPATH=$ESCRIPT_PARENT/pkg/numpy/lib/python2.6/site-packages:$ESCRIPT_PARENT/pkg/matplotlib/lib/python2.6/site-packages:$EXTRA_PYTHONPATH
107 jfenwick 2409 fi
108    
109 jfenwick 3335
110 jfenwick 4342 BUILDINFO_FILE="$ESCRIPT_ROOT/lib/buildvars"
111 jfenwick 4078 if [ "$STDLOCATION" = "1" ]
112     then
113 caltinay 4491 BUILDINFO_FILE=/usr/lib/python-escript/buildvars
114 jfenwick 4078 fi
115 jfenwick 4342 if [ ! -r "$BUILDINFO_FILE" ]; then
116 caltinay 4031 if [ "$1" = "-e" ]; then
117     echo "export LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:\$LD_LIBRARY_PATH"
118     echo "export PYTHONPATH=$EXTRA_PYTHONPATH:\$PYTHONPATH"
119     echo "export PATH=$EXTRA_PATH:\$PATH"
120 caltinay 4970 if [ "$(uname)" = "Darwin" ]
121 caltinay 4031 then
122     echo "export DYLD_LIBRARY_PATH=$EXTRA_DYLD_LIBRARY_PATH:$EXTRA_LD_LIBRARY_PATH:\$DYLD_LIBRARY_PATH"
123 caltinay 4927 fi
124 jfenwick 3335 exit 0
125     fi
126 caltinay 5266 die "Unable to read escript build information!"
127 jfenwick 3335 fi
128    
129 caltinay 4031 get_buildvar () {
130 caltinay 4970 echo $(grep "^$1=" "$BUILDINFO_FILE" |cut -d= -f2)
131 jfenwick 3335 }
132    
133 jfenwick 2409 HELP_TEXT="
134 caltinay 4031 Usage: run-escript [options] script.py [arguments...]
135 jfenwick 2409 -n nn number of nodes to use
136 gross 3193 -p np number of MPI processes to spawn per node
137 jfenwick 2409 -t nt number of OpenMP threads to use
138     -f file name of MPI hostfile
139 caltinay 4031 -c print compile information for escript and exit
140 jfenwick 2409 -V print escript version and exit
141 caltinay 4927 -i interactive mode
142 jfenwick 2409 -b do not invoke python (run non-python programs)
143     -e print export statements for environment and exit
144     -o redirect output from MPI to files
145     -v print diagnostics
146 caltinay 4031 -x run in new xterm instance
147 caltinay 5239 -m tool run with valgrind {tool=m[emcheck]/c[allgrind]/[cac]h[egrind]}
148 jfenwick 2409 script.py Your python script
149     arguments... The optional command-line arguments to your script
150     "
151    
152     if [ "$1" = "--help" ]; then
153     echo "$HELP_TEXT"
154     exit 0
155     fi
156 caltinay 4031 #==============================================================================
157 jfenwick 2409
158     # Parse the command-line options
159 caltinay 4506 while getopts 'bn:p:t:f:echim:oVvx' option
160 jfenwick 2409 do
161 caltinay 4031 case "$option" in
162     "b") DO_BINARY=y
163     ;;
164 caltinay 4506 "m") DO_VALGRIND=$OPTARG
165 caltinay 4483 ;;
166 caltinay 4031 "n") ESCRIPT_NUM_NODES=$OPTARG
167     ;;
168     "p") ESCRIPT_NUM_PROCS=$OPTARG
169     ;;
170     "t") ESCRIPT_NUM_THREADS=$OPTARG
171     ;;
172     "f") ESCRIPT_HOSTFILE=$OPTARG
173     ;;
174 jfenwick 4342 "c") cat "$BUILDINFO_FILE"
175 caltinay 4031 exit 0
176     ;;
177 caltinay 4970 "V") echo "escript-development(build "$(get_buildvar svn_revision)")"
178 caltinay 4031 exit 0
179     ;;
180     "h") echo "$HELP_TEXT"
181     exit 0
182     ;;
183     "i") DO_INTERACTIVE=y
184     ;;
185     "e") echo "export LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:\$LD_LIBRARY_PATH"
186     echo "export PYTHONPATH=$EXTRA_PYTHONPATH:\$PYTHONPATH"
187     echo "export PATH=$EXTRA_PATH:\$PATH"
188 caltinay 4970 if [ "$(uname)" = "Darwin" ]
189 caltinay 4031 then
190     echo "export DYLD_LIBRARY_PATH=$EXTRA_DYLD_LIBRARY_PATH:$EXTRA_LD_LIBRARY_PATH:\$DYLD_LIBRARY_PATH"
191     fi
192     exit 0
193     ;;
194     "o") ESCRIPT_CREATESTDFILES=y
195     ;;
196     "v") ESCRIPT_VERBOSE=y
197     ;;
198     "x") DO_XTERM=y
199     ;;
200     ?) echo "$HELP_TEXT"
201     exit 1
202     ;;
203     esac
204 jfenwick 2409 done
205 caltinay 4970 shift $(($OPTIND - 1))
206 caltinay 5266
207     vlog () {
208     if [ ! -z $ESCRIPT_VERBOSE ]; then
209     echo "$@"
210     fi
211     }
212    
213 jfenwick 2409 #==============================================
214     #
215 caltinay 3178 # Read MPI_FLAVOUR and WITH_OPENMP from the buildvars
216 jfenwick 2409 #
217 caltinay 4970 MPI_FLAVOUR=$(get_buildvar mpi)
218     WITH_OPENMP=$(get_buildvar openmp)
219 jfenwick 2409
220 caltinay 5266 vlog "MPI flavour is $MPI_FLAVOUR."
221     if [ "$WITH_OPENMP" = "1" ]; then
222     vlog "OpenMP enabled."
223     else
224     vlog "OpenMP disabled."
225 caltinay 2806 fi
226    
227 jfenwick 2409 #
228 caltinay 5266 # Add VisIt paths if required
229     #
230     WITH_VISIT=$(get_buildvar visit)
231     if [ "$WITH_VISIT" = "1" ]; then
232     VISIT_BIN=$(which visit 2>/dev/null)
233     if [ $? -eq 0 ]; then
234     VISIT_PY_PATH=$($VISIT_BIN -env | grep LIBPATH | cut -d= -f2)
235     EXTRA_PYTHONPATH=$EXTRA_PYTHONPATH:$VISIT_PY_PATH
236     EXTRA_LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:$VISIT_PY_PATH
237     else
238     vlog "Warning: VisIt module enabled but VisIt not in path!"
239     fi
240     fi
241    
242     #
243 jfenwick 2409 # extend path variables
244     #
245     export PATH=$EXTRA_PATH:$PATH
246     export LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:$LD_LIBRARY_PATH
247     export PYTHONPATH=$EXTRA_PYTHONPATH:$PYTHONPATH
248     EXPORT_ENV="PATH,LD_LIBRARY_PATH,PYTHONPATH"
249 caltinay 4970 if [ "$(uname)" = "Darwin" ]
250 jfenwick 2409 then
251     export DYLD_LIBRARY_PATH=$EXTRA_DYLD_LIBRARY_PATH:$EXTRA_LD_LIBRARY_PATH:$DYLD_LIBRARY_PATH
252     EXPORT_ENV="$EXPORT_ENV,DYLD_LIBRARY_PATH"
253     fi
254 caltinay 5266 vlog "PATH = $PATH
255     LD_LIBRARY_PATH = $LD_LIBRARY_PATH
256     PYTHONPATH = $PYTHONPATH"
257     if [ ! -z $DYLD_LIBRARY_PATH ]; then
258     vlog "DYLD_LIBRARY_PATH = $DYLD_LIBRARY_PATH"
259 jfenwick 2409 fi
260 caltinay 5266
261 jfenwick 2409 #==============================================
262     #
263     # Ensure the variables have sensible values
264     #
265 caltinay 4927 if [ "$MPI_FLAVOUR" = "none" ]
266 jfenwick 2409 then
267 caltinay 4664 if [ ! -z "$ESCRIPT_NUM_NODES" ]; then
268     if [ $ESCRIPT_NUM_NODES -gt 1 ]; then
269     echo "Warning: MPI disabled but number of nodes set. Option ignored."
270     fi
271 jfenwick 2409 fi
272 caltinay 4664 if [ ! -z "$ESCRIPT_NUM_PROCS" ]; then
273     if [ $ESCRIPT_NUM_PROCS -gt 1 ]; then
274     echo "Warning: MPI disabled but number of processors per node set. Option ignored."
275     fi
276 jfenwick 2409 fi
277 jfenwick 4342 if [ ! -z "$ESCRIPT_HOSTFILE" ]
278 jfenwick 2409 then
279     echo "Warning: MPI disabled but host file is given. Option ignored."
280     fi
281     ESCRIPT_NUM_NODES=1
282     ESCRIPT_NUM_PROCS=1
283     else
284 jfenwick 3056 # use the PBS_NODEFILE if not otherwise specified
285 jfenwick 4342 if [ ! -z "$PBS_NODEFILE" ] && [ -z "$ESCRIPT_HOSTFILE" ]
286 jfenwick 3056 then
287 caltinay 3178 ESCRIPT_HOSTFILE=$PBS_NODEFILE
288 jfenwick 3056 fi
289    
290 caltinay 4927 if [ ! -z "$ESCRIPT_HOSTFILE" ]
291 jfenwick 2409 then
292 jfenwick 4342 if [ -f "$ESCRIPT_HOSTFILE" ]
293 jfenwick 2409 then
294 caltinay 5266 sort -u "${ESCRIPT_HOSTFILE}" > $HOSTFILE
295     HOSTLIST=$(awk 'BEGIN{S=""}{if (S == "") { S = $0 } else {S = S "," $0}}END{print S}' "$HOSTFILE")
296    
297     NUM_HOSTS=$(wc -l "$HOSTFILE")
298 caltinay 4927 if [ ! -z $ESCRIPT_NUM_NODES ]
299 jfenwick 2409 then
300     if [ $NUM_HOSTS -ne $ESCRIPT_NUM_NODES ]
301     then
302 caltinay 5266 die "Number of hosts selected in the host file $ESCRIPT_HOSTFILE needs to match the requested number of nodes $ESCRIPT_NUM_NODES!"
303 jfenwick 2409 fi
304     else
305     ESCRIPT_NUM_NODES=$NUM_HOSTS
306     fi
307     else
308 caltinay 5266 die "Cannot find hostfile $ESCRIPT_HOSTFILE!"
309 jfenwick 2409 fi
310     else
311 caltinay 5266 echo "localhost" > $HOSTFILE
312     HOSTLIST="localhost"
313 jfenwick 2409 fi
314    
315     if [ -z $ESCRIPT_NUM_NODES ]
316     then
317 caltinay 3178 ESCRIPT_NUM_NODES=1
318 jfenwick 2409 fi
319    
320     if [ -z $ESCRIPT_NUM_PROCS ]
321     then
322 caltinay 3178 ESCRIPT_NUM_PROCS=1
323 jfenwick 2409 fi
324    
325 caltinay 5266 vlog "ESCRIPT_NUM_NODES = $ESCRIPT_NUM_NODES\nESCRIPT_NUM_PROCS = $ESCRIPT_NUM_PROCS"
326 jfenwick 2409 fi
327    
328 jfenwick 3259 if [ "$WITH_OPENMP" = "1" ]
329 jfenwick 2409 then
330 caltinay 5266 if [ -z $ESCRIPT_NUM_THREADS ]
331     then
332 jfenwick 2409 ESCRIPT_NUM_THREADS=$OMP_NUM_THREADS
333     if [ -z $ESCRIPT_NUM_THREADS ]
334     then
335 caltinay 5266 ESCRIPT_NUM_THREADS=1
336 jfenwick 2409 fi
337 caltinay 5266 fi
338     vlog "ESCRIPT_NUM_THREADS = $ESCRIPT_NUM_THREADS"
339 jfenwick 2409 else
340 caltinay 5266 if [ ! -z $ESCRIPT_NUM_THREADS ] && [ $ESCRIPT_NUM_THREADS != 1 ]
341     then
342     echo "Warning: OpenMP is disabled but number of threads requested is $ESCRIPT_NUM_THREADS!=1. Option ignored."
343     fi
344     ESCRIPT_NUM_THREADS=1
345 jfenwick 2409 fi
346 caltinay 5266
347 jfenwick 2409 #
348     # Now we compute total number of Processes
349     #
350 caltinay 4031 TOTPROC=$((ESCRIPT_NUM_NODES * ESCRIPT_NUM_PROCS))
351 caltinay 5266 if [ $? -ne 0 ] #Some compute error
352 caltinay 4031 then #This could happen if the args were not a number
353 caltinay 5266 die "Expression of total number of processors = $ESCRIPT_NUM_NODES * $ESCRIPT_NUM_PROCS is not numerical!"
354 jfenwick 2409 fi
355    
356 caltinay 5266 # set up thread binding if unset
357     if [ "$OMP_PROC_BIND" = "" ]; then
358     #Force OpenMP binding for Intel (and GCC, though GCC is on by default)
359     export OMP_PROC_BIND=true
360     fi
361     if [ "$KMP_AFFINITY" = "" ]; then
362     #Set the style of binding (overrides OMP_PROC_BIND in many cases)
363     export KMP_AFFINITY=verbose,compact
364     fi
365    
366 jfenwick 2409 #
367     # Test to ensure people aren't trying to combine interactive and multi-process
368     #
369 caltinay 4058 if ([ ! -z $DO_INTERACTIVE ] || [ $# -eq 0 ]) && ([ $TOTPROC -gt 1 ])
370 jfenwick 2409 then
371 caltinay 5266 die "Interactive mode cannot be used with more than one process!"
372 jfenwick 2409 fi
373    
374 caltinay 4927 if [ $TOTPROC -gt 1 ]
375 jfenwick 2409 then
376 caltinay 4322 if [ "$ESCRIPT_CREATESTDFILES" = "y" ]
377 caltinay 3178 then
378     PYTHON_MPI=$PYTHON_MPI_REDIRECT
379     else
380     PYTHON_MPI=$PYTHON_MPI_NULL
381     fi
382 jfenwick 2409 else
383     PYTHON_MPI=$PYTHON_MPI_NULL
384     fi
385 caltinay 4031 #==============================================================================
386 jfenwick 2409 # Must have at least one command-line arg: the python script
387     if [ $# -eq 0 ]
388     then
389 caltinay 4031 if [ ! -z $DO_BINARY ]
390 caltinay 3178 then
391 caltinay 5266 die "No program to run was specified!"
392 caltinay 3178 else
393 caltinay 4031 DO_INTERACTIVE=y
394 caltinay 3178 fi
395 jfenwick 2409 fi
396    
397 caltinay 4031 #==============================================================================
398 caltinay 4483
399 caltinay 4031 if [ ! -z $DO_XTERM ]
400 jfenwick 2409 then
401 caltinay 4031 EXEC_CMD="xterm -e"
402 jfenwick 2409 else
403 caltinay 4031 EXEC_CMD=""
404     fi
405    
406 caltinay 4483 if [ ! -z "$DO_VALGRIND" ]
407     then
408 caltinay 4970 VALGRIND_BIN=$(which valgrind 2>/dev/null)
409 caltinay 4483 if [ $? -eq 0 ]; then
410 caltinay 4506 LOGDIR=$ESCRIPT_ROOT/valgrind_logs
411 caltinay 4483 [ -d $LOGDIR ] || mkdir $LOGDIR
412 caltinay 4970 VG_TOOL=$(echo $DO_VALGRIND | awk '{ s=substr($0,1,1);print s;}')
413     if [ $VG_TOOL = "c" ];
414 caltinay 4506 then
415     # run callgrind
416     LOGFILE=${LOGDIR}/callgrind.%p.xml
417     VALGRIND="valgrind --tool=callgrind --callgrind-out-file=$LOGFILE"
418     EXEC_CMD="$EXEC_CMD $VALGRIND"
419 caltinay 5239 elif [ $VG_TOOL = "h" ];
420     then
421     # run cachegrind
422     LOGFILE=${LOGDIR}/cachegrind.%p.xml
423     VALGRIND="valgrind --tool=cachegrind --cachegrind-out-file=$LOGFILE"
424     EXEC_CMD="$EXEC_CMD $VALGRIND"
425 caltinay 4506 else
426     # run memcheck by default
427 caltinay 4970 LAST_N=$(ls -1 $LOGDIR|grep "^memcheck"|tail -1|cut -d. -f2)
428     NEW_N=$(printf "%04d" $((LAST_N + 1)))
429 caltinay 4506 LOGFILE=${LOGDIR}/memcheck.${NEW_N}.xml
430     VALGRIND="valgrind --tool=memcheck --xml=yes --show-reachable=yes --error-limit=no --gen-suppressions=all --suppressions=$ESCRIPT_ROOT/scripts/escript.supp --leak-check=full --xml-file=$LOGFILE"
431     EXEC_CMD="$EXEC_CMD $VALGRIND"
432     fi
433 caltinay 4483 else
434 caltinay 5266 die "Execution with valgrind requested but valgrind not in path!"
435 caltinay 4483 fi
436     fi
437    
438 caltinay 4031 if [ ! -z $DO_BINARY ]
439     then
440     EXEC_CMD="$EXEC_CMD $@"
441     else
442 caltinay 3178 # Check to see if the python version we were compiled with matches the
443     # one of PYTHON_CMD.
444 caltinay 4970 compfull=$(get_buildvar python_version)
445     compversion=$(echo $compfull | cut -d. -f1,2)
446     compmajor=$(echo $compfull | cut -d. -f1)
447 caltinay 4031 if [ "$PYTHON_CMD" = "python" ] # if people have customised the command they
448 jfenwick 3892 then # might not want us changing it
449     if [ "$compmajor" = "3" ]
450     then
451     PYTHON_CMD=python3
452     fi
453     fi
454 caltinay 4970 intversion=$($PYTHON_CMD -c 'from __future__ import print_function;import sys;print("%d.%d"%(sys.version_info[0], sys.version_info[1]))')
455 caltinay 3178 if [ "$compversion" != "$intversion" ]
456     then
457 caltinay 5266 die "Python versions do not match. Escript was compiled for '$compversion'.
458     Current version of Python appears to be '$intversion'."
459 caltinay 3178 fi
460 caltinay 2806 if [ "$MPI_FLAVOUR" = "none" ]
461 jfenwick 2409 then
462 caltinay 4031 if [ ! -z $DO_INTERACTIVE ]
463 jfenwick 2409 then
464 caltinay 4031 EXEC_CMD="$EXEC_CMD $PYTHON_CMD -i $@"
465 jfenwick 2409 else
466 caltinay 4031 EXEC_CMD="$EXEC_CMD $PYTHON_CMD $@"
467 jfenwick 2409 fi
468     else
469 caltinay 4031 if [ ! -z $DO_INTERACTIVE ]
470 gross 2865 then
471 caltinay 4031 EXEC_CMD="$EXEC_CMD $PYTHON_MPI -i $@"
472 gross 2865 else
473 caltinay 4031 EXEC_CMD="$EXEC_CMD $PYTHON_MPI $@"
474 gross 2865 fi
475 jfenwick 2409 fi
476     fi
477 caltinay 5266 vlog "Command to be executed is \"$EXEC_CMD\""
478 caltinay 4031 #==============================================================================
479 jfenwick 2409 #
480 caltinay 4031 # now we start to spawn things:
481 jfenwick 2409 #
482 jfenwick 3259 if [ "$WITH_OPENMP" = "1" ]
483 jfenwick 2409 then
484     export OMP_NUM_THREADS=$ESCRIPT_NUM_THREADS
485     EXPORT_ENV="$EXPORT_ENV,OMP_NUM_THREADS"
486     fi
487    
488 caltinay 5266 vlog "Pre-launch command: \"@@PRELAUNCH\""
489     @@PRELAUNCH
490     vlog "Launch command: \"@@LAUNCH\""
491     @@LAUNCH
492     EXIT_CODE=$?
493     vlog "Post-launch command: \"@@POSTLAUNCH\""
494     @@POSTLAUNCH
495 gross 2510
496 caltinay 4970 if [ ! -z "$DO_VALGRIND" ]; then
497     echo "Valgrind log file written to ${LOGFILE}"
498     fi
499    
500 caltinay 5266 rm -f $HOSTFILE
501    
502 jfenwick 2409 exit $EXIT_CODE
503 caltinay 4031

Properties

Name Value
svn:executable *
svn:mergeinfo /branches/3.4/bin/run-escript:4453-4490 /branches/diaplayground/bin/run-escript:4940-5147 /branches/lapack2681/bin/escript:2682-2741 /branches/pasowrap/bin/run-escript:3661-3674 /branches/py3_attempt2/bin/run-escript:3871-3891 /branches/release3.4/bin/run-escript:4452 /branches/restext/bin/escript:2610-2624 /branches/ripleygmg_from_3668/bin/run-escript:3669-3791 /branches/stage3.0/bin/escript:2569-2590 /branches/symbolic_from_3470/bin/run-escript:3471-3974 /branches/symbolic_from_3470/ripley/test/python/bin/run-escript:3517-3974 /release/3.0/bin/escript:2591-2601 /trunk/ripley/test/python/bin/run-escript:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26