HcclRankGraphGetLayers

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 list of topology layers that contain the current rank and the number of topology layers.

For example, the preceding topology model contains two layers: Layer 0 and Layer 1. After this API is called, the returned topology layer ID list is [0, 1] and the number of topology layers is 2.

Prototype

1
HcclResult HcclRankGraphGetLayers(HcclComm comm, uint32_t **netLayers, uint32_t *netLayerNum)

Parameters

Parameter

Input/Output

Description

comm

Input

Communicator where the current rank is located.

The HcclComm type is defined as follows:

1
typedef void *HcclComm;

netLayers

Output

Topology layer ID list.

netLayerNum

Output

Number of topology layers.

Returns

HcclResult: HCCL_SUCCESS on success, or else failure.

Restrictions

None

Example

The following uses the topology model in Function as an example:

1
2
3
4
5
HcclComm comm;
uint32_t *netLayers;
uint32_t layerNum;
HcclRankGraphGetLayers(comm, &netLayers, &layerNum);
// netLayers=[0,1], layerNum=2