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