Provide an error when there are no NICs on a system (#286)

这个提交包含在:
Yiltan
2025-10-20 13:07:56 -04:00
提交者 GitHub
父节点 c44f4ece1f
当前提交 b534423de7
+5 -1
查看文件
@@ -386,8 +386,9 @@ namespace rocshmem
// Query the number of IBV devices
int numIbvDevices = 0;
ibv_device** deviceList = ibv_get_device_list(&numIbvDevices);
CHECK_NNULL(deviceList, "ibv_get_device_list");
if (deviceList && numIbvDevices > 0) {
if (numIbvDevices > 0) {
// Loop over each device to collect information
for (int i = 0; i < numIbvDevices; i++) {
IbvDevice ibvDevice;
@@ -453,6 +454,9 @@ namespace rocshmem
}
ibvDeviceList.push_back(ibvDevice);
}
} else {
fprintf(stderr, "[Error] No visible InfiniBand devices found.\n");
exit(1);
}
ibv_free_device_list(deviceList);
isInitialized = true;