Function: finalize

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

Function Usage

Performs deinitialization to destroy allocations.

A 2000 ms timeout interval is added by default (the maximum timeout is 2000 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()
    

Parameter Description

None

Return Value Description

Return Value

Description

ret

Integer error code: 0 on success; else, failure.

Restrictions

This API needs to be called explicitly to perfrom deinitialization before the app process exits. Otherwise, an error will be reported, for example, an app process exit error.

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.