Brice Goglin, le Mon 19 Nov 2012 21:09:33 +0100, a écrit : > hwloc_bitmap_t bitmap = hwloc_bitmap_alloc(); > hwloc_bitmap_set_only(bitmap, i); > hwloc_set_thread_cpubind(topology, m_threads[i], bitmap, 0); > hwloc_bitmap_free(bitmap);
Or perhaps hwloc_set_thread_cpubind(topology, m_threads[i], hwloc_get_obj_by_type(topology, HWLOC_OBJ_CORE, i), 0); if you want to get core number in logical order rather than physical order (or use HWLOC_OBJ_PU if that's the hardware threads you want to get). > To get the number of processors with hwloc, use something like: > hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_CORE); > or > hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_PU); > Then it depends if you want real cores (the former or hardware threads (the > latter). Samuel