Initialize
Applicable Products
|
Product |
Supported (√/x) |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
x |
|
|
x |
|
|
x |
Note: For
Function Description
Initializes an HIXL instance. This API must be called before other APIs are called.
Prototype
1
|
Status Initialize(const AscendString &local_engine, const std::map<AscendString, AscendString> &options) |
Parameters
|
Parameter |
Input/Output |
Description |
|---|---|---|
|
local_engine |
Input |
HIXL identifier, which must be unique among all participants in the link establishment.
You are advised not to set this parameter to a loopback IP address, as it may lead to conflicts in scenarios involving multiple HIXL instances. If host_port is set and its value is greater than 0, the current HIXL instance functions as the server and needs to listen on the specified port. If host_port is not set or its value is less than or equal to 0, the current HIXL instance functions as the client and will not start listening. |
|
options |
Input |
Initialization parameter values. For details, see the following table. |
The following is a configuration example when OPTION_LOCAL_COMM_RES is set to "1.3":
- Minimum configuration (only the version field is configured, and other fields are automatically generated):
{ "version": "1.3" } - Complete configuration (manually specifying communication resource information):
{ "version": "1.3", "net_instance_id": "superpod1_1", "endpoint_list": [ { "protocol": "roce", "comm_id": "10.10.10.1", "placement": "device" } ] }Note: The minimum configuration mode is recommended. The system automatically generates local communication resource information. If you need to manually specify the information, refer to Table 3 for the meaning of each field in endpoint_list.
|
Option |
Optional/Mandatory |
Description |
|---|---|---|
|
OPTION_LOCAL_COMM_RES |
Mandatory |
Local communication resource information, formatted as a JSON string. For details about the configuration format, see Table 3. If this option is left empty, related information will not be automatically generated. UB: {
"version": "1.3",
"net_instance_id": "superpod1_1",
"endpoint_list": [
{
"protocol": "ub_ctp",
"comm_id": "00000000007f020000100000df149001",
"placement": "host",
"dst_eid": "00000000007f030000100000df141c01"
}
]
}
RoCE: {
"version": "1.3",
"net_instance_id": "superpod1_1",
"endpoint_list": [
{
"protocol": "roce",
"comm_id": "192.168.100.100",
"placement": "host"
}
]
}
UBoE: {
"version": "1.3",
"net_instance_id": "superpod1_1",
"endpoint_list": [
{
"protocol": "uboe",
"comm_id": "192.168.100.123",
"placement": "device"
}
]
}
UBG: {
"version": "1.3",
"net_instance_id": "superpod_1",
"endpoint_list": [
{
"protocol": "ubg",
"comm_id": "0000000000ff0a80000000000a140200",
"placement": "device"
}
]
}
Note: The values in the preceding configuration example are for reference only. In actual use, you must query the actual communication resource configuration information in the current environment and replace the values accordingly. If you directly copy the example values, the communication will fail. |
|
OPTION_AUTO_CONNECT |
Optional |
String value "AutoConnect".
Note:
|
|
Field |
Data Type |
Mandatory/Optional |
Description |
Value Option/Filling Rule |
|---|---|---|---|---|
|
version |
String |
Mandatory |
Version number. |
"1.3". This value requires the HDK version to be 25.5.0 or later and the Toolkit version to be 9.1.0 or later. |
|
net_instance_id |
String |
Mandatory |
Unique ID of the current SuperPoD. |
The ID is unique for each SuperPoD. |
|
endpoint_list |
Array |
Mandatory |
List of available communication devices. |
- |
|
endpoint_list[].protocol |
String |
Mandatory |
Communication protocol. |
"roce"/"ub_ctp"/"ub_tp"/"uboe" |
|
endpoint_list[].comm_id |
String |
Mandatory |
Communication identifier. |
|
|
endpoint_list[].placement |
String |
Mandatory |
Communication device location. |
"host"/"device" |
|
endpoint_list[].plane |
String |
Optional |
Communication device plane. |
This parameter is mandatory when the device is plane-specific and protocol is set to ub_ctp or ub_tp. The value must be unique for each plane, for example, "plane-a" or "plane-b". |
|
endpoint_list[].dst_eid |
String |
Optional |
${eid} of the peer communication device connected to the current communication device. |
If protocol is set to ub_ctp and the peer device is directly connected in full-mesh mode, set this parameter to the peer ${eid}. |
|
Field |
Data Type |
Mandatory/Optional |
Description |
Value Option/Filling Rule |
|---|---|---|---|---|
|
comm_resource_config.protocol_desc |
String array |
Optional |
Communication protocol and communication device location configuration. |
Currently, only ["uboe:device"] is supported, indicating the use of the UBOE protocol with the communication device located on the device. If OPTION_LOCAL_COMM_RES is not configured or if the endpoint_list within OPTION_LOCAL_COMM_RES is empty, the UBoE endpoint information will be generated automatically; otherwise, the configuration will be ignored. |
Example
Click GitCode, select the matching version, and obtain the sample from the examples/cpp directory.
Returns
- SUCCESS: Success.
- PARAM_INVALID: Incorrect parameter.
- Other values: Failure.
Exception Handling
None