HcclRankGraphGetLayers
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
x |
|
x |
|
x |
For
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:
|
||
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 |