Function: device_peer_access_status

Applicable Products

Product

Supported (√/x)

Ascend 950PR/Ascend 950DT

√

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Description

Queries the data exchange status between two devices.

Prototype

  • C Prototype
    1
    aclError aclrtDevicePeerAccessStatus(int32_t deviceId, int32_t peerDeviceId, int32_t *status)
    
  • Python Function
    1
    status, ret = acl.rt.device_peer_access_status(device_id,  peer_device_id)
    

Parameters

Parameter

Description

device_id

Int, device ID.

peer_dev_id

Int, device ID.

Must be in the range of [0, Device count – 1]. Call acl.rt.get_device_count to obtain the device count.

Return Values

Return Value

Description

status

Int, device status.

  • 0: Data exchange is disabled.
  • 1: Data exchange is enabled.

ret

Int, 0 on success; else failure.

Constraints

This API can only be used to query the data exchange status of two devices whose IDs are within the value range. If any of the input device IDs is out of the range [0, Number of available devices – 1], the query result is 0 or the error code ACL_ERROR_RT_PARAM_INVALID is returned.