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: Samuel Thibault (samuel.thibault_at_[hidden])
Date: 2011-08-02 11:17:56

Gabriele Fatigati, le Tue 02 Aug 2011 17:13:15 +0200, a écrit :
> $pragma omp parallel num_thread(1)
> {
> hwloc_set_cpubind(*topology, set,  HWLOC_CPUBIND_THREAD | HWLOC_CPUBIND_STRICT 
> }
> 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);
> }

As I said, no. The latter will perform the three operations one after
the other, piling the effect of each of them, which is different from
specifying all the flags at the same time. For instance, in the first
case, only the current thread will be bound, while in the second case,
the second and third calls will bind the whole process! (since there is
no THREAD flag).

> You said HWLOC_CPUBIND_STRICT bind process and memory.

I should have said "potentially memory too". And it's not the STRICT
flag which does this, it's the absence of NOMEMBIND which does this.

> Why also the memory?

Because some OS do this too.