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

Commit 7acf499

Browse files
committed
Merge pull request #932 from ggouaillardet/topic/v2.x/hwloc_smt_core_count
hwloc: correctly count cores with at least one allowed PU
2 parents 27facab + 6a8141c commit 7acf499

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)