GetTransferStatus

Applicable Products

Product

Supported (√/x)

Ascend 950PR / Ascend 950DT

√

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Note: For Atlas A2 training products / Atlas A2 inference products , 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 = client_engine.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.

Constraints

  • 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 the thread where Initialize is running to obtain the context. Then, in the new thread, call aclrtSetCurrentContext 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.