HcclGetHcclBuffer

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

x

For Atlas A2 training product/Atlas A2 inference product, only the Atlas 800T A2 training server, Atlas 900 A2 PoD cluster basic unit, and Atlas 200T A2 Box16 heterogeneous subrack are supported.

Function

Obtains the HCCL communication memory in the communicator. Memory will be initialized and allocated on the device during the first call; subsequent calls will reuse the allocated memory without reinitialization.

Prototype

1
HcclResult HcclGetHcclBuffer(HcclComm comm, void **buffer, uint64_t *size)

Parameters

Parameter

Input/Output

Description

comm

Input

Communicator.

The HcclComm type is defined as follows:

1
typedef void *HcclComm;

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

The returned buffer memory is managed by the library and cannot be released by the caller.

Example

1
2
3
4
HcclComm comm;
void *hcclBuffer = nullptr;
uint64_t hcclBufferSize = 0;
HcclResult result = HcclGetHcclBuffer(comm, &hcclBuffer, &hcclBufferSize);