/[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 4973 by sshaw, Wed May 28 06:02:38 2014 UTC revision 5102 by caltinay, Wed Jul 16 00:46:22 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 465  then Line 475  then
475        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}')
476        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"
477     else     else
478        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"
479     fi     fi
480     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi
481     $CMD     $CMD
# Line 483  then Line 493  then
493    
494     if [ ! -z "$HOSTFILE" ]     if [ ! -z "$HOSTFILE" ]
495     then     then
496        mpdboot -n $ESCRIPT_NUM_NODES -r ssh -f "$HOSTFILE"          CMD="mpirun -hostfile $HOSTFILE -n $TOTPROC -ppn $ESCRIPT_NUM_PROCS $EXEC_CMD"
       if [ $? -ne 0 ]  
       then  
          echo "mpdboot with host file $HOSTFILE for $ESCRIPT_NUM_NODES nodes failed."  
          exit 1  
       else  
           if [ ! -z $ESCRIPT_VERBOSE ]; then echo "mpdboot was started with host file $HOSTFILE for $ESCRIPT_NUM_NODES nodes."; fi  
       fi  
497     else     else
498        mpdboot -n 1 -r ssh          if [ ! -z $ESCRIPT_VERBOSE ]; then echo "Empty hostfile, running on single node"; fi
499        if [ $? -ne 0 ]          CMD="mpirun -n 1 -ppn $ESCRIPT_NUM_PROCS $EXEC_CMD"
       then  
          echo "mpdboot failed."  
          exit 1  
       else  
           if [ ! -z $ESCRIPT_VERBOSE ]; then echo "mpdboot was started."; fi  
       fi  
500     fi     fi
    CMD="mpiexec -perhost $ESCRIPT_NUM_PROCS -envall -n $TOTPROC $EXEC_CMD"  
501     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi
502     $CMD     $CMD
503     EXIT_CODE=$?     EXIT_CODE=$?
    mpdallexit  
    if [ ! -z $ESCRIPT_VERBOSE ]; then echo "mpdallexit executed."; fi  
504  #=============== SGI's MPIMPT ===================================  #=============== SGI's MPIMPT ===================================
505  elif [ "$MPI_FLAVOUR" = "MPT" ]  elif [ "$MPI_FLAVOUR" = "MPT" ]
506  then  then
# Line 544  then Line 538  then
538           mpdboot -n $ESCRIPT_NUM_NODES -r ssh -f "$HOSTFILE"           mpdboot -n $ESCRIPT_NUM_NODES -r ssh -f "$HOSTFILE"
539           if [ $? -ne 0 ]           if [ $? -ne 0 ]
540           then           then
541              echo "mpdboot with host file $HOSTFILE for $ESCRIPT_NUM_NODES nodes failed."              echo "mpdboot with host file $ESCRIPT_HOSTFILE for $ESCRIPT_NUM_NODES nodes failed."
542              exit 1              exit 1
543           else           else
544               if [ ! -z $ESCRIPT_VERBOSE ]; then echo "mpdboot was started with host file $HOSTFILE for $ESCRIPT_NUM_NODES nodes."; fi               if [ ! -z $ESCRIPT_VERBOSE ]; then echo "mpdboot was started with host file $HOSTFILE for $ESCRIPT_NUM_NODES nodes."; fi

Legend:
Removed from v.4973  
changed lines
  Added in v.5102

  ViewVC Help
Powered by ViewVC 1.1.26