Enable RDC link Status feature
1.add link status APIs 2.Add link status example for link status API usage
This commit is contained in:
@@ -132,6 +132,12 @@ set(CONFIG_EXAMPLE_EXE "config")
|
||||
add_executable(${CONFIG_EXAMPLE_EXE} "${CONFIG_EXAMPLE_SRC_LIST}")
|
||||
target_link_libraries(${CONFIG_EXAMPLE_EXE} pthread dl rdc_bootstrap)
|
||||
|
||||
set(TOPOLOGYLINK_EXAMPLE_SRC_LIST "topologylink_example.cc")
|
||||
cmake_print_variables(TOPOLOGYLINK_EXAMPLE_SRC_LIST)
|
||||
set(TOPOLOGYLINK_EXAMPLE_EXE "topologylink")
|
||||
add_executable(${TOPOLOGYLINK_EXAMPLE_EXE} "${TOPOLOGYLINK_EXAMPLE_SRC_LIST}")
|
||||
target_link_libraries(${TOPOLOGYLINK_EXAMPLE_EXE} pthread dl rdc_bootstrap)
|
||||
|
||||
message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
|
||||
message(" Finished Cmake Example ")
|
||||
message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
|
||||
|
||||
@@ -119,10 +119,18 @@ int main() {
|
||||
<< "max_bandwidth: " << std::to_string(topo.link_infos[i].max_bandwidth) << "\n"
|
||||
<< "hops: " << std::to_string(topo.link_infos[i].hops) << "\n"
|
||||
<< "link_type: " << topology_link_type_to_str(topo.link_infos[i].link_type) << "\n"
|
||||
<< "is_p2p_accessible: " << std::to_string(topo.link_infos[i].is_p2p_accessible) << "\n"
|
||||
<< "is_p2p_accessible: " << std::to_string(topo.link_infos[i].is_p2p_accessible)
|
||||
<< "\n"
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
rdc_link_status_t link_status;
|
||||
result = rdc_link_status_get(rdc_handle, &link_status);
|
||||
if (result != RDC_ST_OK) {
|
||||
std::cout << "Error clear topology, Return: " << rdc_status_string(result) << std::endl;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
//... clean up
|
||||
cleanup:
|
||||
std::cout << "Cleaning up.\n";
|
||||
|
||||
Reference in New Issue
Block a user