/[escript]/trunk/bin/run-escript
ViewVC logotype

Contents of /trunk/bin/run-escript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5239 - (show annotations)
Thu Oct 30 05:36:00 2014 UTC (4 years, 4 months ago) by caltinay
File size: 17594 byte(s)
More cache-friendly version of CPU-based symmetric-CDS-SpMV for block sizes >2.

1 #!/usr/bin/env sh
2
3 # Escript/Finley wrapper for python
4 # Sets LD_LIBRARY_PATH and PYTHONPATH and then runs either python or the MPI launcher
5
6 #Extra paths can be configured about a page further down
7 #Search for EXTRA_PATH=""
8
9 #set to 1 if performing this is a standalone build and ../../pkg contains the relevant tools
10 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
18 #Note that this location should be absolute but does not need to be unique
19 scriptdir=""
20 CURDIR=$(pwd)
21
22 #Environment vars which control operations:
23 # ESCRIPT_NUM_NODES, ESCRIPT_NUM_PROCS, ESCRIPT_NUM_THREADS, ESCRIPT_HOSTFILE, ESCRIPT_CREATESTDFILES
24
25 #set up thread binding if unset
26 if [ "$OMP_PROC_BIND" = "" ]; then
27 #Force OpenMP binding for Intel (and GCC, though GCC is on by default)
28 export OMP_PROC_BIND=true
29 fi
30 if [ "$KMP_AFFINITY" = "" ]; then
31 #Set the style of binding (overrides OMP_PROC_BIND in many cases)
32 export KMP_AFFINITY=verbose,compact
33 fi
34
35 HOSTFILE=/tmp/escript.$USER.$$
36 HOSTFILE2=/tmp/escript2.$USER.$$
37
38 #Begin finding ESCRIPT_ROOT
39 if [ $STDLOCATION -ne 0 ]
40 then
41 ESCRIPT_ROOT=/usr/lib/python-escript
42 else
43 # We don't know the escript root so we need to work it out from the invocation
44 # Need to match if the name contains /
45 if $(echo $0|grep -q /)
46 then
47 # We are not using the PATH to find the script
48 cd "$(dirname $0)"
49 scriptdir=$(pwd)
50 cd "$CURDIR"
51 else
52 # name does not contain / therefore we are using
53 tscriptdir=$(which $0)
54 if [ $? -ne 0 ]
55 then
56 echo "Error! Unable to determine script directory. Exiting."
57 exit 1
58 fi
59 scriptdir=$(dirname $tscriptdir)
60 fi
61
62 cd "$scriptdir/.."
63 ESCRIPT_ROOT=$(pwd)
64 cd ..
65 ESCRIPT_PARENT=$(pwd)
66 cd "$CURDIR"
67
68 fi
69 ##### End finding ESCRIPT_ROOT ########
70
71 PYTHON_MPI_NULL="$ESCRIPT_ROOT/lib/pythonMPI"
72 PYTHON_MPI_REDIRECT="$ESCRIPT_ROOT/lib/pythonMPIredirect"
73 PYTHON_CMD=python
74
75 # if possible please express paths relative to $ESCRIPT_ROOT unless
76 # they are in an unrelated location
77
78 EXTRA_DYLD_LIBRARY_PATH=""
79 EXTRA_PATH=$ESCRIPT_ROOT/bin
80 EXTRA_PYTHONPATH=$ESCRIPT_ROOT
81
82 if [ $STDLOCATION -eq 1 ]
83 then
84 EXTRA_LD_LIBRARY_PATH=/usr/lib/python-escript
85 else
86 EXTRA_LD_LIBRARY_PATH=$ESCRIPT_ROOT/lib
87 fi
88
89
90 if [ $STANDALONE -eq 1 ]
91 then
92 EXTRA_PATH=$ESCRIPT_PARENT/pkg/python/bin:$ESCRIPT_PARENT/pkg/scons/bin:$EXTRA_PATH
93 EXTRA_LD_LIBRARY_PATH=$ESCRIPT_PARENT/pkg/boost/lib:$ESCRIPT_PARENT/pkg/netcdf/lib/:$EXTRA_LD_LIBRARY_PATH
94 EXTRA_LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH
95 EXTRA_LD_LIBRARY_PATH=$ESCRIPT_PARENT/pkg/python/lib:$EXTRA_LD_LIBRARY_PATH
96 EXTRA_PYTHONPATH=$ESCRIPT_PARENT/pkg/numpy/lib/python2.6/site-packages:$ESCRIPT_PARENT/pkg/matplotlib/lib/python2.6/site-packages:$EXTRA_PYTHONPATH
97 fi
98
99
100 BUILDINFO_FILE="$ESCRIPT_ROOT/lib/buildvars"
101 if [ "$STDLOCATION" = "1" ]
102 then
103 BUILDINFO_FILE=/usr/lib/python-escript/buildvars
104 fi
105 if [ ! -r "$BUILDINFO_FILE" ]; then
106 if [ "$1" = "-e" ]; then
107 echo "export LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:\$LD_LIBRARY_PATH"
108 echo "export PYTHONPATH=$EXTRA_PYTHONPATH:\$PYTHONPATH"
109 echo "export PATH=$EXTRA_PATH:\$PATH"
110 if [ "$(uname)" = "Darwin" ]
111 then
112 echo "export DYLD_LIBRARY_PATH=$EXTRA_DYLD_LIBRARY_PATH:$EXTRA_LD_LIBRARY_PATH:\$DYLD_LIBRARY_PATH"
113 fi
114 exit 0
115 fi
116 echo "Error! Unable to read escript build information. Exiting."
117 exit 1
118 fi
119
120 get_buildvar () {
121 echo $(grep "^$1=" "$BUILDINFO_FILE" |cut -d= -f2)
122 }
123
124 #
125 # Add VisIt paths if required
126 #
127 WITH_VISIT=$(get_buildvar visit)
128 if [ "$WITH_VISIT" = "1" ]; then
129 VISIT_BIN=$(which visit 2>/dev/null)
130 if [ $? -eq 0 ]; then
131 VISIT_PY_PATH=$($VISIT_BIN -env | grep LIBPATH | cut -d= -f2)
132 EXTRA_PYTHONPATH=$EXTRA_PYTHONPATH:$VISIT_PY_PATH
133 EXTRA_LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:$VISIT_PY_PATH
134 elif [ ! -z $ESCRIPT_VERBOSE ]; then
135 echo "VisIt module enabled but VisIt not in path!"
136 fi
137 fi
138
139 HELP_TEXT="
140 Usage: run-escript [options] script.py [arguments...]
141 -n nn number of nodes to use
142 -p np number of MPI processes to spawn per node
143 -t nt number of OpenMP threads to use
144 -f file name of MPI hostfile
145 -c print compile information for escript and exit
146 -V print escript version and exit
147 -i interactive mode
148 -b do not invoke python (run non-python programs)
149 -e print export statements for environment and exit
150 -o redirect output from MPI to files
151 -v print diagnostics
152 -x run in new xterm instance
153 -m tool run with valgrind {tool=m[emcheck]/c[allgrind]/[cac]h[egrind]}
154 script.py Your python script
155 arguments... The optional command-line arguments to your script
156 "
157
158 if [ "$1" = "--help" ]; then
159 echo "$HELP_TEXT"
160 exit 0
161 fi
162 #==============================================================================
163
164 # Parse the command-line options
165 while getopts 'bn:p:t:f:echim:oVvx' option
166 do
167 case "$option" in
168 "b") DO_BINARY=y
169 ;;
170 "m") DO_VALGRIND=$OPTARG
171 ;;
172 "n") ESCRIPT_NUM_NODES=$OPTARG
173 ;;
174 "p") ESCRIPT_NUM_PROCS=$OPTARG
175 ;;
176 "t") ESCRIPT_NUM_THREADS=$OPTARG
177 ;;
178 "f") ESCRIPT_HOSTFILE=$OPTARG
179 ;;
180 "c") cat "$BUILDINFO_FILE"
181 exit 0
182 ;;
183 "V") echo "escript-development(build "$(get_buildvar svn_revision)")"
184 exit 0
185 ;;
186 "h") echo "$HELP_TEXT"
187 exit 0
188 ;;
189 "i") DO_INTERACTIVE=y
190 ;;
191 "e") echo "export LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:\$LD_LIBRARY_PATH"
192 echo "export PYTHONPATH=$EXTRA_PYTHONPATH:\$PYTHONPATH"
193 echo "export PATH=$EXTRA_PATH:\$PATH"
194 if [ "$(uname)" = "Darwin" ]
195 then
196 echo "export DYLD_LIBRARY_PATH=$EXTRA_DYLD_LIBRARY_PATH:$EXTRA_LD_LIBRARY_PATH:\$DYLD_LIBRARY_PATH"
197 fi
198 exit 0
199 ;;
200 "o") ESCRIPT_CREATESTDFILES=y
201 ;;
202 "v") ESCRIPT_VERBOSE=y
203 ;;
204 "x") DO_XTERM=y
205 ;;
206 ?) echo "$HELP_TEXT"
207 exit 1
208 ;;
209 esac
210 done
211 shift $(($OPTIND - 1))
212 #==============================================
213 #
214 # Read MPI_FLAVOUR and WITH_OPENMP from the buildvars
215 #
216 MPI_FLAVOUR=$(get_buildvar mpi)
217 WITH_OPENMP=$(get_buildvar openmp)
218
219 if [ ! -z $ESCRIPT_VERBOSE ]; then
220 echo "MPI flavour is $MPI_FLAVOUR."
221 if [ "$WITH_OPENMP" = "1" ]; then echo "OpenMP enabled."; fi
222 fi
223
224 #
225 # extend path variables
226 #
227 export PATH=$EXTRA_PATH:$PATH
228 export LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:$LD_LIBRARY_PATH
229 export PYTHONPATH=$EXTRA_PYTHONPATH:$PYTHONPATH
230 EXPORT_ENV="PATH,LD_LIBRARY_PATH,PYTHONPATH"
231 if [ "$(uname)" = "Darwin" ]
232 then
233 export DYLD_LIBRARY_PATH=$EXTRA_DYLD_LIBRARY_PATH:$EXTRA_LD_LIBRARY_PATH:$DYLD_LIBRARY_PATH
234 EXPORT_ENV="$EXPORT_ENV,DYLD_LIBRARY_PATH"
235 fi
236 if [ ! -z $ESCRIPT_VERBOSE ]
237 then
238 echo "PATH = $PATH "
239 echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH "
240 echo "PYTHONPATH = $PYTHONPATH "
241 if [ ! -z $DYLD_LIBRARY_PATH ]; then echo "DYLD_LIBRARY_PATH = $DYLD_LIBRARY_PATH "; fi
242 fi
243 #==============================================
244 #
245 # Ensure the variables have sensible values
246 #
247 if [ "$MPI_FLAVOUR" = "none" ]
248 then
249 if [ ! -z "$ESCRIPT_NUM_NODES" ]; then
250 if [ $ESCRIPT_NUM_NODES -gt 1 ]; then
251 echo "Warning: MPI disabled but number of nodes set. Option ignored."
252 fi
253 fi
254 if [ ! -z "$ESCRIPT_NUM_PROCS" ]; then
255 if [ $ESCRIPT_NUM_PROCS -gt 1 ]; then
256 echo "Warning: MPI disabled but number of processors per node set. Option ignored."
257 fi
258 fi
259 if [ ! -z "$ESCRIPT_HOSTFILE" ]
260 then
261 echo "Warning: MPI disabled but host file is given. Option ignored."
262 fi
263 ESCRIPT_NUM_NODES=1
264 ESCRIPT_NUM_PROCS=1
265 else
266 # use the PBS_NODEFILE if not otherwise specified
267 if [ ! -z "$PBS_NODEFILE" ] && [ -z "$ESCRIPT_HOSTFILE" ]
268 then
269 ESCRIPT_HOSTFILE=$PBS_NODEFILE
270 fi
271
272 if [ ! -z "$ESCRIPT_HOSTFILE" ]
273 then
274 if [ -f "$ESCRIPT_HOSTFILE" ]
275 then
276 cat "$ESCRIPT_HOSTFILE" | sort -u > $HOSTFILE
277 NUM_HOSTS=$(cat "$HOSTFILE" | wc -l)
278 if [ ! -z $ESCRIPT_NUM_NODES ]
279 then
280 if [ $NUM_HOSTS -ne $ESCRIPT_NUM_NODES ]
281 then
282 echo "number of hosts selected in the host file $ESCRIPT_HOSTFILE needs to match the requested number of nodes $ESCRIPT_NUM_NODES."
283 exit 1
284 fi
285 else
286 ESCRIPT_NUM_NODES=$NUM_HOSTS
287 fi
288 else
289 echo "cannot find hostfile $ESCRIPT_HOSTFILE."
290 exit 1
291 fi
292 else
293 HOSTFILE=''
294 fi
295
296 if [ -z $ESCRIPT_NUM_NODES ]
297 then
298 ESCRIPT_NUM_NODES=1
299 fi
300
301 if [ -z $ESCRIPT_NUM_PROCS ]
302 then
303 ESCRIPT_NUM_PROCS=1
304 fi
305
306 if [ ! -z $ESCRIPT_VERBOSE ]
307 then
308 echo "ESCRIPT_NUM_NODES = $ESCRIPT_NUM_NODES "
309 echo "ESCRIPT_NUM_PROCS = $ESCRIPT_NUM_PROCS "
310 fi
311 fi
312
313 if [ "$WITH_OPENMP" = "1" ]
314 then
315 if [ -z $ESCRIPT_NUM_THREADS ]
316 then
317 ESCRIPT_NUM_THREADS=$OMP_NUM_THREADS
318 if [ -z $ESCRIPT_NUM_THREADS ]
319 then
320 ESCRIPT_NUM_THREADS=1
321 fi
322 fi
323 if [ ! -z $ESCRIPT_VERBOSE ]
324 then
325 echo "ESCRIPT_NUM_THREADS is $ESCRIPT_NUM_THREADS."
326 fi
327 else
328 if [ ! -z $ESCRIPT_NUM_THREADS ] && [ $ESCRIPT_NUM_THREADS != 1 ]
329 then
330 echo "Warning: OpenMP is disabled but number of threads requested is $ESCRIPT_NUM_THREADS!=1. Running without threads."
331 fi
332 ESCRIPT_NUM_THREADS=1
333 fi
334 #
335 # Now we compute total number of Processes
336 #
337 TOTPROC=$((ESCRIPT_NUM_NODES * ESCRIPT_NUM_PROCS))
338 if [ $? -ne 0 ] #Some compute error
339 then #This could happen if the args were not a number
340 echo "expression of total number of processors = $ESCRIPT_NUM_NODES * $ESCRIPT_NUM_PROCS is not numerical."
341 exit 1
342 fi
343
344 #
345 # Test to ensure people aren't trying to combine interactive and multi-process
346 #
347 if ([ ! -z $DO_INTERACTIVE ] || [ $# -eq 0 ]) && ([ $TOTPROC -gt 1 ])
348 then
349 echo "Interactive mode cannot be used with more than one process"
350 exit 1
351 fi
352
353 if [ $TOTPROC -gt 1 ]
354 then
355 if [ "$ESCRIPT_CREATESTDFILES" = "y" ]
356 then
357 PYTHON_MPI=$PYTHON_MPI_REDIRECT
358 else
359 PYTHON_MPI=$PYTHON_MPI_NULL
360 fi
361 else
362 PYTHON_MPI=$PYTHON_MPI_NULL
363 fi
364 #==============================================================================
365 # Must have at least one command-line arg: the python script
366 if [ $# -eq 0 ]
367 then
368 if [ ! -z $DO_BINARY ]
369 then
370 echo "No program to run was specified. Exiting."
371 exit 1
372 else
373 DO_INTERACTIVE=y
374 fi
375 fi
376
377 #==============================================================================
378
379 if [ ! -z $DO_XTERM ]
380 then
381 EXEC_CMD="xterm -e"
382 else
383 EXEC_CMD=""
384 fi
385
386 if [ ! -z "$DO_VALGRIND" ]
387 then
388 VALGRIND_BIN=$(which valgrind 2>/dev/null)
389 if [ $? -eq 0 ]; then
390 LOGDIR=$ESCRIPT_ROOT/valgrind_logs
391 [ -d $LOGDIR ] || mkdir $LOGDIR
392 VG_TOOL=$(echo $DO_VALGRIND | awk '{ s=substr($0,1,1);print s;}')
393 if [ $VG_TOOL = "c" ];
394 then
395 # run callgrind
396 LOGFILE=${LOGDIR}/callgrind.%p.xml
397 VALGRIND="valgrind --tool=callgrind --callgrind-out-file=$LOGFILE"
398 EXEC_CMD="$EXEC_CMD $VALGRIND"
399 elif [ $VG_TOOL = "h" ];
400 then
401 # run cachegrind
402 LOGFILE=${LOGDIR}/cachegrind.%p.xml
403 VALGRIND="valgrind --tool=cachegrind --cachegrind-out-file=$LOGFILE"
404 EXEC_CMD="$EXEC_CMD $VALGRIND"
405 else
406 # run memcheck by default
407 LAST_N=$(ls -1 $LOGDIR|grep "^memcheck"|tail -1|cut -d. -f2)
408 NEW_N=$(printf "%04d" $((LAST_N + 1)))
409 LOGFILE=${LOGDIR}/memcheck.${NEW_N}.xml
410 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"
411 EXEC_CMD="$EXEC_CMD $VALGRIND"
412 fi
413 else
414 echo "Execution with valgrind requested but valgrind not in path!"
415 exit 1
416 fi
417 fi
418
419 if [ ! -z $DO_BINARY ]
420 then
421 EXEC_CMD="$EXEC_CMD $@"
422 else
423 # Check to see if the python version we were compiled with matches the
424 # one of PYTHON_CMD.
425 compfull=$(get_buildvar python_version)
426 compversion=$(echo $compfull | cut -d. -f1,2)
427 compmajor=$(echo $compfull | cut -d. -f1)
428 if [ "$PYTHON_CMD" = "python" ] # if people have customised the command they
429 then # might not want us changing it
430 if [ "$compmajor" = "3" ]
431 then
432 PYTHON_CMD=python3
433 fi
434 fi
435 intversion=$($PYTHON_CMD -c 'from __future__ import print_function;import sys;print("%d.%d"%(sys.version_info[0], sys.version_info[1]))')
436 if [ "$compversion" != "$intversion" ]
437 then
438 echo "Python versions do not match. Escript was compiled for "$compversion"."
439 echo "Current version of Python appears to be "$intversion"."
440 exit 1
441 fi
442 if [ "$MPI_FLAVOUR" = "none" ]
443 then
444 if [ ! -z $DO_INTERACTIVE ]
445 then
446 EXEC_CMD="$EXEC_CMD $PYTHON_CMD -i $@"
447 else
448 EXEC_CMD="$EXEC_CMD $PYTHON_CMD $@"
449 fi
450 else
451 if [ ! -z $DO_INTERACTIVE ]
452 then
453 EXEC_CMD="$EXEC_CMD $PYTHON_MPI -i $@"
454 else
455 EXEC_CMD="$EXEC_CMD $PYTHON_MPI $@"
456 fi
457 fi
458 fi
459 if [ ! -z $ESCRIPT_VERBOSE ]; then echo "Command to be executed is \"$EXEC_CMD\"."; fi
460 #==============================================================================
461 #
462 # now we start to spawn things:
463 #
464 if [ "$WITH_OPENMP" = "1" ]
465 then
466 export OMP_NUM_THREADS=$ESCRIPT_NUM_THREADS
467 EXPORT_ENV="$EXPORT_ENV,OMP_NUM_THREADS"
468 fi
469 EXIT_CODE=1
470 #=============== no MPI ===================================
471 if [ "$MPI_FLAVOUR" = "none" ]
472 then
473 $EXEC_CMD
474 EXIT_CODE=$?
475 #=============== OpenMPI ===================================
476 elif [ "$MPI_FLAVOUR" = "OPENMPI" ]
477 then
478 EXPORT_ENV=$(echo $EXPORT_ENV|sed -e 's/,/ -x /g')
479 if [ ! -z "$HOSTFILE" ]
480 then
481 HOST_LIST=$(sort -u "$HOSTFILE" | awk 'BEGIN{S=""}{if (S == "") { S = $0 } else {S = S "," $0}}END{print S}')
482 CMD="mpirun --gmca mpi_warn_on_fork 0 -x ${EXPORT_ENV} --bynode --bind-to-none --host $HOST_LIST -np $TOTPROC $EXEC_CMD"
483 else
484 CMD="mpirun --gmca mpi_warn_on_fork 0 -x ${EXPORT_ENV} --cpus-per-rank $ESCRIPT_NUM_THREADS --bind-to-core -np $TOTPROC $EXEC_CMD"
485 fi
486 if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi
487 $CMD
488 EXIT_CODE=$?
489
490 #=============== Intel MPI ===================================
491 elif [ "$MPI_FLAVOUR" = "INTELMPI" ]
492 then
493
494 if [ "$WITH_OPENMP" = "1" ]
495 then
496 export I_MPI_PIN_DOMAIN=omp
497 EXPORT_ENV="$EXPORT_ENV,I_MPI_PIN_DOMAIN"
498 fi
499
500 if [ ! -z "$HOSTFILE" ]
501 then
502 CMD="mpirun -hostfile $HOSTFILE -n $TOTPROC -ppn $ESCRIPT_NUM_PROCS $EXEC_CMD"
503 else
504 if [ ! -z $ESCRIPT_VERBOSE ]; then echo "Empty hostfile, running on single node"; fi
505 CMD="mpirun -n 1 -ppn $ESCRIPT_NUM_PROCS $EXEC_CMD"
506 fi
507 if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi
508 $CMD
509 EXIT_CODE=$?
510 #=============== SGI's MPIMPT ===================================
511 elif [ "$MPI_FLAVOUR" = "MPT" ]
512 then
513 export MPI_NUM_MEMORY_REGIONS=0
514 EXPORT_ENV="$EXPORT_ENV,MPI_NUM_MEMORY_REGIONS"
515 if [ ! -z "$HOSTFILE" ]
516 then
517 HOST_LIST=$(awk 'BEGIN{S=""}{if (S == "") { S = $0 } else {S = S "," $0}}END{print S}' "$HOSTFILE")
518 CMD="mpirun $HOST_LIST -np $ESCRIPT_NUM_PROCS $EXEC_CMD"
519 else
520 CMD="mpirun -np $TOTPROC $EXEC_CMD"
521 fi
522 if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi
523 $CMD
524 EXIT_CODE=$?
525 #=============== MPICH ===================================
526 elif [ "$MPI_FLAVOUR" = "MPICH" ]
527 then
528 if [ ! -z "$HOSTFILE" ]
529 then
530 touch "$HOSTFILE2"
531 for i in $(seq $ESCRIPT_NUM_PROCS); do cat "$HOSTFILE" >> "$HOSTFILE2"; done
532 CMD="mpirun -machinefile \"$HOSTFILE2\" -np $TOTPROC $EXEC_CMD"
533 else
534 CMD="mpirun -np $TOTPROC $EXEC_CMD"
535 fi
536 if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi
537 $CMD
538 EXIT_CODE=$?
539 #=============== MPICH2 ===================================
540 elif [ "$MPI_FLAVOUR" = "MPICH2" ]
541 then
542 if [ ! -z "$HOSTFILE" ]
543 then
544 mpdboot -n $ESCRIPT_NUM_NODES -r ssh -f "$HOSTFILE"
545 if [ $? -ne 0 ]
546 then
547 echo "mpdboot with host file $ESCRIPT_HOSTFILE for $ESCRIPT_NUM_NODES nodes failed."
548 exit 1
549 else
550 if [ ! -z $ESCRIPT_VERBOSE ]; then echo "mpdboot was started with host file $HOSTFILE for $ESCRIPT_NUM_NODES nodes."; fi
551 fi
552 else
553 mpdboot -n 1 -r ssh
554 if [ $? -ne 0 ]
555 then
556 echo "mpdboot failed."
557 exit 1
558 else
559 if [ ! -z $ESCRIPT_VERBOSE ]; then echo "mpdboot was started."; fi
560 fi
561 fi
562 CMD="mpiexec -genvlist $EXPORT_ENV -np $TOTPROC $EXEC_CMD"
563 if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi
564 $CMD
565 EXIT_CODE=$?
566 mpdallexit
567 if [ ! -z $ESCRIPT_VERBOSE ]; then echo "mpdallexit executed."; fi
568 else
569 echo "unknown MPI flavour '$MPI_FLAVOUR'."
570 fi
571
572 if [ ! -z "$DO_VALGRIND" ]; then
573 echo "Valgrind log file written to ${LOGFILE}"
574 fi
575
576 exit $EXIT_CODE
577

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