Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit d529951

Browse files
committed
hwloc: correctly count cores with at least one allowed PU
when SMT is enabled, a core must be counted as long as one of its hwthread is allowed Thanks Ben Menadue for the report. This fixes a regression from open-mpi/ompi@6d14955
1 parent 3f7fff5 commit d529951

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

opal/mca/hwloc/base/hwloc_base_util.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,11 @@ static void df_search_cores(hwloc_obj_t obj, unsigned int *cnt)
492492
obj->userdata = (void*)data;
493493
}
494494
if (NULL == opal_hwloc_base_cpu_set) {
495-
if (!hwloc_bitmap_isincluded(obj->cpuset, obj->allowed_cpuset)) {
496-
/* do not count not allowed cores */
495+
if (!hwloc_bitmap_intersects(obj->cpuset, obj->allowed_cpuset)) {
496+
/*
497+
* do not count not allowed cores (e.g. cores with zero allowed PU)
498+
* if SMT is enabled, do count cores with at least one allowed hwthread
499+
*/
497500
return;
498501
}
499502
data->npus = 1;

0 commit comments

Comments
 (0)