HcclRankGraphGetLinks

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 information about the communication connection between the source rank and the destination rank at a specified topology layer in a specified communicator.

The following uses the Atlas A3 training product/Atlas A3 inference product as an example:
  • Example 1: The source rank and destination rank are on two SuperPoDs.

    netLayer = 0: no connection

    netLayer = 1: no connection

    netLayer = 2: RDMA connection

  • Example 2: The source rank and destination rank are on the same SuperPoD but different AI servers.

    netLayer = 0: no connection

    netLayer = 1: HCCS connection

    netLayer = 2: no connection

  • Example 3: The source rank and destination rank are on the same AI server but different NPUs.

    netLayer = 0: HCCS connection

    netLayer = 1: no connection

    netLayer = 2: no connection

Prototype

1
HcclResult HcclRankGraphGetLinks(HcclComm comm, uint32_t netLayer, uint32_t srcRank, uint32_t dstRank, CommLink **links, uint32_t *linkNum)

Parameters

Parameter

Input/Output

Description

comm

Input

Communicator.

The HcclComm type is defined as follows:

1
typedef void *HcclComm;

netLayer

Input

Topology layer ID.

srcRank

Input

Source rank ID.

dstRank

Input

Destination rank ID.

links

Output

Communication connection list.

For the definition of the CommLink type, see CommLink.

linkNum

Output

Number of communication connections.

Returns

HcclResult: HCCL_SUCCESS on success, or else failure.

Restrictions

None

Example

1
2
3
4
5
6
HcclComm comm;
CommLink *links;
uint32_t linkNum;
uint32_t netlayer = 0;
// Query the link between rank 0 and rank 1 on the server.
HcclRankGraphGetLinks(comm, netlayer, 0, 1, &links, &linkNum);