Skip to content

Commit 46d887a

Browse files
committed
Merge pull request open-mpi#587 from ggouaillardet/topic/v2.x/hwloc_cores_count
hwloc: do not count not allowed cores in df_search_cores
2 parents b2a15c5 + a464648 commit 46d887a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

opal/mca/hwloc/base/hwloc_base_util.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,10 @@ 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 */
497+
return;
498+
}
495499
data->npus = 1;
496500
}
497501
*cnt += data->npus;

0 commit comments

Comments
 (0)