Skip to content

Commit

Permalink
Sort IB devices based on device name (#413)
Browse files Browse the repository at this point in the history
(cherry picked from commit 2d0ed8d)
  • Loading branch information
wenkaidu committed Aug 6, 2021
1 parent d306fd3 commit 6847913
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transport/net_ib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ ncclResult_t ncclIbInit(ncclDebugLogger_t logFunction) {
if (ncclNIbDevs == 0) {
INFO(NCCL_INIT|NCCL_NET, "NET/IB : No device found.");
} else {
auto cmpIbDevs = [](const void* n1, const void* n2) { return strcmp(((struct ncclIbDev*)n1)->devName, ((struct ncclIbDev*)n2)->devName); };
qsort(ncclIbDevs, ncclNIbDevs, sizeof(struct ncclIbDev), cmpIbDevs);
char line[1024];
line[0] = '\0';
for (int d=0; d<ncclNIbDevs; d++) {
Expand Down

0 comments on commit 6847913

Please sign in to comment.