Function: finalize

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

Performs deinitialization to destroy allocations.

A 2,000 ms timeout interval is added by default (the maximum timeout is 2,000 ms) for the transfer of device logs to ensure the integrity of error- and event-level logs. You can set the ASCEND_LOG_DEVICE_FLUSH_TIMEOUT environment variable to 0 (by using the export ASCEND_LOG_DEVICE_FLUSH_TIMEOUT=0 command) to cancel the timeout.

For details about the ASCEND_LOG_DEVICE_FLUSH_TIMEOUT environment variable, see Log Reference.

Prototype

  • C Prototype
    1
    aclError aclFinalize()
    
  • Python Function
    1
    ret = acl.finalize()
    

Parameters

None

Return Value

Return Value

Description

ret

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

Restrictions

Before an application process exits, this API must be explicitly called to deinitialize the application process. Otherwise, an exception may occur. For example, an error is reported when the application process exits.

You are advised not to call acl.finalize in the destructor call. Otherwise, the process may exit abnormally due to the unknown singleton destruction sequence.

Reference

For the API call example, see Initialization and Deinitialization.