HcclRecv

Description

Receives data from the source node to the specified location of the current node.

Prototype

HcclResult HcclRecv(void* recvBuf, uint64_t count, HcclDataType dataType, uint32_t srcRank,HcclComm comm, aclrtStream stream)

Parameters

Parameter

Input/Output

Description

recvBuf

Input

Address of the receive buffer.

count

Input

Number of received data elements.

dataType

Input

Data type of the data to be received, which is of the HcclDataType type.

Atlas Training Series Product : The supported data types are int8, uint8, int16, uint16, int32, uint32, int64, uint64, float16, float32, and float64.

srcRank

Input

ID of the source 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 HcclSend and HcclRecv interfaces are invoked synchronously and must be used in pairs. That is, after a process calls the HcclSend interface, the process can call the next interface only after the corresponding HcclRecv interface receives data, as shown in the following figure.

Applicability

Atlas Training Series Product

Example

For details, see the HcclSend/HcclRecv operation code example of each communicator initialization mode in Example Code.