Open MPI logo

Hardware Locality Users' Mailing List Archives

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

Subject: Re: [hwloc-users] Multiple thread binding
From: Gabriele Fatigati (g.fatigati_at_[hidden])
Date: 2011-08-02 11:21:52


Ok,

and in this way are equivalent?

#pragma omp parallel num_threads(1)
{
hwloc_obj_t core = hwloc_get_obj_by_type(*topology, HWLOC_OBJ_PU, 0);
hwloc_cpuset_t set = hwloc_bitmap_dup(core->cpuset);
hwloc_set_cpubind(*topology, set, HWLOC_CPUBIND_THREAD |
HWLOC_CPUBIND_STRICT);
hwloc_set_cpubind(*topology, set, HWLOC_CPUBIND_THREAD |
HWLOC_CPUBIND_NOMEMBIND);
}

2011/8/2 Gabriele Fatigati <g.fatigati_at_[hidden]>

> Mm, i'm not sure. Suppose this:
>
> $pragma omp parallel num_thread(1)
> {
> hwloc_set_cpubind(*topology, set, HWLOC_CPUBIND_THREAD |
> HWLOC_CPUBIND_STRICT | HWLOC_CPUBIND_NOMEMBIND);
> }
>
> is equivalent to?
>
> $pragma omp parallel num_thread(1)
> {
> hwloc_set_cpubind(*topology, set, HWLOC_CPUBIND_THREAD);
> hwloc_set_cpubind(*topology, set, HWLOC_CPUBIND_STRICT);
> hwloc_set_cpubind(*topology, set, HWLOC_CPUBIND_NOMEMBIND);
>
> }
>
>
> You said HWLOC_CPUBIND_STRICT bind process and memory. Why also the memory?
> It should strictly design which CPU will assigned to a process/thread, or
> does more?
>
>
> 2011/8/2 Samuel Thibault <samuel.thibault_at_[hidden]>
>
>> Gabriele Fatigati, le Tue 02 Aug 2011 16:23:12 +0200, a écrit :
>> > hwloc_set_cpubind(*topology, set, HWLOC_CPUBIND_THREAD |
>> HWLOC_CPUBIND_STRICT
>> > | HWLOC_CPUBIND_NOMEMBIND);
>> >
>> > is it possible do multiple call to hwloc_set_cpubind passing each flag
>> per
>> > time?
>> >
>> > hwloc_set_cpubind(*topology, set, HWLOC_CPUBIND_THREAD);
>> > hwloc_set_cpubind(*topology, set, HWLOC_CPUBIND_STRICT);
>> > hwloc_set_cpubind(*topology, set, HWLOC_CPUBIND_NOMEMBIND);
>> >
>> > or only the last have effect?
>>
>> Err, it will simply do the three operations, i.e. first bind the current
>> thread and memory, then strictly bind the whole process and memory, and
>> eventually bind the process but not memory (but it will still bound
>> since it was by the second call).
>>
>> Samuel
>> _______________________________________________
>> hwloc-users mailing list
>> hwloc-users_at_[hidden]
>> http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users
>>
>
>
>
> --
> Ing. Gabriele Fatigati
>
> Parallel programmer
>
> CINECA Systems & Tecnologies Department
>
> Supercomputing Group
>
> Via Magnanelli 6/3, Casalecchio di Reno (BO) Italy
>
> www.cineca.it Tel: +39 051 6171722
>
> g.fatigati [AT] cineca.it
>

-- 
Ing. Gabriele Fatigati
Parallel programmer
CINECA Systems & Tecnologies Department
Supercomputing Group
Via Magnanelli 6/3, Casalecchio di Reno (BO) Italy
www.cineca.it                    Tel:   +39 051 6171722
g.fatigati [AT] cineca.it