Open MPI logo

Hardware Locality Users' Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Users mailing list

Subject: Re: [hwloc-users] hwloc set membind function
From: Brice Goglin (Brice.Goglin_at_[hidden])
Date: 2011-09-25 06:30:29


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, how set_membind() can allocate on
> other node?

Add the MIGRATE flag.

> So, what's the difference between HWLOC_MEMBIND_BIND and
> HWLOC_MEMBIND_FIRSTTOUCH?

First touch makes the allocation on the node local to the thread that
touches first (default on Linux).
BIND makes the allocation on the node specified in set_membind.

> Doing the follow test:
>
> omp parallel region
>
> if(tid==0){
> malloc(array)...
> set_area_membind(HWLOCMEMBIND_BIND, node 0)
> }
>
> if (tid==1){
> set_area_membind(HWLOCMEMBIND_BIND, node 1)

If both set_area_membind work on the same array (not on different
halves), this is doubly-wrong:
* you have no guarantee that thread 0 has already finished doing the
malloc before thread 1 does set_area_membind on the buffer.
* doing two set_area_membind on the same entire array is useless, the
second one will overwrite the first one.

Brice