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 sai

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 set_membind and malloc, bu

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 area-sp

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 HWLOC

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){ set_membind(HWLOCMEMBI

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Brice Goglin
Le 25/09/2011 12:41, Gabriele Fatigati a écrit : > > > * 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?) It's for an memory area. > set_

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 thread 2 has no reference w

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, an

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 the

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 o

Re: [hwloc-users] hwloc set membind function

2011-09-25 Thread Gabriele Fatigati
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 or process runs?) 2) Which is the behaviour of HWLOC_MEMBIND_BI