CONFIG: runParallel with --oversubscribe for openmpi

- not always required, but useful when running some tutorials locally
This commit is contained in:
Mark Olesen 2023-08-30 19:56:12 +02:00
parent f800ccc3d9
commit df6de6ed33
2 changed files with 12 additions and 7 deletions

View File

@ -429,7 +429,7 @@ unset cmd
case "$WM_MPLIB" in
*OPENMPI*)
cmd="mpirun -app $PWD/mpirun.schema </dev/null"
cmd="mpirun --oversubscribe -app $PWD/mpirun.schema </dev/null"
;;
MPICH)
cmd="mpiexec"

View File

@ -304,16 +304,21 @@ runApplication()
#
runParallel()
{
local appName appRun optValue logFile logMode nProcs
local appName appRun optValue logFile logMode
local mpiopts nProcs
# Any additional parsed arguments (eg, decomposeParDict)
local appArgs="-parallel"
local mpirun="mpirun"
if [ "$FOAM_MPI" = msmpi ]
then
case "$FOAM_MPI" in
(msmpi*)
mpirun="mpiexec"
fi
;;
(*openmpi*)
mpiopts="--oversubscribe"
;;
esac
# Parse options until executable is encountered
while [ "$#" -gt 0 ] && [ -z "$appRun" ]
@ -378,11 +383,11 @@ runParallel()
if [ "$logMode" = append ]
then
(
$mpirun -n $nProcs $appRun $appArgs "$@" </dev/null >> $logFile 2>&1
"$mpirun" $mpiopts -n "${nProcs:?}" $appRun $appArgs "$@" </dev/null >> $logFile 2>&1
)
else
(
$mpirun -n $nProcs $appRun $appArgs "$@" </dev/null > $logFile 2>&1
"$mpirun" $mpiopts -n "${nProcs:?}" $appRun $appArgs "$@" </dev/null > $logFile 2>&1
)
fi
fi