mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: UPstream::shutdown misbehaves with external initialisation (fixes #2808)
- freeCommmunicatorComponents needs an additional bounds check. When MPI is initialized outside of OpenFOAM, there are no UPstream communicator equivalents
This commit is contained in:
@ -695,11 +695,20 @@ void Foam::UPstream::freeCommunicatorComponents(const label index)
|
||||
}
|
||||
|
||||
// Not touching the first two communicators (SELF, WORLD)
|
||||
if (index > 1)
|
||||
// or anything out-of bounds.
|
||||
//
|
||||
// No UPstream communicator indices when MPI is initialized outside
|
||||
// of OpenFOAM - thus needs a bounds check too!
|
||||
|
||||
if
|
||||
(
|
||||
index > 1
|
||||
&& index < PstreamGlobals::MPICommunicators_.size()
|
||||
)
|
||||
{
|
||||
if
|
||||
(
|
||||
(true == PstreamGlobals::pendingMPIFree_[index])
|
||||
PstreamGlobals::pendingMPIFree_[index]
|
||||
&& (MPI_COMM_NULL != PstreamGlobals::MPICommunicators_[index])
|
||||
)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user