Skip to content

Commit 5fa4739

Browse files
committed
linux/numa: cleanup HWLOC_DEBUG_ALLOW_OVERLAPPING_NODE_CPUSETS
2 means allow without warning Signed-off-by: Brice Goglin <[email protected]>
1 parent 21787a3 commit 5fa4739

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

doc/hwloc.doxy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,9 @@ following environment variables.
12921292
if 1, ignore KNL info from hwloc-dump-hwdata and fallback to heuristic
12931293
if 0, never fallback to the hardwired heuristic, useful if the heuristic is wrong
12941294
HWLOC_DEBUG_ALLOW_OVERLAPPING_NODE_CPUSETS
1295-
don't ignore linux numa nodes with overlapping cpusets
1295+
if 0 (default), non-first nodes with overlapping cpusets are ignored
1296+
if 1, don't ignore linux numa nodes with overlapping cpusets
1297+
if 2, don't ignore either and don't even warn about it
12961298
HWLOC_DEBUG_SORT_CHILDREN
12971299
sort osdev I/O children by name to make sure the topology doesn't depend
12981300
on the ordering of dentries in the local filesystem (for Linux fsroot tests)

hwloc/topology-linux.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3972,11 +3972,17 @@ look_sysfsnode(struct hwloc_topology *topology,
39723972
unsigned failednodes = 0;
39733973
unsigned i;
39743974
DIR *dir;
3975-
int allow_overlapping_node_cpusets = (getenv("HWLOC_DEBUG_ALLOW_OVERLAPPING_NODE_CPUSETS") != NULL);
3975+
char *env;
3976+
int allow_overlapping_node_cpusets = 0;
39763977
int need_memcaches = hwloc_filter_check_keep_object_type(topology, HWLOC_OBJ_MEMCACHE);
39773978

39783979
hwloc_debug("\n\n * Topology extraction from /sys/devices/system/node *\n\n");
39793980

3981+
env = getenv("HWLOC_DEBUG_ALLOW_OVERLAPPING_NODE_CPUSETS");
3982+
if (env) {
3983+
allow_overlapping_node_cpusets = atoi(env); /* 0 drop non-first overlapping nodes, 1 allows with warning, 2 allows without warning */
3984+
}
3985+
39803986
/* NUMA nodes cannot be filtered out */
39813987
indexes = list_sysfsnode(topology, data, &nbnodes);
39823988
if (!indexes)
@@ -4024,7 +4030,7 @@ look_sysfsnode(struct hwloc_topology *topology,
40244030
failednodes++;
40254031
continue;
40264032
}
4027-
if (HWLOC_SHOW_CRITICAL_ERRORS())
4033+
if (allow_overlapping_node_cpusets < 2 && HWLOC_SHOW_CRITICAL_ERRORS())
40284034
fprintf(stderr, "hwloc/linux: node P#%u cpuset intersects with previous nodes, forcing its acceptance\n", osnode);
40294035
}
40304036
hwloc_bitmap_or(nodes_cpuset, nodes_cpuset, cpuset);
@@ -4044,8 +4050,9 @@ look_sysfsnode(struct hwloc_topology *topology,
40444050
dir = hwloc_opendir("/proc/driver/nvidia/gpus", data->root_fd);
40454051
if (dir) {
40464052
struct dirent *dirent;
4047-
char *env = getenv("HWLOC_KEEP_NVIDIA_GPU_NUMA_NODES");
4048-
int keep = env && atoi(env);
4053+
int keep;
4054+
env = getenv("HWLOC_KEEP_NVIDIA_GPU_NUMA_NODES");
4055+
keep = env && atoi(env);
40494056
while ((dirent = readdir(dir)) != NULL) {
40504057
char nvgpunumapath[300], line[256];
40514058
int err;
@@ -4116,8 +4123,9 @@ look_sysfsnode(struct hwloc_topology *topology,
41164123

41174124
if (data->is_knl) {
41184125
/* apply KNL quirks */
4119-
char *env = getenv("HWLOC_KNL_NUMA_QUIRK");
4120-
int noquirk = (env && !atoi(env));
4126+
int noquirk;
4127+
env = getenv("HWLOC_KNL_NUMA_QUIRK");
4128+
noquirk = (env && !atoi(env));
41214129
if (!noquirk) {
41224130
hwloc_linux_knl_numa_quirk(topology, data, nodes, nbnodes, distances, &failednodes);
41234131
free(distances);

0 commit comments

Comments
 (0)