HcclGetRankSize

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

Queries the number of ranks in a specified communicator.

Prototype

1
HcclResult HcclGetRankSize(HcclComm comm, uint32_t *rankSize)

Parameters

Parameter

Input/Output

Description

comm

Input

Communicator where the collective communication operation is performed.

The HcclComm type is defined as follows:

1
typedef void *HcclComm;

rankSize

Output

Number of ranks in a communicator.

Returns

HcclResult: HCCL_SUCCESS on success, or else failure.

Restrictions

None

Example

Take a communicator with four servers and eight devices as an example. The total number of ranks is 32.

1
2
3
4
uint32_t rankSize;
HcclComm comm;
HcclGetRankSize(comm, &rankSize);
// rankSize=32