req_storage_t store;
public:
- RequestStorage() {}
- int size() const { return store.size(); }
+ RequestStorage() = default;
+ int size() const { return store.size(); }
- req_storage_t& get_store()
- {
- return store;
- }
+ req_storage_t& get_store() { return store; }
- void get_requests(std::vector<MPI_Request>& vec) const
- {
- for (auto const& pair : store) {
- auto& req = pair.second;
- auto my_proc_id = simgrid::s4u::this_actor::get_pid();
- if (req != MPI_REQUEST_NULL && (req->src() == my_proc_id || req->dst() == my_proc_id)) {
- vec.push_back(pair.second);
- pair.second->print_request("MM");
- }
+ void get_requests(std::vector<MPI_Request>& vec) const
+ {
+ for (auto const& pair : store) {
+ auto& req = pair.second;
+ auto my_proc_id = simgrid::s4u::this_actor::get_pid();
+ if (req != MPI_REQUEST_NULL && (req->src() == my_proc_id || req->dst() == my_proc_id)) {
+ vec.push_back(pair.second);
+ pair.second->print_request("MM");
}
}
+ }
MPI_Request find(int src, int dst, int tag)
{
- req_storage_t::iterator it = store.find(req_key_t(src, dst, tag));
+ auto it = store.find(req_key_t(src, dst, tag));
return (it == store.end()) ? MPI_REQUEST_NULL : it->second;
}
req_storage.get_requests(reqs);
for (auto const& req : reqs) {
if (req && (req->flags() & MPI_REQ_RECV)) {
- sender_receiver.push_back({req->src(), req->dst()});
+ sender_receiver.emplace_back(req->src(), req->dst());
}
}
Request::waitall(count_requests, &(reqs.data())[0], MPI_STATUSES_IGNORE);