Xen will need it.
+ The synthetic backend now accepts extended types such as L2Cache, L1i or
Group3. lstopo also exports synthetic strings using these extended types.
* Plugins
- + Add the new hwloc_alloc_root_sets() function for plugins that discover CPUs.
+ + Add hwloc_alloc_root_sets() and hwloc_setup_pu_level() functions for
+ plugins that discover CPUs.
* Tools
+ Add -e or --get-last-cpu-location to hwloc-ps to report where
processes/threads run instead of where they are bound.
*/
HWLOC_DECLSPEC int hwloc_alloc_root_sets(struct hwloc_topology *topology);
+/** \brief Create a level of \p nb PU objects starting from index 0.
+ *
+ * Used for creating PU objects when there are no holes in the index list.
+ */
+HWLOC_DECLSPEC int hwloc_setup_pu_level(struct hwloc_topology *topology, unsigned nb);
+
/** \brief Make sure that plugins can lookup core symbols.
*
* This is a sanity check to avoid lazy-lookup failures when libhwloc
#define hwloc_alloc_setup_object HWLOC_NAME(alloc_setup_object)
#define hwloc_fill_object_sets HWLOC_NAME(fill_object_sets)
#define hwloc_alloc_root_sets HWLOC_NAME(alloc_root_sets)
+#define hwloc_setup_pu_level HWLOC_NAME(setup_pu_level)
#define hwloc_insert_pci_device_list HWLOC_NAME(insert_pci_device_list)
#define hwloc_pci_find_cap HWLOC_NAME(pci_find_cap)
#define hwloc_xml_imported_distances_s HWLOC_NAME(xml_imported_distances_s)
-#define hwloc_setup_pu_level HWLOC_NAME(setup_pu_level)
#define hwloc_get_sysctlbyname HWLOC_NAME(get_sysctlbyname)
#define hwloc_get_sysctl HWLOC_NAME(get_sysctl)
#define hwloc_fallback_nbprocessors HWLOC_NAME(fallback_nbprocessors)
struct hwloc_backend * backends;
};
-extern void hwloc_setup_pu_level(struct hwloc_topology *topology, unsigned nb_pus);
extern int hwloc_get_sysctlbyname(const char *name, int64_t *n);
extern int hwloc_get_sysctl(int name[], unsigned namelen, int *n);
extern unsigned hwloc_fallback_nbprocessors(struct hwloc_topology *topology);
}
/*
- * Use the given number of processors and the optional online cpuset if given
- * to set a PU level.
+ * Use the given number of processors to set a PU level.
*/
-void
+int
hwloc_setup_pu_level(struct hwloc_topology *topology,
unsigned nb_pus)
{
struct hwloc_obj *obj;
- unsigned oscpu,cpu;
+ unsigned oscpu;
hwloc_debug("%s", "\n\n * CPU cpusets *\n\n");
- for (cpu=0,oscpu=0; cpu<nb_pus; oscpu++)
+ for (oscpu=0; oscpu<nb_pus; oscpu++)
{
obj = hwloc_alloc_setup_object(HWLOC_OBJ_PU, oscpu);
obj->cpuset = hwloc_bitmap_alloc();
hwloc_bitmap_only(obj->cpuset, oscpu);
- hwloc_debug_2args_bitmap("cpu %u (os %u) has cpuset %s\n",
- cpu, oscpu, obj->cpuset);
+ hwloc_debug_1arg_bitmap("OS cpu %u has cpuset %s\n",
+ oscpu, obj->cpuset);
hwloc_insert_object_by_cpuset(topology, obj);
-
- cpu++;
}
+
+ return 0;
}
static void