Le 23/06/2010 22:27, Jeff Squyres a écrit :
> Hm.  We should be.  Here's the hwloc plugin code for setting CPU affinity 
> (it's static because it's invoked by function pointer):
>
> static int module_set(opal_paffinity_base_cpu_set_t mask)
> {
>     int i, ret = OPAL_SUCCESS;
>     hwloc_cpuset_t set;
>     hwloc_topology_t *t = &mca_paffinity_hwloc_component.topology;
>
>     set = hwloc_cpuset_alloc();
>     hwloc_cpuset_zero(set);
>     for (i = 0; ((unsigned int) i) < OPAL_PAFFINITY_BITMASK_T_NUM_BITS; ++i) {
>         if (OPAL_PAFFINITY_CPU_ISSET(i, mask) &&
>             i < mca_paffinity_hwloc_component.cpuset_max_size) {
>             hwloc_cpuset_cpu(set, i);
>   

Don't you want hwloc_cpuset_set(set, i) instead ?
hwloc_cpuset_cpu(set, i) changes the cpuset into a single CPU, i.e. it's
zero(set) + set(set, i).

Brice

Reply via email to