HccnRpingAddTargetWithCfg

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

Atlas inference product

Atlas training product

Description

Adds a ping target and establishes an RPing communication link between the client and target. The RPing timeout interval is configurable.

The client is the TX NPU, and the target is the RX NPU.

Prototype

1
HccnResult HccnRpingAddTargetWithCfg(HccnRpingCtx rpingCtx, uint32_t targetNum, HccnRpingTargetInfo *target, HccnRpingAddTargetConfig *config)

Parameters

Parameter

Input/Output

Description

rpingCtx

Input

RPing object returned by the HccnRpingInit API.

targetNum

Input

Number of target NPUs to be added. The value range is (0, 16].

The value of targetNum cannot exceed the total number of NPUs that participate in the RPing function when HccnRpingInit is called for initialization, that is, the value of npuNum in the HccnRpingInitAttr object.

target

Input

Basic information required for link establishment, including the listening port and address or identifier of the target NPU and the memory size required by the client NPU.

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

config

Input

RPing timeout interval. The value range is [1, 3600000], in ms.

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

Return Value

Parsing result of the error code of the HccnResult type.

Constraints

  • If a target fails to be added, an error is returned. As a result, all targets fail to be added.
  • The value of targetNum must be the same as the target array size. Otherwise, out-of-bounds access may occur.
  • A maximum of 16 targets can be added at once. If more than 16 targets need to be added, call this API for multiple times.
  • After this API is called, if the target is not initialized through HccnRpingInit within config->connectTimeout ms, the initialization times out and fails.