Skip to content

Commit bfefed4

Browse files
author
rhc54
committed
Merge pull request open-mpi#931 from ggouaillardet/topic/v1.10/hwloc_smt_core_count
hwloc: correctly count cores with at least one allowed PU
2 parents b119729 + 7eeffda commit bfefed4

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
@@ -515,8 +515,11 @@ static void df_search_cores(hwloc_obj_t obj, unsigned int *cnt)
515515
obj->userdata = (void*)data;
516516
}
517517
if (NULL == opal_hwloc_base_cpu_set) {
518-
if (!hwloc_bitmap_isincluded(obj->cpuset, obj->allowed_cpuset)) {
519-
/* do not count not allowed cores */
518+
if (!hwloc_bitmap_intersects(obj->cpuset, obj->allowed_cpuset)) {
519+
/*
520+
* do not count not allowed cores (e.g. cores with zero allowed PU)
521+
* if SMT is enabled, do count cores with at least one allowed hwthread
522+
*/
520523
return;
521524
}
522525
data->npus = 1;

0 commit comments

Comments
 (0)