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

hwloc: correctly count cores with at least one allowed PU #932

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions opal/mca/hwloc/base/hwloc_base_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,11 @@ static void df_search_cores(hwloc_obj_t obj, unsigned int *cnt)
obj->userdata = (void*)data;
}
if (NULL == opal_hwloc_base_cpu_set) {
if (!hwloc_bitmap_isincluded(obj->cpuset, obj->allowed_cpuset)) {
/* do not count not allowed cores */
if (!hwloc_bitmap_intersects(obj->cpuset, obj->allowed_cpuset)) {
/*
* do not count not allowed cores (e.g. cores with zero allowed PU)
* if SMT is enabled, do count cores with at least one allowed hwthread
*/
return;
}
data->npus = 1;
Expand Down