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

- Layer 0 contains two topology instances. For easy understanding, the topology instance IDs are defined as 0 and 1.
- Layer 1 contains one topology instance.
Assume that this API is called on rank 0. If the specified layer is 0, the number of ranks returned by this API is 3. If the specified layer is 1, the number of ranks returned by this API is 6.
Prototype
1 | HcclResult HcclRankGraphGetRankSizeByLayer(HcclComm comm, uint32_t netLayer, uint32_t *rankNum) |
Parameters
Parameter |
Input/Output |
Description |
||
|---|---|---|---|---|
comm |
Input |
Communicator. The HcclComm type is defined as follows:
|
||
netLayer |
Input |
Topology layer ID. |
||
rankNum |
Output |
Number of ranks. |
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 6 | HcclComm comm; uint32_t rankNum; HcclRankGraphGetRankSizeByLayer(comm, 0, &rankNum); // rankNum=3 HcclRankGraphGetRankSizeByLayer(comm, 1, &rankNum); // rankNum=6 |