1
1

hwloc: correctly count cores with at least one allowed PU

when SMT is enabled, a core must be counted as long as one of its hwthread is allowed

Thanks Ben Menadue for the report.

This fixes a regression from open-mpi/ompi@6d149554a7
Этот коммит содержится в:
Gilles Gouaillardet 2016-01-29 11:54:34 +09:00
родитель 3f7fff5780
Коммит d529951206

Просмотреть файл

@ -492,8 +492,11 @@ static void df_search_cores(hwloc_obj_t obj, unsigned int *cnt)
obj->userdata = (void*)data; obj->userdata = (void*)data;
} }
if (NULL == opal_hwloc_base_cpu_set) { if (NULL == opal_hwloc_base_cpu_set) {
if (!hwloc_bitmap_isincluded(obj->cpuset, obj->allowed_cpuset)) { if (!hwloc_bitmap_intersects(obj->cpuset, obj->allowed_cpuset)) {
/* do not count not allowed cores */ /*
* 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; return;
} }
data->npus = 1; data->npus = 1;