GetTransferStatus

Applicability

Product

Supported (√/x)

Atlas 350 Accelerator Card

x

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

x

Note: For Atlas A2 training product / Atlas A2 inference product , only the Atlas 800I A2 inference server and A200I A2 Box heterogeneous subrack are supported.

Function Description

Obtains the asynchronous memory transmission status.

Prototype

Status GetTransferStatus(const TransferReq &req, TransferStatus &status)

Parameters

Parameter

Input/Output

Description

req

Input

Request handle, which is generated by calling TransferAsync.

status

Output

Transmission status. Enumerated values are as follows:

  • WAITING
  • COMPLETED
  • TIMEOUT (not supported currently)
  • FAILED

Example

// Initialize the engines on the client and server and establish a link.
Status transfer_status = client_engine.TransferAsync(remote_engine, operation, op_descs, optional_args, req);
// req is the output of TransferAsync(). Use this request handle to query the transmission status.
Status query_status = GetTransferStatus(req, status);
// Check the transmission status to determine whether it is complete.
...

Returns

  • SUCCESS: Success.
  • PARAM_INVALID: Incorrect parameter.
  • NOT_CONNECTED: No link is established with the peer end.
  • Other values: Failure.

Restrictions

  • Before calling this API, call the Connect API to establish a link with the peer end.
  • This API and Initialize must run in the same thread. If you need to switch threads to call this API, first call aclrtGetCurrentContext in Application Development (C&C++) in the thread where Initialize is running to obtain the context. Then, in the new thread, call aclrtSetCurrentContext in Application Development (C&C++) to set the context.
  • After calling TransferAsync for asynchronous transmission, use this API to query the status of the corresponding request. If the obtained status is COMPLETED or FAILED, the associated resources will be released. Repeated queries are not supported in this scenario.
  • During asynchronous transmission, you must determine whether a timeout occurs. If you determine that the task has timed out, call Disconnect to destroy the link and clean up related resources.
  • After an asynchronous transmission task fails, both the status queried using this API and the status returned by the API will be FAILED.