Function: ipc_mem_set_import_pid

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

Sets the process trustlist of the IPC shared memory. Only the processes in the trustlist can use the key exported by the acl.rt.ipc_mem_get_export_key API.

This API must work with other APIs to implement memory sharing. For details, see the description of acl.rt.ipc_mem_get_export_key.

Prototype

  • C Prototype
    aclError aclrtIpcMemSetImportPid(const char *key, int32_t *pid, size_t num)
  • Python Function
    1
    ret = acl.rt.ipc_mem_set_import_pid(key, pid)
    

Parameter Description

Parameter

Description

key

Str, shared memory key.

pids

List, array for storing trustlisted process IDs.

You can call acl.rt.device_get_bare_tgid to obtain the process ID. In the Docker scenario, the process ID on the physical machine is obtained. In the non-Docker scenario, the process ID is obtained.

Return Value Description

Return Value

Description

ret

Int, 0 on success; else failure.