/[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 2365 by gross, Mon Apr 6 01:25:25 2009 UTC revision 2366 by gross, Mon Apr 6 03:10:55 2009 UTC
# Line 23  CURDIR=`pwd` Line 23  CURDIR=`pwd`
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  HOSTFILE=/tmp/escript.$$  HOSTFILE=/tmp/escript.$$
26    HOSTFILE2=/tmp/escript2.$$
27    
28  #Begin finding ESCRIPT_ROOT  #Begin finding ESCRIPT_ROOT
29  if [ $STDLOCATION != 0 ]  if [ $STDLOCATION != 0 ]
# Line 169  if [ ! -z $ESCRIPT_VERBOSE ] && [  $WITH Line 170  if [ ! -z $ESCRIPT_VERBOSE ] && [  $WITH
170  export PATH=$EXTRA_PATH:$PATH  export PATH=$EXTRA_PATH:$PATH
171  export LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:$LD_LIBRARY_PATH  export LD_LIBRARY_PATH=$EXTRA_LD_LIBRARY_PATH:$LD_LIBRARY_PATH
172  export PYTHONPATH=$EXTRA_PYTHONPATH:$PYTHONPATH  export PYTHONPATH=$EXTRA_PYTHONPATH:$PYTHONPATH
173  EXPORT_ENV="PATH, LD_LIBRARY_PATH, PYTHONPATH"  EXPORT_ENV="PATH,LD_LIBRARY_PATH,PYTHONPATH"
174  if [ `uname` == Darwin ]  if [ `uname` == Darwin ]
175  then  then
176      export DYLD_LIBRARY_PATH=$EXTRA_DYLD_LIBRARY_PATH:$EXTRA_LD_LIBRARY_PATH:$DYLD_LIBRARY_PATH      export DYLD_LIBRARY_PATH=$EXTRA_DYLD_LIBRARY_PATH:$EXTRA_LD_LIBRARY_PATH:$DYLD_LIBRARY_PATH
177      EXPORT_ENV="$EXPORT_ENV, DYLD_LIBRARY_PATH"      EXPORT_ENV="$EXPORT_ENV,DYLD_LIBRARY_PATH"
178  fi  fi
179  if [ ! -z $ESCRIPT_VERBOSE  ]  if [ ! -z $ESCRIPT_VERBOSE  ]
180  then  then
# Line 324  if [ ! -z $ESCRIPT_VERBOSE ]; then echo Line 325  if [ ! -z $ESCRIPT_VERBOSE ]; then echo
325  if [  $WITH_OPENMP == "y"  ]  if [  $WITH_OPENMP == "y"  ]
326  then  then
327     export OMP_NUM_THREADS=$ESCRIPT_NUM_THREADS     export OMP_NUM_THREADS=$ESCRIPT_NUM_THREADS
328     EXPORT_ENV="$EXPORT_ENV, OMP_NUM_THREADS"     EXPORT_ENV="$EXPORT_ENV,OMP_NUM_THREADS"
329  fi  fi
330  EXIT_CODE=1  EXIT_CODE=1
331  #=============== no MPI ===================================  #=============== no MPI ===================================
# Line 373  then Line 374  then
374  elif [ $MPI_FLAVOUR == "MPT" ]  elif [ $MPI_FLAVOUR == "MPT" ]
375  then  then
376     export MPI_NUM_MEMORY_REGIONS=0     export MPI_NUM_MEMORY_REGIONS=0
377     EXPORT_ENV="$EXPORT_ENV, MPI_NUM_MEMORY_REGIONS"     EXPORT_ENV="$EXPORT_ENV,MPI_NUM_MEMORY_REGIONS"
378     if [ ! -z $HOSTFILE ]     if [ ! -z $HOSTFILE ]
379     then     then
380        HOST_LIST=`awk 'BEGIN{S=""}{if (S == "") { S = $0 } else {S = S "," $0}}END{print S}' $HOSTFILE`        HOST_LIST=`awk 'BEGIN{S=""}{if (S == "") { S = $0 } else {S = S "," $0}}END{print S}' $HOSTFILE`
# Line 384  then Line 385  then
385     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi     if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi
386     $CMD     $CMD
387     EXIT_CODE=$?     EXIT_CODE=$?
388  #=============== SGI's MPICH ===================================  #=============== MPICH ===================================
389  elif [ $MPI_FLAVOUR == "MPICH" ]  elif [ $MPI_FLAVOUR == "MPICH" ]
390  then  then
391     echo "MPICH not implemented yet."     if [ ! -z $HOSTFILE ]
392       then
393          touch $HOSTFILE2
394          for (( i=1;i<=$ESCRIPT_NUM_PROCS;i+=1 )) ; do cat $HOSTFILE >> $HOSTFILE2  ; done
395          CMD="mpirun -machinefile $HOSTFILE2  -np $TOTPROC $EXEC_CMD"
396       else
397          CMD="mpirun -np $TOTPROC $EXEC_CMD"
398       fi
399       if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi
400       $CMD
401       EXIT_CODE=$?
402    #=============== MPICH2 ===================================
403    elif [ $MPI_FLAVOUR == "MPICH2" ]
404    then
405       if [ ! -z $HOSTFILE ]
406       then
407          HOST_LIST=`awk 'BEGIN{S=""; N='$ESCRIPT_NUM_PROCS'}{ S = S " " $0 " " N }END{print S}' $HOSTFILE`
408          CMD="mpiexec -hosts $ESCRIPT_NUM_NODES $HOST_LIST -genvlist $EXPORT_ENV $EXEC_CMD"
409       else
410          CMD="mpiexec -np $TOTPROC -genvlist EXPORT_ENV $EXEC_CMD"
411       fi
412       if [ ! -z $ESCRIPT_VERBOSE ]; then echo "MPI command is \"$CMD\"."; fi
413       $CMD
414       EXIT_CODE=$?
415  else  else
416     echo "unknown MPI falvour $MPI_FLAVOUR."     echo "unknown MPI falvour $MPI_FLAVOUR."
417  fi  fi

Legend:
Removed from v.2365  
changed lines
  Added in v.2366

  ViewVC Help
Powered by ViewVC 1.1.26