Relay Transmission
Scenario
Relay transmission uses an intermediate buffer for data transmission and is required when:
- Direct H2H transmission via the HCCS protocol is not supported.
- There is a limit on the size of registered memory for direct H2H transmission via RDMA.
Example
This example demonstrates H2H transmission using the relay transmission feature.
- Initialize the HIXL and establish a link on the client and server as described in Link Establishment. The difference is that an additional configuration item BufferPool for the relay memory pool must be specified during initialization.
1 2 3 4 5 6 7 8 9
Hixl engine; std::map<AscendString, AscendString> options; options["BufferPool"] = "4:8"; AscendString local_engine = "ip:port"; // Replace it with the actual IP address and port number. It is the unique identifier of HIXL, and the port number must be a valid value. auto ret = engine.Initialize(local_engine, options); if (ret != SUCCESS) { printf("[ERROR] Initialize failed, ret = %u\n", ret); return -1; }
- Perform memory transmission as described in Memory Management. The difference is that the RegisterMem API does not need to be called to register the host memory. If the host memory is registered, the direct transmission mode will be used; if not, the relay transmission mode will be used.
Exception Handling
- TIMEOUT occurs when a transmission operation times out, indicating a link issue. To address this, try disconnecting and re-establishing the link.
- NOT_CONNECTED occurs when no link has been established with the remote side.
Parent topic: Function Description