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
fd1661ae15
commit
20c7f0970d
@ -641,7 +641,16 @@ void Foam::UPstream::freePstreamCommunicator(const label communicator)
|
||||
}
|
||||
|
||||
// Not touching the first two communicators (SELF, WORLD)
|
||||
if (communicator > 1)
|
||||
// or anything out-of bounds.
|
||||
//
|
||||
// No UPstream communicator indices when MPI is initialized outside
|
||||
// of OpenFOAM - thus needs a bounds check too!
|
||||
|
||||
if
|
||||
(
|
||||
communicator > 1
|
||||
&& (communicator < PstreamGlobals::MPICommunicators_.size())
|
||||
)
|
||||
{
|
||||
if (MPI_COMM_NULL != PstreamGlobals::MPICommunicators_[communicator])
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user