Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Brice Goglin
Le 25/09/2011 21:05, Gabriele Fatigati a écrit : > Ok, > > so, set_membind() merged with HWLOC_MEMBIND_BIND is useless? It's likely the most useful memory binding case. It's similar to what numactl --membind does for instance, very common. > The behaviour I want to set is it possible? I just

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Gabriele Fatigati
Ok, so, set_membind() merged with HWLOC_MEMBIND_BIND is useless? The behaviour I want to set is it possible? 2011/9/25 Brice Goglin > Le 25/09/2011 20:57, Gabriele Fatigati a écrit : > > after done this, memory is allocated not in a local node of thread > > that does

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Brice Goglin
Le 25/09/2011 20:57, Gabriele Fatigati a écrit : > after done this, memory is allocated not in a local node of thread > that does set_membind and malloc, but in node of thread that touches > it. And I don't understand this behaviour :( Memory is allocated when first-touched. If there's no

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Gabriele Fatigati
My goal is to set memory binding policy for future allocations for each thread. So, according to definition of set_membind function: "Set the default memory binding policy of the current process or thread to prefer the NUMA node(s) near the specified cpuset." and according to definition of

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Brice Goglin
Le 25/09/2011 20:27, Gabriele Fatigati a écrit : > if(tid==0){ > > set_membind(HWLOCMEMBIND_BIND, node 0) > malloc(array)... > > } > > if (tid==1){ > set_membind(HWLOCMEMBIND_BIND, node 1) > > for(i...) > array(i) > } > > end parallel region > > > array is allocated on node 1, not node 0 as I

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Gabriele Fatigati
>set_membind done by thread 2 has no reference with malloc(array) done by first thread, so why it influence the real >allocation of this array? It doesn't. In my example seems yes... if(tid==0){ set_membind(HWLOCMEMBIND_BIND, node 0) malloc(array)... } if (tid==1){

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Gabriele Fatigati
2011/9/25 Gabriele Fatigati > >> * doing two set_area_membind on the same entire array is useless, the > second one will overwrite the first one. > > But set_area_membind is for memory in general, not for a particular malloc. > ( Is it rigth?) > > set_membind done by

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Gabriele Fatigati
> > > * doing two set_area_membind on the same entire array is useless, the second one will overwrite the first one. But set_area_membind is for memory in general, not for a particular malloc. ( Is it rigth?) In my example, I'm doing set_area_membind for thread 0 before to do some allocations,

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Brice Goglin
Le 25/09/2011 12:19, Gabriele Fatigati a écrit : > Hi Brice, > > >The flag says "when the first touch occurs and the physical memory is > allocated for real, don't allocate on the local node (default), but > >rather allocate where specified by set_membind". > > If is it already allocated for real,

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Gabriele Fatigati
Hi Brice, >The flag says "when the first touch occurs and the physical memory is allocated for real, don't allocate on the local node (default), but >rather allocate where specified by set_membind". If is it already allocated for real, how set_membind() can allocate on other node? So, what's

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Brice Goglin
Le 25/09/2011 11:14, Gabriele Fatigati a écrit : > > I report my questions in a different way (in the first question i did > a mistake): > > > 1) I don't understand the means of set_membind() function. Why I > should to allocate in a node "near" my cpuset and not in my local node > (where thread

Re: [hwloc-users] hwloc set membind function

2011-09-22 Thread Gabriele Fatigati
Hi, some questions: 1) I don't understand the means of HWLOC_MEMBIND_BIND policy. Why I should to allocate in a node "near" my cpuset and not in my local node ( where thread or process runs?) 2) My goal is to replicate the behaviour of set_area_membind_nodeset() in some manner for all futures

Re: [hwloc-users] hwloc set membind function

2011-09-22 Thread Brice Goglin
Le 22/09/2011 12:20, Gabriele Fatigati a écrit : > NUMA node(s) near the specified cpuset. > > What does "nodes near the specified cpuset" means? The node wherethe > specified cpuset lives? > Set the default memory binding policy of the current process or thread > to prefer the The node near

[hwloc-users] hwloc set membind function

2011-09-22 Thread Gabriele Fatigati
Dear hwloc users and developers, reading the manual about hwloc set membind() function: Set the default memory binding policy of the current process or thread to prefer the NUMA node(s) near the specified cpuset. What does "nodes near the specified cpuset" means? The node wherethe specified