Skip to content

Commit 1bf4e8c

Browse files
authored
connect() APIs changed to return an instance instead of a shared_ptr (#680)
The key purpose is handling all mscclpp objects' memory internally by hiding shared pointers from user APIs. * `Connection` class is now a wrapper of `BaseConnection` class that is equivalent to the previous `Connection` class * `connect()` methods now return `Connection` instead of `std::shared_ptr<Connection>` * Removed `connectOnSetup()` method
1 parent 7eb3ff7 commit 1bf4e8c

31 files changed

+252
-213
lines changed

apps/nccl/src/allgather.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class AllgatherAlgo6 : public mscclpp::AlgorithmBuilder {
216216

217217
private:
218218
bool disableChannelCache_;
219-
std::vector<std::shared_ptr<mscclpp::Connection>> conns_;
219+
std::vector<mscclpp::Connection> conns_;
220220
std::vector<std::shared_ptr<mscclpp::MemoryDevice2DeviceSemaphore>> memorySemaphores_;
221221
const int nChannelsPerConnection_ = 35;
222222

@@ -235,7 +235,7 @@ class AllgatherAlgo8 : public mscclpp::AlgorithmBuilder {
235235
mscclpp::Algorithm build() override;
236236

237237
private:
238-
std::vector<std::shared_ptr<mscclpp::Connection>> conns_;
238+
std::vector<mscclpp::Connection> conns_;
239239

240240
void initialize(std::shared_ptr<mscclpp::Communicator> comm,
241241
std::unordered_map<std::string, std::shared_ptr<void>>& extras);

apps/nccl/src/allreduce.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ class AllreducePacket : public mscclpp::AlgorithmBuilder {
11371137
size_t scratchBufferSize_;
11381138
std::shared_ptr<char> scratchBuffer_;
11391139
const int nSegmentsForScratchBuffer_ = 2;
1140-
std::vector<std::shared_ptr<mscclpp::Connection>> conns_;
1140+
std::vector<mscclpp::Connection> conns_;
11411141

11421142
std::shared_ptr<uint32_t> deviceFlag7_;
11431143
std::shared_ptr<uint32_t> deviceFlag28_;
@@ -1164,7 +1164,7 @@ class AllreduceNvls : public mscclpp::AlgorithmBuilder {
11641164
uint32_t nSwitchChannels_;
11651165
std::shared_ptr<mscclpp::DeviceHandle<mscclpp::BaseMemoryChannel>> memoryChannelsDeviceHandle_;
11661166
std::vector<mscclpp::BaseMemoryChannel> baseChannels_;
1167-
std::vector<std::shared_ptr<mscclpp::Connection>> conns_;
1167+
std::vector<mscclpp::Connection> conns_;
11681168
};
11691169

11701170
class AllreduceNvlsWithCopy : public mscclpp::AlgorithmBuilder {
@@ -1188,7 +1188,7 @@ class AllreduceNvlsWithCopy : public mscclpp::AlgorithmBuilder {
11881188
uint32_t nSwitchChannels_;
11891189
std::shared_ptr<mscclpp::DeviceHandle<mscclpp::BaseMemoryChannel>> memoryChannelsDeviceHandle_;
11901190
std::vector<mscclpp::BaseMemoryChannel> baseChannels_;
1191-
std::vector<std::shared_ptr<mscclpp::Connection>> conns_;
1191+
std::vector<mscclpp::Connection> conns_;
11921192
};
11931193

11941194
class Allreduce8 : public mscclpp::AlgorithmBuilder {
@@ -1209,7 +1209,7 @@ class Allreduce8 : public mscclpp::AlgorithmBuilder {
12091209
size_t scratchBufferSize_;
12101210
std::shared_ptr<mscclpp::Communicator> comm_;
12111211
int nChannelsPerConnection_;
1212-
std::vector<std::shared_ptr<mscclpp::Connection>> conns_;
1212+
std::vector<mscclpp::Connection> conns_;
12131213
std::shared_ptr<char> scratchBuffer_;
12141214
std::vector<std::shared_ptr<mscclpp::MemoryDevice2DeviceSemaphore>> outputSemaphores_;
12151215
std::vector<std::shared_ptr<mscclpp::MemoryDevice2DeviceSemaphore>> inputScratchSemaphores_;

apps/nccl/src/broadcast.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class BroadcastAlgo6 : public mscclpp::AlgorithmBuilder {
171171
void* output, size_t, ncclDataType_t);
172172
mscclpp::AlgorithmCtxKey generateBroadcastContextKey(const void*, void*, size_t, ncclDataType_t);
173173

174-
std::vector<std::shared_ptr<mscclpp::Connection>> conns_;
174+
std::vector<mscclpp::Connection> conns_;
175175
size_t scratchMemSize_;
176176
std::shared_ptr<char> scratchBuffer_;
177177
};

apps/nccl/src/common.cu

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,41 +20,41 @@ std::vector<mscclpp::RegisteredMemory> setupRemoteMemories(std::shared_ptr<msccl
2020
}
2121

2222
std::vector<mscclpp::MemoryChannel> setupMemoryChannels(
23-
const std::vector<std::shared_ptr<mscclpp::Connection>>& connections,
23+
const std::vector<mscclpp::Connection>& connections,
2424
const std::vector<std::shared_ptr<mscclpp::MemoryDevice2DeviceSemaphore>>& memorySemaphores,
2525
const std::vector<mscclpp::RegisteredMemory>& remoteMemories, mscclpp::RegisteredMemory localMemory,
2626
int nChannelsPerConnection) {
2727
std::vector<mscclpp::MemoryChannel> channels;
2828
size_t nConnections = connections.size();
2929
for (int idx = 0; idx < nChannelsPerConnection; ++idx) {
3030
for (size_t cid = 0; cid < nConnections; ++cid) {
31-
if (connections[cid]->transport() == mscclpp::Transport::CudaIpc) {
31+
if (connections[cid].transport() == mscclpp::Transport::CudaIpc) {
3232
channels.emplace_back(memorySemaphores[idx * nConnections + cid], remoteMemories[cid], localMemory, nullptr);
3333
}
3434
}
3535
}
3636
return channels;
3737
}
3838

39-
std::vector<std::shared_ptr<mscclpp::Connection>> setupConnections(std::shared_ptr<mscclpp::Communicator> comm) {
40-
std::vector<std::shared_future<std::shared_ptr<mscclpp::Connection>>> connectionFutures;
39+
std::vector<mscclpp::Connection> setupConnections(std::shared_ptr<mscclpp::Communicator> comm) {
40+
std::vector<std::shared_future<mscclpp::Connection>> connectionFutures;
4141
for (int i = 0; i < comm->bootstrap()->getNranks(); i++) {
4242
if (i == comm->bootstrap()->getRank()) continue;
4343
connectionFutures.push_back(comm->connect(mscclpp::Transport::CudaIpc, i));
4444
}
45-
std::vector<std::shared_ptr<mscclpp::Connection>> connections;
45+
std::vector<mscclpp::Connection> connections;
4646
std::transform(connectionFutures.begin(), connectionFutures.end(), std::back_inserter(connections),
4747
[](const auto& future) { return future.get(); });
4848
return connections;
4949
}
5050

5151
std::vector<std::shared_ptr<mscclpp::MemoryDevice2DeviceSemaphore>> setupMemorySemaphores(
52-
std::shared_ptr<mscclpp::Communicator> comm, const std::vector<std::shared_ptr<mscclpp::Connection>>& connections,
52+
std::shared_ptr<mscclpp::Communicator> comm, const std::vector<mscclpp::Connection>& connections,
5353
int nChannelsPerConnection) {
5454
std::vector<std::shared_ptr<mscclpp::MemoryDevice2DeviceSemaphore>> memorySemaphores;
5555
for (int idx = 0; idx < nChannelsPerConnection; ++idx) {
5656
for (size_t cid = 0; cid < connections.size(); ++cid) {
57-
if (connections[cid]->transport() == mscclpp::Transport::CudaIpc) {
57+
if (connections[cid].transport() == mscclpp::Transport::CudaIpc) {
5858
memorySemaphores.emplace_back(
5959
std::make_shared<mscclpp::MemoryDevice2DeviceSemaphore>(*(comm), connections[cid]));
6060
}
@@ -117,14 +117,14 @@ std::shared_ptr<mscclpp::DeviceHandle<mscclpp::SwitchChannel>> setupNvlsChannelD
117117
}
118118

119119
std::vector<mscclpp::BaseMemoryChannel> setupBaseMemoryChannels(
120-
const std::vector<std::shared_ptr<mscclpp::Connection>>& connections,
120+
const std::vector<mscclpp::Connection>& connections,
121121
const std::vector<std::shared_ptr<mscclpp::MemoryDevice2DeviceSemaphore>>& memorySemaphores,
122122
int nChannelsPerConnection) {
123123
std::vector<mscclpp::BaseMemoryChannel> channels;
124124
size_t nConnections = connections.size();
125125
for (int idx = 0; idx < nChannelsPerConnection; ++idx) {
126126
for (size_t cid = 0; cid < nConnections; ++cid) {
127-
if (connections[cid]->transport() == mscclpp::Transport::CudaIpc) {
127+
if (connections[cid].transport() == mscclpp::Transport::CudaIpc) {
128128
channels.emplace_back(memorySemaphores[idx * nConnections + cid]);
129129
}
130130
}

apps/nccl/src/common.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ std::vector<mscclpp::RegisteredMemory> setupRemoteMemories(std::shared_ptr<msccl
3333
mscclpp::RegisteredMemory localMemory);
3434

3535
std::vector<mscclpp::MemoryChannel> setupMemoryChannels(
36-
const std::vector<std::shared_ptr<mscclpp::Connection>>& connections,
36+
const std::vector<mscclpp::Connection>& connections,
3737
const std::vector<std::shared_ptr<mscclpp::MemoryDevice2DeviceSemaphore>>& memorySemaphores,
3838
const std::vector<mscclpp::RegisteredMemory>& remoteMemories, mscclpp::RegisteredMemory localMemory,
3939
int nChannelsPerConnection);
4040

41-
std::vector<std::shared_ptr<mscclpp::Connection>> setupConnections(std::shared_ptr<mscclpp::Communicator> comm);
41+
std::vector<mscclpp::Connection> setupConnections(std::shared_ptr<mscclpp::Communicator> comm);
4242

4343
std::vector<std::shared_ptr<mscclpp::MemoryDevice2DeviceSemaphore>> setupMemorySemaphores(
44-
std::shared_ptr<mscclpp::Communicator> comm, const std::vector<std::shared_ptr<mscclpp::Connection>>& connections,
44+
std::shared_ptr<mscclpp::Communicator> comm, const std::vector<mscclpp::Connection>& connections,
4545
int nChannelsPerConnection);
4646

4747
std::shared_ptr<mscclpp::DeviceHandle<mscclpp::MemoryChannel>> setupMemoryChannelDeviceHandles(
@@ -57,7 +57,7 @@ std::shared_ptr<mscclpp::DeviceHandle<mscclpp::SwitchChannel>> setupNvlsChannelD
5757
const std::vector<mscclpp::SwitchChannel>& nvlsChannels);
5858

5959
std::vector<mscclpp::BaseMemoryChannel> setupBaseMemoryChannels(
60-
const std::vector<std::shared_ptr<mscclpp::Connection>>& connections,
60+
const std::vector<mscclpp::Connection>& connections,
6161
const std::vector<std::shared_ptr<mscclpp::MemoryDevice2DeviceSemaphore>>& memorySemaphores,
6262
int nChannelsPerConnection);
6363

docs/tutorials/01-basic-concepts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ The connection is created by calling `connect` on the context object:
8383
8484
```cpp
8585
// From gpu_ping_pong.cu, lines 76 and 82
86-
std::shared_ptr<mscclpp::Connection> conn0 = ctx->connect(/*localEndpoint*/ ep0, /*remoteEndpoint*/ ep1);
87-
std::shared_ptr<mscclpp::Connection> conn1 = ctx->connect(/*localEndpoint*/ ep1, /*remoteEndpoint*/ ep0);
86+
mscclpp::Connection conn0 = ctx->connect(/*localEndpoint*/ ep0, /*remoteEndpoint*/ ep1);
87+
mscclpp::Connection conn1 = ctx->connect(/*localEndpoint*/ ep1, /*remoteEndpoint*/ ep0);
8888
```
8989

9090
The `localEndpoint` and `remoteEndpoint` parameters specify which endpoints are used for the connection. A connection is asymmetric by nature, meaning that we need to create one connection for each endpoint. In this case, `conn0` is created for `ep0` to communicate with `ep1`, and `conn1` is created for `ep1` to communicate with `ep0`.
@@ -101,7 +101,7 @@ sendToProcessB(serializedEp0); // send serializedEp0 to Process B using any IPC
101101
mscclpp::Endpoint ep1 = ctx->createEndpoint({transport, {mscclpp::DeviceType::GPU, 1}});
102102
std::vector<char> serializedEp0 = recvFromProcessA(); // receive serializedEp0 from Process A
103103
mscclpp::Endpoint ep0 = mscclpp::Endpoint::deserialize(serializedEp0);
104-
std::shared_ptr<mscclpp::Connection> conn1 = ctx->connect(/*localEndpoint*/ ep1, /*remoteEndpoint*/ ep0);
104+
mscclpp::Connection conn1 = ctx->connect(/*localEndpoint*/ ep1, /*remoteEndpoint*/ ep0);
105105
```
106106
107107
## SemaphoreStub and Semaphore

examples/customized-collective-algorithm/customized_allgather.cu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,18 @@ class AllgatherAlgoBuilder : public mscclpp::AlgorithmBuilder {
107107
}
108108

109109
private:
110-
std::vector<std::shared_ptr<mscclpp::Connection>> conns_;
110+
std::vector<mscclpp::Connection> conns_;
111111
std::shared_ptr<mscclpp::ProxyService> proxyService_;
112112
int worldSize_;
113113

114114
void initialize(std::shared_ptr<mscclpp::Communicator> comm) {
115-
std::vector<std::shared_future<std::shared_ptr<mscclpp::Connection>>> connectionFutures;
115+
std::vector<std::shared_future<mscclpp::Connection>> connectionFutures;
116116
worldSize_ = comm->bootstrap()->getNranks();
117117
for (int i = 0; i < worldSize_; i++) {
118118
if (i == comm->bootstrap()->getRank()) continue;
119119
connectionFutures.push_back(comm->connect(mscclpp::Transport::CudaIpc, i));
120120
}
121-
std::vector<std::shared_ptr<mscclpp::Connection>> connections;
121+
std::vector<mscclpp::Connection> connections;
122122
std::transform(connectionFutures.begin(), connectionFutures.end(), std::back_inserter(connections),
123123
[](const auto& future) { return future.get(); });
124124
this->conns_ = std::move(connections);

examples/tutorials/01-basic-concepts/gpu_ping_pong.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ int main() {
7373
log("GPU 0: Creating a connection and a semaphore stub ...");
7474

7575
MSCCLPP_CUDATHROW(cudaSetDevice(0));
76-
std::shared_ptr<mscclpp::Connection> conn0 = ctx->connect(/*localEndpoint*/ ep0, /*remoteEndpoint*/ ep1);
76+
mscclpp::Connection conn0 = ctx->connect(/*localEndpoint*/ ep0, /*remoteEndpoint*/ ep1);
7777
mscclpp::SemaphoreStub semaStub0(conn0);
7878

7979
log("GPU 1: Creating a connection and a semaphore stub ...");
8080

8181
MSCCLPP_CUDATHROW(cudaSetDevice(1));
82-
std::shared_ptr<mscclpp::Connection> conn1 = ctx->connect(/*localEndpoint*/ ep1, /*remoteEndpoint*/ ep0);
82+
mscclpp::Connection conn1 = ctx->connect(/*localEndpoint*/ ep1, /*remoteEndpoint*/ ep0);
8383
mscclpp::SemaphoreStub semaStub1(conn1);
8484

8585
log("GPU 0: Creating a semaphore and a memory channel ...");

include/mscclpp/core.hpp

Lines changed: 29 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ struct EndpointConfig {
425425

426426
class Context;
427427
class Connection;
428+
class BaseConnection;
428429
class RegisteredMemory;
429430
class SemaphoreStub;
430431
class Semaphore;
@@ -474,7 +475,7 @@ class Endpoint {
474475
std::shared_ptr<Impl> pimpl_;
475476

476477
friend class Context;
477-
friend class Connection;
478+
friend class BaseConnection;
478479
};
479480

480481
/// Context for communication. This provides a low-level interface for forming connections in use-cases
@@ -521,8 +522,8 @@ class Context : public std::enable_shared_from_this<Context> {
521522
///
522523
/// @param localEndpoint The local endpoint.
523524
/// @param remoteEndpoint The remote endpoint.
524-
/// @return A shared pointer to the connection.
525-
std::shared_ptr<Connection> connect(const Endpoint& localEndpoint, const Endpoint& remoteEndpoint);
525+
/// @return A connection object.
526+
Connection connect(const Endpoint& localEndpoint, const Endpoint& remoteEndpoint);
526527

527528
private:
528529
Context();
@@ -531,7 +532,7 @@ class Context : public std::enable_shared_from_this<Context> {
531532
std::unique_ptr<Impl> pimpl_;
532533

533534
friend class Endpoint;
534-
friend class Connection;
535+
friend class BaseConnection;
535536
friend class RegisteredMemory;
536537
friend class SemaphoreStub;
537538
};
@@ -578,7 +579,7 @@ class RegisteredMemory {
578579
std::shared_ptr<Impl> pimpl_;
579580

580581
friend class Context;
581-
friend class Connection;
582+
friend class BaseConnection;
582583
friend class SemaphoreStub;
583584
friend class Semaphore;
584585
};
@@ -587,12 +588,7 @@ class RegisteredMemory {
587588
class Connection {
588589
public:
589590
/// Constructor.
590-
/// @param context The context associated with the connection.
591-
/// @param localEndpoint The local endpoint of the connection.
592-
Connection(std::shared_ptr<Context> context, const Endpoint& localEndpoint);
593-
594-
/// Destructor.
595-
virtual ~Connection() = default;
591+
Connection() = default;
596592

597593
/// Write data from a source RegisteredMemory to a destination RegisteredMemory.
598594
///
@@ -601,28 +597,27 @@ class Connection {
601597
/// @param src The source RegisteredMemory.
602598
/// @param srcOffset The offset in bytes from the start of the source RegisteredMemory.
603599
/// @param size The number of bytes to write.
604-
virtual void write(RegisteredMemory dst, uint64_t dstOffset, RegisteredMemory src, uint64_t srcOffset,
605-
uint64_t size) = 0;
600+
void write(RegisteredMemory dst, uint64_t dstOffset, RegisteredMemory src, uint64_t srcOffset, uint64_t size);
606601

607602
/// Update an 8-byte value in a destination RegisteredMemory and synchronize the change with the remote process.
608603
///
609604
/// @param dst The destination RegisteredMemory.
610605
/// @param dstOffset The offset in bytes from the start of the destination RegisteredMemory.
611606
/// @param src A pointer to the value to update.
612607
/// @param newValue The new value to write.
613-
virtual void updateAndSync(RegisteredMemory dst, uint64_t dstOffset, uint64_t* src, uint64_t newValue) = 0;
608+
void updateAndSync(RegisteredMemory dst, uint64_t dstOffset, uint64_t* src, uint64_t newValue);
614609

615610
/// Flush any pending writes to the remote process.
616611
/// @param timeoutUsec Timeout in microseconds. Default: -1 (no timeout)
617-
virtual void flush(int64_t timeoutUsec = -1) = 0;
612+
void flush(int64_t timeoutUsec = -1);
618613

619614
/// Get the transport used by the local process.
620615
/// @return The transport used by the local process.
621-
virtual Transport transport() const = 0;
616+
Transport transport() const;
622617

623618
/// Get the transport used by the remote process.
624619
/// @return The transport used by the remote process.
625-
virtual Transport remoteTransport() const = 0;
620+
Transport remoteTransport() const;
626621

627622
/// Get the context associated with this connection.
628623
/// @return A shared pointer to the context associated with this connection.
@@ -636,22 +631,23 @@ class Connection {
636631
/// @return The maximum number of write requests that can be queued.
637632
int getMaxWriteQueueSize() const;
638633

639-
protected:
640-
static const Endpoint::Impl& getImpl(const Endpoint& endpoint);
641-
static const RegisteredMemory::Impl& getImpl(const RegisteredMemory& memory);
642-
static Context::Impl& getImpl(Context& context);
634+
private:
635+
Connection(std::shared_ptr<BaseConnection> impl);
636+
std::shared_ptr<BaseConnection> impl_;
643637

644-
std::shared_ptr<Context> context_;
645-
Endpoint localEndpoint_;
646-
int maxWriteQueueSize_;
638+
friend class Context;
639+
friend class Communicator;
640+
friend class SemaphoreStub;
641+
friend class Semaphore;
642+
friend class ProxyService;
647643
};
648644

649645
/// SemaphoreStub object only used for constructing Semaphore, not for direct use by the user.
650646
class SemaphoreStub {
651647
public:
652648
/// Constructor.
653-
/// @param connection A shared pointer to the connection associated with this semaphore.
654-
SemaphoreStub(std::shared_ptr<Connection> connection);
649+
/// @param connection The connection associated with this semaphore.
650+
SemaphoreStub(const Connection& connection);
655651

656652
/// Get the memory associated with this semaphore.
657653
/// @return A reference to the registered memory for this semaphore.
@@ -686,8 +682,8 @@ class Semaphore {
686682
Semaphore(const SemaphoreStub& localStub, const SemaphoreStub& remoteStub);
687683

688684
/// Get the connection associated with this semaphore.
689-
/// @return A shared pointer to the connection.
690-
std::shared_ptr<Connection> connection() const;
685+
/// @return The connection.
686+
Connection& connection();
691687

692688
/// Get the local memory associated with this semaphore.
693689
/// @return A reference to the local registered memory.
@@ -873,34 +869,23 @@ class Communicator {
873869
/// @param localEndpoint The local endpoint.
874870
/// @param remoteRank The rank of the remote process.
875871
/// @param tag The tag to use for identifying the send and receive.
876-
/// @return A future of shared pointer to the connection.
872+
/// @return A future of the connection.
877873
///
878-
std::shared_future<std::shared_ptr<Connection>> connect(const Endpoint& localEndpoint, int remoteRank, int tag = 0);
874+
std::shared_future<Connection> connect(const Endpoint& localEndpoint, int remoteRank, int tag = 0);
879875

880876
/// Connect to a remote rank. Wrapper of `connect(localEndpoint, remoteRank, tag)`.
881877
/// @param localConfig The configuration for the local endpoint.
882878
/// @param remoteRank The rank of the remote process.
883879
/// @param tag The tag to use for identifying the send and receive.
884-
/// @return A future of shared pointer to the connection.
885-
std::shared_future<std::shared_ptr<Connection>> connect(const EndpointConfig& localConfig, int remoteRank,
886-
int tag = 0);
887-
888-
[[deprecated("Use connect(localConfig, remoteRank, tag) instead. This will be removed in a future release.")]] std::
889-
shared_future<std::shared_ptr<Connection>>
890-
connect(int remoteRank, int tag, EndpointConfig localConfig);
891-
892-
[[deprecated("Use connect() instead. This will be removed in a future release.")]] NonblockingFuture<
893-
std::shared_ptr<Connection>>
894-
connectOnSetup(int remoteRank, int tag, EndpointConfig localConfig) {
895-
return connect(localConfig, remoteRank, tag);
896-
}
880+
/// @return A future of the connection.
881+
std::shared_future<Connection> connect(const EndpointConfig& localConfig, int remoteRank, int tag = 0);
897882

898883
/// Build a semaphore for cross-process synchronization.
899884
/// @param connection The connection associated with this semaphore.
900885
/// @param remoteRank The rank of the remote process.
901886
/// @param tag The tag to use for identifying the operation.
902887
/// @return A future of the built semaphore.
903-
std::shared_future<Semaphore> buildSemaphore(std::shared_ptr<Connection> connection, int remoteRank, int tag = 0);
888+
std::shared_future<Semaphore> buildSemaphore(const Connection& connection, int remoteRank, int tag = 0);
904889

905890
/// Get the remote rank a connection is connected to.
906891
///

0 commit comments

Comments
 (0)