Le 22/12/2010 21:59, Guy Streeter a écrit : > On 12/22/2010 01:50 PM, Guy Streeter wrote: >> I'm using 1.1 on Fedora 13. I start with >> >> set = hwloc_bitmap_alloc_full() >> >> and it looks like >> >> 0xf...f >> >> Then I call >> >> hwloc_bitmap_from_ith_ulong(set, 1, 0xdeadbeef) >> >> and I get >> >> 0xdeadbeef,0x00000034,0x3f77aed8 >> >> which I don't understand.
Oops, looks like we have a typo, I forgot to reset to first ulong. Patch attached. > hwloc_bitmap_set_ith_ulong() seems to behave in a similar way. > > full: 0xf...f > ith: 0xf...f,,0xdeadbeef,0xffffffff,0xffffffff This is expected. set_ith_ulong replaces exactly one ulong, and ulongs are likely 64bits on your machine (but we always print using 32bit masks to be arch-independent). That's why the third and fourth 32bit masks are replaced above (with 0xdeadbeef and nothing respectively). Brice
Index: src/cpuset.c =================================================================== --- src/cpuset.c (révision 2986) +++ src/cpuset.c (copie de travail) @@ -535,7 +535,7 @@ hwloc_bitmap_reset_by_ulongs(set, i+1); set->ulongs[i] = mask; - for(j=1; j<(unsigned) i; j++) + for(j=0; j<(unsigned) i; j++) set->ulongs[j] = HWLOC_SUBBITMAP_ZERO; set->infinite = 0; }