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: Gabriele Fatigati (g.fatigati_at_[hidden])
Date: 2011-08-10 09:40:30


Yes of course:

char*bitmap_string[256];

hwloc_cpuset_t set = hwloc_bitmap_alloc();

int return_value = hwloc_get_last_cpu_location(topology, set,
 HWLOC_CPUBIND_THREAD);

printf( " bitmap_string: %s \n", bitmap_string[0]);

give me:

0x00000800

converted in binary:

100000000000

So, CPU 0 I suppose, but is not where i bound my thread .. :(

2011/8/10 Samuel Thibault <samuel.thibault_at_[hidden]>

> Gabriele Fatigati, le Wed 10 Aug 2011 15:29:43 +0200, a écrit :
> > hwloc_obj_t core = hwloc_get_obj_by_type(topology, HWLOC_OBJ_MACHINE, 0);
> >
> > int return_value = hwloc_get_last_cpu_location(topology, core->cpuset,
> > HWLOC_CPUBIND_THREAD);
> >
> > and now in "core->cpuset" I get the new cpuset bitmap, where
> process/threads
> > runs. Is it right?
>
> Err, yes, but why using core->cpuset?? Giving it as parameter to
> hwloc_get_last_cpu_location will only overwrite its content with the
> content returned by hwloc_get_last_cpu_location (which is forbidden, see
> the documentation of the cpuset field).
>
> Samuel
> _______________________________________________
> 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