HcclRankGraphGetTopoTypeByLayer
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
x |
|
x |
|
x |
For
Function
Returns the topology type of the topology layer where the current rank is located in a specified communicator.

- 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:
|
||
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). |