HcclBroadcast
Description
Broadcasts the data of the root rank in the communicator to other ranks.
Prototype
HcclResult HcclBroadcast(void *buf, uint64_t count, HcclDataType dataType, uint32_t root, HcclComm comm, aclrtStream stream)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
buf |
Input/Output |
Data buffer, used as a send buffer for root ranks, while a receive buffer for non-root ranks. |
count |
Input |
Number of data elements to perform Broadcast operation. For example, if only one int32 data element is involved, then count = 1. |
dataType |
Input |
Data type of the Broadcast operation, which is of the HcclDataType type. |
root |
Input |
ID of the root rank. |
comm |
Input |
Communicator where the operation is performed. |
stream |
Input |
Stream of the rank. |
Returns
HcclResult: HCCL_SUCCESS on success; else, failure.
Constraints
- The ranks must have the same count, dataType, and root.
- There can be only one root rank globally.