|
@@ -110,10 +110,12 @@ template <class SType> void* Comm::Isend(ConstIterator<SType> sbuf, Long scount,
|
|
|
return &request;
|
|
|
#else
|
|
|
auto it = recv_req.find(tag);
|
|
|
- if (it == recv_req.end())
|
|
|
+ if (it == recv_req.end()) {
|
|
|
send_req.insert(std::pair<Integer, ConstIterator<char>>(tag, (ConstIterator<char>)sbuf));
|
|
|
- else
|
|
|
+ } else {
|
|
|
memcopy(it->second, (ConstIterator<char>)sbuf, scount * sizeof(SType));
|
|
|
+ recv_req.erase(it);
|
|
|
+ }
|
|
|
return nullptr;
|
|
|
#endif
|
|
|
}
|
|
@@ -131,10 +133,12 @@ template <class RType> void* Comm::Irecv(Iterator<RType> rbuf, Long rcount, Inte
|
|
|
return &request;
|
|
|
#else
|
|
|
auto it = send_req.find(tag);
|
|
|
- if (it == send_req.end())
|
|
|
+ if (it == send_req.end()) {
|
|
|
recv_req.insert(std::pair<Integer, Iterator<char>>(tag, (Iterator<char>)rbuf));
|
|
|
- else
|
|
|
+ } else {
|
|
|
memcopy((Iterator<char>)rbuf, it->second, rcount * sizeof(RType));
|
|
|
+ send_req.erase(it);
|
|
|
+ }
|
|
|
return nullptr;
|
|
|
#endif
|
|
|
}
|