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: Gabriele Fatigati (g.fatigati_at_[hidden])
Date: 2011-09-25 06:41:15


>
>
> * 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, and set_area_membind for thread 2 for futures
allocations.

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?

2011/9/25 Brice Goglin <Brice.Goglin_at_[hidden]>

> **
> 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
>
>
> _______________________________________________
> hwloc-users mailing list
> hwloc-users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users
>

-- 
Ing. Gabriele Fatigati
HPC specialist
SuperComputing Applications and Innovation Department
Via Magnanelli 6/3, Casalecchio di Reno (BO) Italy
www.cineca.it                    Tel:   +39 051 6171722
g.fatigati [AT] cineca.it