HcclCommInitAll
Description
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.
Prototype
HcclResult HcclCommInitAll(uint32_t ndev, int32_t* devices, HcclComm* comms)
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
ndev |
Input |
Number of devices in the communicator. |
|
devices |
Input |
List of devices in the communicator. The value is the logical ID of the device. The HCCL creates communicators in the sequence specified by devices. 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. |
Returns
HcclResult: HCCL_SUCCESS on success; else, failure.
Constraints
- This interface applies only to the single-server communication scenario.
- When multiple threads invoke collective operation APIs (such as HcclAllReduce), ensure that the time difference between collective operation API invocations in different threads does not exceed the value of the HCCL_CONNECT_TIMEOUT environment variable to avoid link setup timeout.
- One card cannot invoke multiple collective operation APIs at a time.