independent handling of MPI_Request
The current handling of MPI_Request is generally based on the idea of handling multiple requests and generally has this type of coding:
const label startOfRequests = UPstream::nRequests();
... setup receives
... setup sends
UPstream::waitRequests(startOfRequests);
However, when we start wishing to intersperse individual non-blocking transfers, we end up with this type of stuff:
if
(
outstandingRequest >= 0
&& outstandingRequest < UPstream::nRequests()
)
{
UPstream::waitRequest(outstandingRequest);
}
The integer value of outstandingRequest
is from somewhere within the overall list of requests, and internally there is various bits of logic to recycle the freedRequests, with side-effect of allToAll communication being used to re-align things. In summary: a bit of a mess.