HcclRankGraphGetTopoTypeByLayer

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

Returns the topology type of the topology layer where the current rank is located in a specified communicator.

Take the preceding topology model as an example:
  • Layer 0 contains two topology instances. For easy understanding, the topology instance IDs are defined as 0 and 1. The topology type of the topology instance whose ID is 0 is 1DMesh, and the topology type of the topology instance whose ID is 1 is Clos.
  • Layer 1 contains one topology instance, and the topology type is Clos.

Prototype

1
HcclResult HcclRankGraphGetTopoTypeByLayer(HcclComm comm, uint32_t netLayer, CommTopo *topoType)

Parameters

Parameter

Input/Output

Description

comm

Input

Communicator.

The HcclComm type is defined as follows:

1
typedef void *HcclComm;

netLayer

Input

Topology layer ID.

topoType

Output

Topology type, including 1D mesh, Clos, and custom.

For the definition of the CommTopo type, see CommTopo.

Returns

HcclResult: HCCL_SUCCESS on success, or else failure.

Restrictions

None

Example

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

For rank 0:

1
2
3
4
5
6
HcclComm comm;
uint32_t topoType;
HcclRankGraphGetTopoTypeByLayer(comm, 0, &topoType);  
// Set topoType of layer 0 to 1 (1DMesh).
HcclRankGraphGetTopoTypeByLayer(comm, 1, &topoType);  
// Set topoType of layer 1 to 0 (Clos).

For rank 3:

1
2
3
4
5
6
HcclComm comm;
uint32_t topoType;
HcclRankGraphGetTopoTypeByLayer(comm, 0, &topoType);  
// Set topoType of layer 0 to 1 (CLOS).
HcclRankGraphGetTopoTypeByLayer(comm, 1, &topoType);  
// Set topoType of layer 1 to 1 (CLOS).