diff --git a/src/include/registered_memory.hpp b/src/include/registered_memory.hpp index ae1eab2e..9e63af00 100644 --- a/src/include/registered_memory.hpp +++ b/src/include/registered_memory.hpp @@ -57,7 +57,7 @@ struct RegisteredMemory::Impl { std::vector transportInfos; // Only used for IB transport - std::unique_ptr ibMr; + std::unordered_map> ibMrMap; // For sharing memory handle via file descriptor int fileDesc = -1; diff --git a/src/registered_memory.cc b/src/registered_memory.cc index c52e6331..9f049cf8 100644 --- a/src/registered_memory.cc +++ b/src/registered_memory.cc @@ -88,10 +88,10 @@ RegisteredMemory::Impl::Impl(void* data, size_t size, TransportFlags transports, auto addIb = [&](Transport ibTransport) { TransportInfo transportInfo; transportInfo.transport = ibTransport; - this->ibMr = contextImpl.getIbContext(ibTransport)->registerMr(data, size); - transportInfo.ibMr = this->ibMr.get(); + this->ibMrMap[ibTransport] = contextImpl.getIbContext(ibTransport)->registerMr(data, size); + transportInfo.ibMr = this->ibMrMap[ibTransport].get(); transportInfo.ibLocal = true; - transportInfo.ibMrInfo = this->ibMr->getInfo(); + transportInfo.ibMrInfo = this->ibMrMap[ibTransport]->getInfo(); this->transportInfos.push_back(transportInfo); INFO(MSCCLPP_NET, "IB mr for address %p with size %ld is registered", data, size); };