Boost-Geometry-Utils
view release on metacpan or search on metacpan
src/boost/mpi/nonblocking.hpp view on Meta::CPAN
all_trivial_requests =
all_trivial_requests
&& !current->m_handler
&& current->m_requests[1] == MPI_REQUEST_NULL;
// Move to the next request.
++n;
if (++current == last) {
// We have reached the end of the list. If all requests thus far
// have been trivial, we can call MPI_Waitany directly, because
// it may be more efficient than our busy-wait semantics.
if (all_trivial_requests) {
std::vector<MPI_Request> requests;
requests.reserve(n);
for (current = first; current != last; ++current)
requests.push_back(current->m_requests[0]);
// Let MPI wait until one of these operations completes.
int index;
status stat;
BOOST_MPI_CHECK_RESULT(MPI_Waitany,
src/boost/mpi/nonblocking.hpp view on Meta::CPAN
boost::throw_exception(exception("MPI_Waitany", MPI_ERR_REQUEST));
// Find the iterator corresponding to the completed request.
current = first;
advance(current, index);
current->m_requests[0] = requests[index];
return std::make_pair(stat, current);
}
// There are some nontrivial requests, so we must continue our
// busy waiting loop.
n = 0;
current = first;
all_trivial_requests = true;
}
}
// We cannot ever get here
BOOST_ASSERT(false);
}
src/boost/mpi/nonblocking.hpp view on Meta::CPAN
if (start_of_completed != last) {
// We have satisfied some requests. Make the order of the
// completed requests match that of the status objects we've
// already emitted and we're done.
std::reverse(start_of_completed, last);
return std::make_pair(out, start_of_completed);
}
// We have reached the end of the list. If all requests thus far
// have been trivial, we can call MPI_Waitsome directly, because
// it may be more efficient than our busy-wait semantics.
if (all_trivial_requests) {
std::vector<MPI_Request> requests;
std::vector<int> indices(n);
std::vector<MPI_Status> stats(n);
requests.reserve(n);
for (current = first; current != last; ++current)
requests.push_back(current->m_requests[0]);
// Let MPI wait until some of these operations complete.
int num_completed;
src/boost/mpi/nonblocking.hpp view on Meta::CPAN
}
// We have satisfied some requests. Make the order of the
// completed requests match that of the status objects we've
// already emitted and we're done.
std::reverse(start_of_completed, last);
return std::make_pair(out, start_of_completed);
}
// There are some nontrivial requests, so we must continue our
// busy waiting loop.
n = 0;
current = first;
}
}
// We cannot ever get here
BOOST_ASSERT(false);
}
/**
src/boost/mpi/nonblocking.hpp view on Meta::CPAN
// Move to the next request.
++n;
if (++current == start_of_completed) {
// If we have satisfied some requests, we're done.
if (start_of_completed != last)
return start_of_completed;
// We have reached the end of the list. If all requests thus far
// have been trivial, we can call MPI_Waitsome directly, because
// it may be more efficient than our busy-wait semantics.
if (all_trivial_requests) {
std::vector<MPI_Request> requests;
std::vector<int> indices(n);
requests.reserve(n);
for (current = first; current != last; ++current)
requests.push_back(current->m_requests[0]);
// Let MPI wait until some of these operations complete.
int num_completed;
BOOST_MPI_CHECK_RESULT(MPI_Waitsome,
src/boost/mpi/nonblocking.hpp view on Meta::CPAN
current->m_requests[0] = requests[indices[index]];
--start_of_completed;
iter_swap(current, start_of_completed);
}
// We have satisfied some requests, so we are done.
return start_of_completed;
}
// There are some nontrivial requests, so we must continue our
// busy waiting loop.
n = 0;
current = first;
}
}
// We cannot ever get here
BOOST_ASSERT(false);
}
/**
( run in 0.362 second using v1.01-cache-2.11-cpan-87723dcf8b7 )