mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: simplify handling of pushed/freed requests
- previously had an additional stack for freedRequests_, which were used to 'remember' locations into the list of outstandingRequests_ that were handled by 'waitRequest()'. This was principally done for sanity checks on shutdown, but we now just test for any outstanding requests that are *not* MPI_REQUEST_NULL instead (much simpler). The framework with freedRequests_ also had a provision to 'recycle' them by popping from that stack, but this is rather fragile since it would only triggered by some collectives (MPI_Iallreduce, MPI_Ialltoall, MPI_Igather, MPI_Iscatter) with no guarantee that these will all be properly removed again. There was also no pruning of extraneous indices. ENH: consolidate internal reset/push of requests - replace duplicate code with inline functions reset_request(), push_request() ENH: null out trailing requests - extra safety (paranoia) for the UPstream::Request versions of finishedRequests(), waitAnyRequest() CONFIG: document nPollProcInterfaces in etc/controlDict - still experimental, but at least make the keyword known
This commit is contained in:
@ -105,6 +105,8 @@ Foam::label Foam::UIPstream::read
|
||||
UPstream::Request* req
|
||||
)
|
||||
{
|
||||
PstreamGlobals::reset_request(req);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "UIPstream::read : starting read from:" << fromProcNo
|
||||
@ -205,26 +207,18 @@ Foam::label Foam::UIPstream::read
|
||||
return 0;
|
||||
}
|
||||
|
||||
profilingPstream::addRequestTime();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "UIPstream::read : started read from:" << fromProcNo
|
||||
<< " tag:" << tag << " read size:" << label(bufSize)
|
||||
<< " commsType:" << UPstream::commsTypeNames[commsType]
|
||||
<<
|
||||
<< " request:" <<
|
||||
(req ? label(-1) : PstreamGlobals::outstandingRequests_.size())
|
||||
<< Foam::endl;
|
||||
}
|
||||
|
||||
if (req)
|
||||
{
|
||||
*req = UPstream::Request(request);
|
||||
}
|
||||
else
|
||||
{
|
||||
PstreamGlobals::outstandingRequests_.push_back(request);
|
||||
}
|
||||
PstreamGlobals::push_request(request, req);
|
||||
profilingPstream::addRequestTime();
|
||||
|
||||
// Assume the message is completely received.
|
||||
return bufSize;
|
||||
|
||||
Reference in New Issue
Block a user