HcclCommWorkingDevNicSet

Applicability

Product

Supported

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

☓

Atlas 200I/500 A2 inference products

☓

Atlas inference products

☓

Atlas training products

☓

For Atlas A2 training products / Atlas A2 inference products , only the Atlas 800T A2 training server, Atlas 900 A2 PoD cluster basic unit, and Atlas 200T A2 Box16 heterogeneous subrack are supported.

Description

Configures the communication NIC in the communicator in the cluster scenario. Communication can be switched between a device NIC and the standby NIC on the same NPU. The standby NIC is another die NIC on the same NPU.

When configuring the NIC for a single communication, this API needs to be called for all devices in the same communicator, and the ranks, useBackup, and nRanks parameters delivered by all devices must be the same.

When configuring the communication NIC, pay attention to the following:

  • When the commands for switching to the standby NIC and active NIC are delivered at the same time, the commands fail to be executed if one end of the link is switched to the active NIC and the other end is switched to the standby NIC.
  • If there is a link between device 1 and device 2, the first command is delivered to switch device 1 to the standby NIC, and the second command is delivered to switch device 2 to the default NIC. In this case, the link between device 1 and device 2 uses the default NIC for communication, and the link between device 1 and other devices uses the standby NIC for communication.
  • If the NICs of device 1 and device 2 are standby NICs of each other and both devices deliver the command for switching to the standby NIC, the communication NICs used by device 1 and device 2 are exchanged.

Prototype

1
HcclResult HcclCommWorkingDevNicSet(HcclComm comm, uint32_t *ranks, bool *useBackup, uint32_t nRanks)

Parameters

Parameter

Input/Output

Description

comm

Input

Communicator of the communication NIC.

For details about the definition of the HcclComm type, see HcclComm.

ranks

Input

Array consisting of the IDs of the ranks of the communication NIC in the communicator.

useBackup

Input

Indicates whether the device in ranks uses the standby NIC.

nRanks

Input

Number of ranks for which the NIC is switched.

Returns

HcclResult: HCCL_SUCCESS on success; else, failure.

Constraints

Example

1
2
3
4
5
HcclComm comm;
uint32_t rankSize = 4;
uint32_t rankIds[rankSize] = {0, 3, 7, 12};
bool useBackup[rankSize] = {true, true, true, true};
HcclCommWorkingDevNicSet(comm, rankIds, useBackup, rankSize);