From 1cb3e1f77af99ba2975780b3753ebdb882dd2018 Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Thu, 29 May 2014 18:09:23 +0200 Subject: [PATCH] Allow specification of different mpirun to be used by the RunFunctions - Used on Mac but may be beneficial for other systems too --- bin/tools/RunFunctions | 9 ++++++++- etc/settings.sh | 13 ++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) 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)