45 #ifdef LIBMESH_HAVE_MPI
46 _request(MPI_REQUEST_NULL),
50 post_wait_work(nullptr)
55 post_wait_work(nullptr)
59 _request(other._request),
60 post_wait_work(other.post_wait_work)
84 libmesh_assert(!item);
123 LOG_SCOPE(
"wait()",
"Parallel::Request");
132 #ifdef LIBMESH_HAVE_MPI 142 libmesh_assert (item);
155 #ifdef LIBMESH_HAVE_MPI 159 (MPI_Test (&
_request, &val, MPI_STATUS_IGNORE));
163 libmesh_assert (
_request == MPI_REQUEST_NULL);
164 libmesh_assert_equal_to (val, 1);
173 #ifdef LIBMESH_HAVE_MPI 179 (MPI_Test (&
_request, &val, &stat));
198 new_prior_req->_prior_request.reset(this->
_prior_request.release());
208 std::pair<std::vector <PostWaitWork * >,
unsigned int>
209 (std::vector <PostWaitWork * >(), 1);
213 void wait (std::vector<Request> & r)
215 for (std::size_t i=0; i<r.size(); i++)
219 std::size_t
waitany (std::vector<Request> & r)
221 libmesh_assert(!r.empty());
224 int r_size = cast_int<int>(r.size());
225 std::vector<request> raw(r_size);
226 for (
int i=0; i != r_size; ++i)
233 raw[i] = *root->
get();
236 bool only_priors_completed =
false;
242 #ifdef LIBMESH_HAVE_MPI 244 (MPI_Waitany(r_size, raw.data(), &index, MPI_STATUS_IGNORE));
247 Request * completed = &r[index];
254 only_priors_completed =
true;
265 libmesh_assert (item);
271 next->_prior_request.reset(
nullptr);
272 raw[index] = *
next->get();
274 }
while(only_priors_completed);
void wait(std::vector< Request > &r)
std::pair< std::vector< PostWaitWork *>, unsigned int > * post_wait_work
void add_prior_request(const Request &req)
std::size_t waitany(std::vector< Request > &r)
Request & operator=(const Request &other)
void add_post_wait_work(PostWaitWork *work)
std::unique_ptr< Request > _prior_request