mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Pstream waitRequest ignore placeholder (negative) requests
This commit is contained in:
@ -456,10 +456,12 @@ public:
|
|||||||
|
|
||||||
//- Wait until request i has finished.
|
//- Wait until request i has finished.
|
||||||
// A no-op if parRun() == false
|
// A no-op if parRun() == false
|
||||||
|
// or for placeholder (negative) request indices
|
||||||
static void waitRequest(const label i);
|
static void waitRequest(const label i);
|
||||||
|
|
||||||
//- Non-blocking comms: has request i finished?
|
//- Non-blocking comms: has request i finished?
|
||||||
// A no-op and returns true if parRun() == false
|
// A no-op and returns true if parRun() == false
|
||||||
|
// or for placeholder (negative) request indices
|
||||||
static bool finishedRequest(const label i);
|
static bool finishedRequest(const label i);
|
||||||
|
|
||||||
static int allocateTag(const char* const msg = nullptr);
|
static int allocateTag(const char* const msg = nullptr);
|
||||||
|
|||||||
@ -453,7 +453,7 @@ void Foam::UPstream::shutdown(int errNo)
|
|||||||
// Clean mpi communicators
|
// Clean mpi communicators
|
||||||
forAll(myProcNo_, communicator)
|
forAll(myProcNo_, communicator)
|
||||||
{
|
{
|
||||||
if (myProcNo_[communicator] != -1)
|
if (myProcNo_[communicator] >= 0)
|
||||||
{
|
{
|
||||||
freePstreamCommunicator(communicator);
|
freePstreamCommunicator(communicator);
|
||||||
}
|
}
|
||||||
@ -730,9 +730,9 @@ void Foam::UPstream::waitRequests(const label start)
|
|||||||
|
|
||||||
void Foam::UPstream::waitRequest(const label i)
|
void Foam::UPstream::waitRequest(const label i)
|
||||||
{
|
{
|
||||||
if (!UPstream::parRun())
|
if (!UPstream::parRun() || i < 0)
|
||||||
{
|
{
|
||||||
return; // No-op for non-parallel
|
return; // No-op for non-parallel, or placeholder indices
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -741,13 +741,13 @@ void Foam::UPstream::waitRequest(const label i)
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < 0 || i >= PstreamGlobals::outstandingRequests_.size())
|
if (i >= PstreamGlobals::outstandingRequests_.size())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "There are " << PstreamGlobals::outstandingRequests_.size()
|
<< "You asked for request=" << i
|
||||||
<< " outstanding send requests and you are asking for i=" << i
|
<< " from " << PstreamGlobals::outstandingRequests_.size()
|
||||||
<< nl
|
<< " outstanding requests!" << nl
|
||||||
<< "Maybe you are mixing blocking/non-blocking comms?"
|
<< "Mixing use of blocking/non-blocking comms?"
|
||||||
<< Foam::abort(FatalError);
|
<< Foam::abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -781,9 +781,9 @@ void Foam::UPstream::waitRequest(const label i)
|
|||||||
|
|
||||||
bool Foam::UPstream::finishedRequest(const label i)
|
bool Foam::UPstream::finishedRequest(const label i)
|
||||||
{
|
{
|
||||||
if (!UPstream::parRun())
|
if (!UPstream::parRun() || i < 0)
|
||||||
{
|
{
|
||||||
return true; // No-op for non-parallel
|
return true; // No-op for non-parallel, or placeholder indices
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -792,13 +792,13 @@ bool Foam::UPstream::finishedRequest(const label i)
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < 0 || i >= PstreamGlobals::outstandingRequests_.size())
|
if (i >= PstreamGlobals::outstandingRequests_.size())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "There are " << PstreamGlobals::outstandingRequests_.size()
|
<< "You asked for request=" << i
|
||||||
<< " outstanding send requests and you are asking for i=" << i
|
<< " from " << PstreamGlobals::outstandingRequests_.size()
|
||||||
<< nl
|
<< " outstanding requests!" << nl
|
||||||
<< "Maybe you are mixing blocking/non-blocking comms?"
|
<< "Mixing use of blocking/non-blocking comms?"
|
||||||
<< Foam::abort(FatalError);
|
<< Foam::abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user