Skip to content

Commit a464648

Browse files
committed
hwloc: do not count not allowed cores in df_search_cores
(cherry picked from commit open-mpi/ompi@975b6fd)
1 parent 97ba09f commit a464648

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)