Create ib mr for per ib transport (#611)

This commit is contained in:
Binyang Li
2025-08-14 19:54:48 -07:00
committed by GitHub
parent 699cc45eed
commit 671b688bb3
2 changed files with 4 additions and 4 deletions

View File

@@ -57,7 +57,7 @@ struct RegisteredMemory::Impl {
std::vector<TransportInfo> transportInfos;
// Only used for IB transport
std::unique_ptr<const IbMr> ibMr;
std::unordered_map<Transport, std::unique_ptr<const IbMr>> ibMrMap;
// For sharing memory handle via file descriptor
int fileDesc = -1;

View File

@@ -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);
};