From accbafc66f767e7e81d9103b39ecbc911290cdf1 Mon Sep 17 00:00:00 2001 From: Alain Miniussi Date: Wed, 10 Sep 2014 13:37:11 +0200 Subject: [PATCH] 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 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 ed4852863a59b8ae270bddac949f553a8200146a) --- include/boost/mpi/nonblocking.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/boost/mpi/nonblocking.hpp b/include/boost/mpi/nonblocking.hpp index 09bc833..1fc1ecd 100644 --- a/include/boost/mpi/nonblocking.hpp +++ b/include/boost/mpi/nonblocking.hpp @@ -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 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