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:
parent
fe97c8fee9
commit
68bed4f1dc
@ -593,7 +593,17 @@ void Foam::UPstream::allocatePstreamCommunicator
|
||||
|
||||
void Foam::UPstream::freePstreamCommunicator(const label communicator)
|
||||
{
|
||||
if (communicator != 0)
|
||||
// Not touching the first communicator (WORLD)
|
||||
// or anything out-of bounds.
|
||||
//
|
||||
// No UPstream communicator indices when MPI is initialized outside
|
||||
// of OpenFOAM - thus needs a bounds check too!
|
||||
|
||||
if
|
||||
(
|
||||
communicator > 0
|
||||
&& (communicator < PstreamGlobals::MPICommunicators_.size())
|
||||
)
|
||||
{
|
||||
if (PstreamGlobals::MPICommunicators_[communicator] != MPI_COMM_NULL)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user