Skip to content

Commit c88afaf

Browse files
committed
memtiers: clarify a comment about using subtypes for sorting nodes in tiers
Signed-off-by: Brice Goglin <[email protected]>
1 parent 1779eae commit c88afaf

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

hwloc/memattrs.c

+9-4
Original file line numberDiff line numberDiff line change
@@ -1521,10 +1521,15 @@ hwloc__group_memory_tiers(hwloc_topology_t topology,
15211521
}
15221522
}
15231523

1524-
/* Sort nodes.
1525-
* We could also sort by the existing subtype.
1526-
* KNL is the only case where subtypes are set in backends, but we set memattrs as well there.
1527-
* Also HWLOC_MEMTIERS_REFRESH would be a special value to ignore existing subtypes.
1524+
/* Sort nodes by tier type and bandwidth.
1525+
*
1526+
* We could also use the existing subtype but it's not clear it'd be better.
1527+
* For NVIDIA GPU, "GPUMemory" is set in the Linux backend, and used above to set tier type anyway.
1528+
* For KNL, the Linux backend sets subtypes and memattrs, sorting by memattrs already works fine.
1529+
* Existing subtypes could have been imported from XML, usually mostly OK except maybe SPM (fallback for I don't know)?
1530+
* An envvar (or HWLOC_MEMTIERS_REFRESH special value?) could be passed to ignore existing subtypes,
1531+
* but "GPUMemory" wouldn't be available anymore, we'd have to use something else like "PCIBusId",
1532+
* but that one might not always be specific to GPU-backed NUMA nodes?
15281533
*/
15291534
hwloc_debug("Sorting memory node infos...\n");
15301535
qsort(nodeinfos, n, sizeof(*nodeinfos), compare_node_infos_by_type_and_bw);

0 commit comments

Comments
 (0)