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 case "$WM_MPLIB" in
*OPENMPI*) *OPENMPI*)
cmd="mpirun -app $PWD/mpirun.schema </dev/null" cmd="mpirun --oversubscribe -app $PWD/mpirun.schema </dev/null"
;; ;;
MPICH) MPICH)
cmd="mpiexec" cmd="mpiexec"

View File

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