summaryrefslogtreecommitdiff
path: root/boost/mpi/nonblocking.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/mpi/nonblocking.hpp')
-rw-r--r--boost/mpi/nonblocking.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/boost/mpi/nonblocking.hpp b/boost/mpi/nonblocking.hpp
index ba024c7df4..a2d2e34313 100644
--- a/boost/mpi/nonblocking.hpp
+++ b/boost/mpi/nonblocking.hpp
@@ -59,8 +59,10 @@ wait_any(ForwardIterator first, ForwardIterator last)
ForwardIterator current = first;
while (true) {
// Check if we have found a completed request. If so, return it.
- if (optional<status> result = current->test())
- return std::make_pair(*result, current);
+ if (current->m_requests[0] != MPI_REQUEST_NULL &&
+ current->m_requests[1] != MPI_REQUEST_NULL)
+ 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