HcommBatchModeStart
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
√ |
|
√ |
|
x |
|
x |
|
x |
For
Function
Enables the batch mode. All data plane API calls (such as HcommLocalCopy and HcommWrite) called between HcommBatchModeStart and HcommBatchModeEnd will be cached instead of being executed immediately. All operations will be submitted and executed collectively when HcommBatchModeEnd is called.
Prototype
1 | int32_t HcommBatchModeStart(const char *batchTag) |
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
batchTag |
Input |
(Optional) Batch task identifier. If NULL or an empty string is passed, it indicates that the task is a temporary batch task and will not be cached after execution. If a non-empty string is passed, it is used for subsequent identification and management of the batch task. Note that in scenarios where the communication engine is AICPU+TS, the task cache management feature based on non-empty identifiers is currently not fully supported. |
Returns
int32_t: 0 on success; else, failure.
Restrictions
- HcommBatchModeStart and HcommBatchModeEnd must be called in pairs and executed in the same thread.
- Operations cached in batch mode will be collectively executed only after the HcommBatchModeEnd call.
- Only the Atlas 350 Accelerator Card supports both batch mode and immediate execution mode (without calling batch APIs). Other products must use batch mode.
Example
1 2 3 4 5 6 7 8 9 | char *tag = ""; // Start the batch mode (a temporary batch task). HcommBatchModeStart(tag); // In batch mode, calls to data plane APIs are not executed immediately. // ... // End the batch mode and trigger execution. HcommBatchModeEnd(tag); |