Allow specification of different mpirun to be used by the RunFunctions - Used on Mac but may be beneficial for other systems too

This commit is contained in:
Bernhard F.W. Gschaider 2014-05-29 18:09:23 +02:00
parent d868141816
commit 1cb3e1f77a
2 changed files with 20 additions and 2 deletions

View file

@ -75,7 +75,14 @@ runParallel ()
echo "$APP_NAME already run on $PWD: remove log file to run" echo "$APP_NAME already run on $PWD: remove log file to run"
else else
echo "Running $APP_NAME in parallel on $PWD using $1 processes" echo "Running $APP_NAME in parallel on $PWD using $1 processes"
( mpirun -np $1 $APP_RUN -parallel < /dev/null > $LOG_NAME 2>&1 ) if [ -z "$WM_MPIRUN_PROG" ]
then
mpirunProg=mpirun
else
# Allow exceentric systems to override the hardcoded mpirun
mpirunProg=$WM_MPIRUN_PROG
fi
( $mpirunProg -np $1 $APP_RUN -parallel < /dev/null > $LOG_NAME 2>&1 )
fi fi
} }

View file

@ -248,7 +248,13 @@ MACPORTOPENMPI)
export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$FOAM_MPI export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$FOAM_MPI
_foamAddLib $libDir _foamAddLib $libDir
unset libDir unset libDir
;;
which mpirun >/dev/null
if [ $? -ne 0 ]
then
export WM_MPIRUN_PROG=mpirun-openmpi-$WM_MACPORT_MPI_VERSION
fi
;;
MACPORTMPICH) MACPORTMPICH)
export FOAM_MPI=mpich-macports-$WM_MACPORT_MPI_VERSION export FOAM_MPI=mpich-macports-$WM_MACPORT_MPI_VERSION
@ -260,6 +266,11 @@ MACPORTMPICH)
_foamAddLib $libDir _foamAddLib $libDir
unset libDir unset libDir
which mpirun >/dev/null
if [ $? -ne 0 ]
then
export WM_MPIRUN_PROG=mpirun-mpich-$WM_MACPORT_MPI_VERSION
fi
;; ;;
SYSTEMOPENMPI) SYSTEMOPENMPI)