2
0
mirror of https://github.com/boostorg/mpi.git synced 2026-02-25 04:22:17 +00:00

Fixed deadlock involving wait_any and intel MPI.

In wait_any, we need to test for compound recv of serialized object that just got the size but not the body (that is, request[1] == null & handler != null).

Note that in:
if (current->m_requests[0] != MPI_REQUEST_NULL &&
        (current->m_requests[1] != MPI_REQUEST_NULL ||
         current->m_handler)) {
      if (optional<status> result = current->test())
        return std::make_pair(*result, current);
    }

I suspect the 3 line test should be removed and every thng handled in request::test (which is supposed to tell wheter we have a complete request).
But I have no idea why it was done like that in the first place.
(cherry picked from commit ed4852863a)
This commit is contained in:
Alain Miniussi
2014-09-10 13:37:11 +02:00
parent f6f21efe31
commit accbafc66f

View File

@@ -60,9 +60,11 @@ wait_any(ForwardIterator first, ForwardIterator last)
while (true) {
// Check if we have found a completed request. If so, return it.
if (current->m_requests[0] != MPI_REQUEST_NULL &&
current->m_requests[1] != MPI_REQUEST_NULL)
(current->m_requests[1] != MPI_REQUEST_NULL ||
current->m_handler)) {
if (optional<status> result = current->test())
return std::make_pair(*result, current);
}
// Check if this request (and all others before it) are "trivial"
// requests, e.g., they can be represented with a single