Use smart pointer for IB structure (#585)

Change to use smart pointer for IB structure. Registered memory will own
ibMr, ibCtx will not held the reference
- Use smart pointer for IbQp and IbMr
- Update memoryChannel API, keep localRegisteredMemory
- Close fd when registedMemory released

---------

Co-authored-by: Changho Hwang <changhohwang@microsoft.com>
This commit is contained in:
Binyang Li
2025-08-06 10:01:58 -07:00
committed by GitHub
parent d55ac96f5e
commit 4f6f23dae3
23 changed files with 175 additions and 118 deletions

View File

@@ -273,6 +273,7 @@ struct Executor::Impl {
for (size_t i = 0; i < remoteRegMemoryFutures.size(); i++) {
context.registeredMemories[{bufferType, connectedPeers[i]}] = std::move(remoteRegMemoryFutures[i].get());
}
context.registeredMemories[{bufferType, rank}] = std::move(memory);
}
}
@@ -332,7 +333,8 @@ struct Executor::Impl {
for (int peer : info.connectedPeers) {
if (channelType == ChannelType::MEMORY) {
context.memoryChannels.emplace_back(context.memorySemaphores[index++],
context.registeredMemories[{info.dstBufferType, peer}], src, nullptr);
context.registeredMemories[{info.dstBufferType, peer}], localMemory,
nullptr);
} else if (channelType == ChannelType::PORT) {
context.portChannels.emplace_back(context.proxyService->portChannel(
context.proxySemaphores[index++],