Re: [hwloc-users] hwloc get cpubind function

2011-08-10 Thread Gabriele Fatigati
Ok, thanks! 2011/8/10 Samuel Thibault > Samuel Thibault, le Wed 10 Aug 2011 16:24:39 +0200, a écrit : > > Gabriele Fatigati, le Wed 10 Aug 2011 16:13:27 +0200, a écrit : > > > there is something wrong. I'm using two thread, the first one is bound > on > > >

Re: [hwloc-users] hwloc get cpubind function

2011-08-10 Thread Samuel Thibault
Samuel Thibault, le Wed 10 Aug 2011 16:24:39 +0200, a écrit : > Gabriele Fatigati, le Wed 10 Aug 2011 16:13:27 +0200, a écrit : > > there is something wrong. I'm using two thread, the first one is bound on > > HWLOC_OBJ_PU number 2, the second one on  HWLOC_OBJ_PU number 10, > > It seems that

Re: [hwloc-users] hwloc get cpubind function

2011-08-10 Thread Samuel Thibault
Gabriele Fatigati, le Wed 10 Aug 2011 16:13:27 +0200, a écrit : > there is something wrong. I'm using two thread, the first one is bound on > HWLOC_OBJ_PU number 2, the second one on  HWLOC_OBJ_PU number 10, It seems that hwloc_linux_get_tid_last_cpu_location erroneously assume that

Re: [hwloc-users] hwloc get cpubind function

2011-08-10 Thread Gabriele Fatigati
Mm, there is something wrong. I'm using two thread, the first one is bound on HWLOC_OBJ_PU number 2, the second one on HWLOC_OBJ_PU number 10, and hwloc_get_last_cpu_location() give me the same CPU index for each thread.. ( machine is not SMT). But from linux "top" command I see CPU 2 and 10

Re: [hwloc-users] hwloc get cpubind function

2011-08-10 Thread Samuel Thibault
Gabriele Fatigati, le Wed 10 Aug 2011 15:41:19 +0200, a écrit : > hwloc_cpuset_t set = hwloc_bitmap_alloc(); > > int return_value = hwloc_get_last_cpu_location(topology, set, >  HWLOC_CPUBIND_THREAD); > > printf( " bitmap_string: %s \n", bitmap_string[0]); > > give me: > > 0x0800 > >

Re: [hwloc-users] hwloc get cpubind function

2011-08-10 Thread Gabriele Fatigati
Yes of course: char*bitmap_string[256]; hwloc_cpuset_t set = hwloc_bitmap_alloc(); int return_value = hwloc_get_last_cpu_location(topology, set, HWLOC_CPUBIND_THREAD); printf( " bitmap_string: %s \n", bitmap_string[0]); give me: 0x0800 converted in binary: 1000 So, CPU 0 I

Re: [hwloc-users] hwloc get cpubind function

2011-08-10 Thread Samuel Thibault
Gabriele Fatigati, le Wed 10 Aug 2011 15:29:43 +0200, a écrit : > hwloc_obj_t core = hwloc_get_obj_by_type(topology, HWLOC_OBJ_MACHINE, 0); > > int return_value = hwloc_get_last_cpu_location(topology, core->cpuset, > HWLOC_CPUBIND_THREAD); > > and now in "core->cpuset" I get the new cpuset

Re: [hwloc-users] hwloc get cpubind function

2011-08-10 Thread Gabriele Fatigati
Hi Samuel, please show this little example: hwloc_obj_t core = hwloc_get_obj_by_type(topology, HWLOC_OBJ_MACHINE, 0); int return_value = hwloc_get_last_cpu_location(topology, core->cpuset, HWLOC_CPUBIND_THREAD); and now in "core->cpuset" I get the new cpuset bitmap, where process/threads runs.

Re: [hwloc-users] hwloc get cpubind function

2011-08-10 Thread Samuel Thibault
Gabriele Fatigati, le Wed 10 Aug 2011 09:35:19 +0200, a écrit : > these lines, doesn't works: > > set = hwloc_bitmap_alloc(); > hwloc_get_cpubind(topology, , 0); > > hwloc_get_cpubind() crash, because I have to pass set, not i suppose. Right, of course. > I think hwloc_get_last_cpu_location()

Re: [hwloc-users] hwloc get cpubind function

2011-08-10 Thread Gabriele Fatigati
Hi Samuel, these lines, doesn't works: set = hwloc_bitmap_alloc(); hwloc_get_cpubind(topology, , 0); hwloc_get_cpubind() crash, because I have to pass set, not i suppose. I think hwloc_get_last_cpu_location() is used coupled with hwloc_get_cpubind()? hwloc_get_cpubind() give me the cpuset,