Function: notify_import_by_key

Applicability

Product

Supported (√/x)

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

x

Function Usage

Obtains the key information in the current process and returns the Notify pointer address that can be used by this process.

This API must be used with other APIs to synchronize tasks between processes on multiple devices. For details, see acl.rt.notify_get_export_key.

Prototype

  • C Prototype
    aclError aclrtNotifyImportByKey(aclrtNotify *notify, const char *key, uint64_t flag)
  • Python Function
    1
    notify, ret = acl.rt.notify_import_by_key(key, flags)
    

Parameter Description

Parameter

Description

key

Str, Notify share name.

First call acl.rt.notify_get_export_key to obtain the shared name of the specified Notify and then pass the shared name as an input.

flags

Int, whether to enable data exchange between two devices.

It can be set to either of the following macros:

  • ACL_RT_NOTIFY_IMPORT_FLAG_DEFAULT: Default, which means disabling data exchange between two devices.

    If this macro is used, call the acl.rt.device_enable_peer_access API separately to enable data exchange between two devices.

  • ACL_RT_NOTIFY_IMPORT_FLAG_ENABLE_PEER_ACCESS: Enables data exchange between two devices.

    If this macro is used, you do not need to call the acl.rt.device_enable_peer_access API.

The macros are defined as follows:

#define ACL_RT_NOTIFY_IMPORT_FLAG_DEFAULT            0x0UL
#define ACL_RT_NOTIFY_IMPORT_FLAG_ENABLE_PEER_ACCESS 0x02UL

Return Value Description

Return Value

Description

notify

Int, Notify pointer.

ret

Int, 0 on success; else, failure.

Restrictions

This operation is not supported in the Ascend virtual instance scenario.