From 52df9a2fee53f27549cb3d9c918da110f8a0285d Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Tue, 4 Jun 2019 11:22:21 +0200
Subject: [PATCH] TUT: use mpiexec instead of mpirun for msmpi in RunFunctions
 (#1238)

---
 bin/tools/RunFunctions | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions
index d1a4007c475..12f0265c2fb 100644
--- a/bin/tools/RunFunctions
+++ b/bin/tools/RunFunctions
@@ -241,6 +241,12 @@ runParallel()
     # Any additional parsed arguments (eg, decomposeParDict)
     local appArgs="-parallel"
 
+    local mpirun="mpirun"
+    if [ "$FOAM_MPI" = msmpi ]
+    then
+        mpirun="mpiexec"
+    fi
+
     # Parse options until executable is encountered
     while [ $# -gt 0 -a -z "$appRun" ]
     do
@@ -287,11 +293,11 @@ runParallel()
         if [ "$logMode" = append ]
         then
         (
-            mpirun -np $nProcs $appRun $appArgs "$@" </dev/null >> $logFile 2>&1
+            $mpirun -np $nProcs $appRun $appArgs "$@" </dev/null >> $logFile 2>&1
         )
         else
         (
-            mpirun -np $nProcs $appRun $appArgs "$@" </dev/null > $logFile 2>&1
+            $mpirun -np $nProcs $appRun $appArgs "$@" </dev/null > $logFile 2>&1
         )
         fi
     fi
-- 
GitLab