From 671b688bb32f130ad1d9f2b6c857dce8e98f3cfd Mon Sep 17 00:00:00 2001 From: Binyang Li Date: Thu, 14 Aug 2025 19:54:48 -0700 Subject: [PATCH] Create ib mr for per ib transport (#611) --- src/include/registered_memory.hpp | 2 +- src/registered_memory.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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); };