Function: ipc_mem_set_import_pid

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas training product

Atlas inference product

Atlas 200I/500 A2 inference product

x

Description

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)
    

Parameters

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

Return Value

Description

ret

Int, 0 on success; else failure.