- /* Sometimes we need to re-insert MPI_REQUEST_NULL but we still need src,dst and tag */
- void addNullRequest(int src, int dst, int tag)
- {
- store.insert({req_key_t(MPI_COMM_WORLD->group()->actor(src) - 1, MPI_COMM_WORLD->group()->actor(dst) - 1, tag),
- MPI_REQUEST_NULL});
- }
+ /* Sometimes we need to re-insert MPI_REQUEST_NULL but we still need src,dst and tag */
+ void addNullRequest(int src, int dst, int tag)
+ {
+ int src_pid = MPI_COMM_WORLD->group()->actor(src) - 1;
+ int dest_pid = MPI_COMM_WORLD->group()->actor(dst) - 1;
+ auto it = store.find(req_key_t(src_pid, dest_pid, tag));
+ if (it == store.end())
+ store.insert({req_key_t(src_pid, dest_pid, tag), std::list<MPI_Request>()});
+ store[req_key_t(src_pid, dest_pid, tag)].push_back(MPI_REQUEST_NULL);
+ }