Open MPI logo

Hardware Locality Users' Mailing List Archives

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

Subject: Re: [hwloc-users] hwloc get cpubind function
From: Samuel Thibault (samuel.thibault_at_[hidden])
Date: 2011-08-11 12:40:38


Gabriele Fatigati, le Thu 11 Aug 2011 18:26:28 +0200, a écrit :
> Gabriele Fatigati, le Thu 11 Aug 2011 18:05:25 +0200, a écrit :
> > char* bitmap_string=(char*)malloc(256);
> >
> > hwloc_bitmap_t set = hwloc_bitmap_alloc();
> >
> > hwloc_linux_get_tid_cpubind(&topology, tid, set);
>
> with gettid() works well.

Well in that case you can use the more portable

hwloc_get_cpubind(topology, set, HWLOC_CPUBIND_THREAD);

which will also work on non-Linux.

Samuel