Re: [hwloc-users] Bind current thread to a specific cpu

2011-08-18 Thread Samuel Thibault
PULVERAIL Sébastien, le Thu 18 Aug 2011 11:55:21 +0200, a écrit : > I use logical ids, so I do this : > >     hwloc_obj_t cpu = hwloc_get_obj_by_type(topology, > HWLOC_OBJ_PU, i); >     int err = hwloc_set_cpubind(topology, cpu->cpuset, > HWLOC_CPUBIND_THREAD); > > Is it

Re: [hwloc-users] Bind current thread to a specific cpu

2011-08-18 Thread Brice Goglin
Le 18/08/2011 11:48, PULVERAIL Sébastien a écrit : > > I use logical ids, so I do this : > > > > hwloc_obj_t cpu = hwloc_get_obj_by_type(topology, > HWLOC_OBJ_PU, i); > > int err = hwloc_set_cpubind(topology, cpu->cpuset, > HWLOC_CPUBIND_THREAD); > > > > Is it co

Re: [hwloc-users] Bind current thread to a specific cpu

2011-08-18 Thread PULVERAIL Sébastien
I use logical ids, so I do this : hwloc_obj_t cpu = hwloc_get_obj_by_type(topology, HWLOC_OBJ_PU, i); int err = hwloc_set_cpubind(topology, cpu->cpuset, HWLOC_CPUBIND_THREAD); Is it correct ? -- Seb De : hwloc-users-boun...@open-mpi.org [mailto:hwloc-u

Re: [hwloc-users] Bind current thread to a specific cpu

2011-08-18 Thread Brice Goglin
Are you talking about logical ids (the one given by hwloc) or physical/OS ids (the one given by the OS and possibly in strange order) ? You should avoid using physical ids, but... If logical, you can hwloc_get_obj_by_type() to get the corresponding object, then use its ->cpuset. If physical, you

[hwloc-users] Bind current thread to a specific cpu

2011-08-18 Thread PULVERAIL Sébastien
Hi, I’m looking for a function that allows to bind the current thread to a specific cpu given by its id. I found the function hwloc_set_thread_cpubind to bind a thread to a cpuset. I also found the function hwloc_bitmap_singlify to keep only one index in the cpuset. But I didn’t found any