@@ -3972,11 +3972,17 @@ look_sysfsnode(struct hwloc_topology *topology,
3972
3972
unsigned failednodes = 0 ;
3973
3973
unsigned i ;
3974
3974
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 ;
3976
3977
int need_memcaches = hwloc_filter_check_keep_object_type (topology , HWLOC_OBJ_MEMCACHE );
3977
3978
3978
3979
hwloc_debug ("\n\n * Topology extraction from /sys/devices/system/node *\n\n" );
3979
3980
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
+
3980
3986
/* NUMA nodes cannot be filtered out */
3981
3987
indexes = list_sysfsnode (topology , data , & nbnodes );
3982
3988
if (!indexes )
@@ -4024,7 +4030,7 @@ look_sysfsnode(struct hwloc_topology *topology,
4024
4030
failednodes ++ ;
4025
4031
continue ;
4026
4032
}
4027
- if (HWLOC_SHOW_CRITICAL_ERRORS ())
4033
+ if (allow_overlapping_node_cpusets < 2 && HWLOC_SHOW_CRITICAL_ERRORS ())
4028
4034
fprintf (stderr , "hwloc/linux: node P#%u cpuset intersects with previous nodes, forcing its acceptance\n" , osnode );
4029
4035
}
4030
4036
hwloc_bitmap_or (nodes_cpuset , nodes_cpuset , cpuset );
@@ -4044,8 +4050,9 @@ look_sysfsnode(struct hwloc_topology *topology,
4044
4050
dir = hwloc_opendir ("/proc/driver/nvidia/gpus" , data -> root_fd );
4045
4051
if (dir ) {
4046
4052
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 );
4049
4056
while ((dirent = readdir (dir )) != NULL ) {
4050
4057
char nvgpunumapath [300 ], line [256 ];
4051
4058
int err ;
@@ -4116,8 +4123,9 @@ look_sysfsnode(struct hwloc_topology *topology,
4116
4123
4117
4124
if (data -> is_knl ) {
4118
4125
/* 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 ));
4121
4129
if (!noquirk ) {
4122
4130
hwloc_linux_knl_numa_quirk (topology , data , nodes , nbnodes , distances , & failednodes );
4123
4131
free (distances );
0 commit comments