HcclChannelGetHcclBuffer
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
x |
√ |
|
√ |
|
x |
|
x |
|
x |
For
Function
Obtains the HCCL communication memory of the remote end of a specified channel.
Prototype
1 | HcclResult HcclChannelGetHcclBuffer(HcclComm comm, ChannelHandle channel, void **buffer, uint64_t *size) |
Parameters
Parameter |
Input/Output |
Description |
||
|---|---|---|---|---|
comm |
Input |
Communicator handle. The HcclComm type is defined as follows:
|
||
channel |
Input |
Communication channel handle. For the definition of the ChannelHandle type, see ChannelHandle. |
||
buffer |
Output |
HCCL communication memory address. |
||
size |
Output |
HCCL communication memory size. The memory size is twice the initial configuration of the communicator or the value of HCCL_BUFFSIZE. The default size is 400 MB. |
Returns
HcclResult: HCCL_SUCCESS on success, or else failure.
Restrictions
None
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | uint32_t channelNum = 1; std::vector<HcclChannelDesc> channelDesc(channelNum); HcclChannelDescInit(channelDesc.data(), channelNum); channelDesc[0].remoteRank = 1; channelDesc[0].channelProtocol = CommProtocol::COMM_PROTOCOL_HCCS; channelDesc[0].notifyNum = 3; HcclComm comm; CommEngine engine = CommEngine::COMM_ENGINE_CPU_TS; std::vector<ChannelHandle> channels(channelNum); HcclChannelAcquire(comm, engine, channelDesc.data(), channelNum, channels.data()); void *remoteBufferAddr; uint64_t remoteBufferSize; HcclChannelGetHcclBuffer(comm, channels[0], &remoteBufferAddr, &remoteBufferSize); |