/[escript]/trunk/run-escript.in
ViewVC logotype

Diff of /trunk/run-escript.in

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

revision 4993 by sshaw, Thu Jun 5 03:04:56 2014 UTC revision 5239 by caltinay, Thu Oct 30 05:36:00 2014 UTC
# Line 22  CURDIR=$(pwd) Line 22  CURDIR=$(pwd)
22  #Environment vars which control operations:  #Environment vars which control operations:
23  # ESCRIPT_NUM_NODES, ESCRIPT_NUM_PROCS, ESCRIPT_NUM_THREADS, ESCRIPT_HOSTFILE, ESCRIPT_CREATESTDFILES  # 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.$$  HOSTFILE=/tmp/escript.$USER.$$
36  HOSTFILE2=/tmp/escript2.$USER.$$  HOSTFILE2=/tmp/escript2.$USER.$$
37    
# Line 140  Usage: run-escript [options] script.py [ Line 150  Usage: run-escript [options] script.py [
150      -o      redirect output from MPI to files      -o      redirect output from MPI to files
151      -v      print diagnostics      -v      print diagnostics
152      -x      run in new xterm instance      -x      run in new xterm instance
153      -m tool     run with valgrind {tool=m[emcheck]/c[allgrind]}      -m tool     run with valgrind {tool=m[emcheck]/c[allgrind]/[cac]h[egrind]}
154      script.py   Your python script      script.py   Your python script
155      arguments...    The optional command-line arguments to your script      arguments...    The optional command-line arguments to your script
156  "  "
# Line 386  then Line 396  then
396              LOGFILE=${LOGDIR}/callgrind.%p.xml              LOGFILE=${LOGDIR}/callgrind.%p.xml
397              VALGRIND="valgrind --tool=callgrind --callgrind-out-file=$LOGFILE"              VALGRIND="valgrind --tool=callgrind --callgrind-out-file=$LOGFILE"
398              EXEC_CMD="$EXEC_CMD $VALGRIND"              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          else
406              # run memcheck by default              # run memcheck by default
407              LAST_N=$(ls -1 $LOGDIR|grep "^memcheck"|tail -1|cut -d. -f2)              LAST_N=$(ls -1 $LOGDIR|grep "^memcheck"|tail -1|cut -d. -f2)
# Line 465  then Line 481  then
481        HOST_LIST=$(sort -u "$HOSTFILE" | awk 'BEGIN{S=""}{if (S == "") { S = $0 } else {S = S "," $0}}END{print S}')        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"        CMD="mpirun --gmca mpi_warn_on_fork 0 -x ${EXPORT_ENV} --bynode --bind-to-none --host $HOST_LIST -np $TOTPROC $EXEC_CMD"
483     else     else
484        CMD="mpirun --gmca mpi_warn_on_fork 0 -x ${EXPORT_ENV} --cpus-per-rank $ESCRIPT_NUM_THREADS -np $TOTPROC $EXEC_CMD"        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     fi
486     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi
487     $CMD     $CMD

Legend:
Removed from v.4993  
changed lines
  Added in v.5239

  ViewVC Help
Powered by ViewVC 1.1.26