Function: device_get_bare_tgid

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

Description

Obtains the ID of the current process.

This API has been adapted to the physical machine and VM scenarios when obtaining the process ID. You only need to call it to obtain the process ID and then configure other APIs (see acl.rt.mem_export_to_shareable_handle for assisting processes) to share the physical memory. If you do not call this API to obtain the process ID, an exception may occur when you use the process ID.

Prototype

  • C Prototype
    1
    aclError aclrtDeviceGetBareTgid(int32_t *pid)
    
  • Python Function
    1
    pid, ret = acl.rt.device_get_bare_tgid()
    

Parameters

None

Return Value

Return Value

Description

pid

Int, process ID.

ret

Int, error code. 0 on success; else, failure.