Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
☓ |
|
√ |
|
√ |
For
For the
In the single-server communication scenario, a process is used to create a communicator for multiple devices (one device corresponds to one thread). During the initialization of the communicator, devices[0] functions as the root rank to automatically collect cluster information.
1 | HcclResult HcclCommInitAll(uint32_t ndev, int32_t* devices, HcclComm* comms) |
Parameter |
Input/Output |
Description |
|---|---|---|
ndev |
Input |
Number of devices in the communicator. |
devices |
Input |
List of devices in the communicator. The values are logical IDs of the devices, which can be queried by running the npu-smi info -m command. HCCL creates communicators in the sequence specified by the devices parameter. Note that the entered device list cannot contain duplicate device IDs. |
comms |
Output |
Array of generated communicator handles. Its size is ndev * sizeof(HcclComm). For details about the definition of the HcclComm type, see HcclComm. |
HcclResult: HCCL_SUCCESS on success, or else failure.
1 2 3 4 5 6 7 8 9 | uint32_t rankSize = 2; int32_t devices[rankSize] = {0, 1}; HcclComm comms[rankSize]; // Initialize the communicator. HcclCommInitAll(rankSize, devices, comms); // Destroy the communicator. for (uint32_t i = 0; i < rankSize; i++) { HcclCommDestroy(comms[i]); } |