--- opal/mca/paffinity/hwloc/paffinity_hwloc_module.c.old 2012-04-11 10:19:36.766710073 +0200 +++ opal/mca/paffinity/hwloc/paffinity_hwloc_module.c 2012-04-11 10:32:07.398696734 +0200 @@ -167,6 +167,7 @@ int i, ret = OPAL_SUCCESS; hwloc_bitmap_t set; hwloc_topology_t *t; + hwloc_obj_t pu; /* bozo check */ if (NULL == opal_hwloc_topology) { @@ -178,10 +179,11 @@ if (NULL == set) { return OPAL_ERR_OUT_OF_RESOURCE; } - hwloc_bitmap_zero(set); - for (i = 0; ((unsigned int) i) < OPAL_PAFFINITY_BITMASK_CPU_MAX; ++i) { + for (i = 0, pu = hwloc_get_obj_by_type(*t, HWLOC_OBJ_PU, 0); + ((unsigned int) i) < OPAL_PAFFINITY_BITMASK_CPU_MAX; + ++i, pu = pu->next_cousin) { if (OPAL_PAFFINITY_CPU_ISSET(i, mask)) { - hwloc_bitmap_set(set, i); + hwloc_bitmap_set(set, pu->os_index); } } @@ -199,6 +201,7 @@ int i, ret = OPAL_SUCCESS; hwloc_bitmap_t set; hwloc_topology_t *t; + hwloc_obj_t pu; /* bozo check */ if (NULL == opal_hwloc_topology) { @@ -218,8 +221,10 @@ ret = OPAL_ERR_IN_ERRNO; } else { OPAL_PAFFINITY_CPU_ZERO(*mask); - for (i = 0; ((unsigned int) i) < 8 * sizeof(*mask); i++) { - if (hwloc_bitmap_isset(set, i)) { + for (i = 0, pu = hwloc_get_obj_by_type(*t, HWLOC_OBJ_PU, 0); + ((unsigned int) i) < 8 * sizeof(*mask); + i++, pu = pu->next_cousin) { + if (hwloc_bitmap_isset(set, pu->os_index)) { OPAL_PAFFINITY_CPU_SET(i, *mask); } }