GetTransferStatus
Applicable Products
|
Product |
Supported (√/x) |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
x |
|
|
x |
|
|
x |
Note: For
Function Description
Obtains the status of all asynchronous memory transmission requests.
Prototype
Status GetTransferStatus(const GetTransferStatusArgs &args, std::vector<TransferResult> &results)
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
args |
Input |
Parameters for obtaining the status of all asynchronous transmission requests. |
|
results |
Output |
Status of all asynchronous transmission requests. |
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.
GetTransferStatusArgs args = { .max_query_count = 4, .skip_waiting = true };
std::vector<TransferResult> results;
Status query_status = client_engine.GetTransferStatus(args, results);
// Check the transmission status to determine whether it is complete.
...
Returns
- SUCCESS: Success.
- UNSUPPORTED: This query is not supported unless the HIXL initialization options are correctly configured. Specifically, version of LocalCommRes must be 1.3, and comm_resource_config.protocol_desc of GlobalResourceConfig must include uboe:device.
- 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.