diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions index e350b44ad..50ddc1ed3 100644 --- a/bin/tools/RunFunctions +++ b/bin/tools/RunFunctions @@ -75,7 +75,14 @@ runParallel () echo "$APP_NAME already run on $PWD: remove log file to run" else 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 } diff --git a/etc/settings.sh b/etc/settings.sh index 2e28f05fd..13c4de270 100755 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -248,7 +248,13 @@ MACPORTOPENMPI) export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$FOAM_MPI _foamAddLib $libDir unset libDir - ;; + + which mpirun >/dev/null + if [ $? -ne 0 ] + then + export WM_MPIRUN_PROG=mpirun-openmpi-$WM_MACPORT_MPI_VERSION + fi + ;; MACPORTMPICH) export FOAM_MPI=mpich-macports-$WM_MACPORT_MPI_VERSION @@ -260,6 +266,11 @@ MACPORTMPICH) _foamAddLib $libDir unset libDir + which mpirun >/dev/null + if [ $? -ne 0 ] + then + export WM_MPIRUN_PROG=mpirun-mpich-$WM_MACPORT_MPI_VERSION + fi ;; SYSTEMOPENMPI)