the current bitmap API of hwloc 1.1 supports input/output for bitmaps
using strings that represent a map as hex words. The functions are
hwloc_bitmap_snprintf, hwloc_bitmap_sscanf and the like.
Linux cpusets in addition support an "ASCII list representation" of
bitmaps, like 0-15,32-47. This is much easier to read and to write.
I suggest to add corresponding functions to the hwloc bitmap C API.
Note that there also exists libcpuset and libbitmask in some Linux
distributions. These are originally from SGI. There exist the functions
bitmask_displayhex, bitmask_displaylist, bitmask_parsehex,
I added something like that to the most recent Sys::Hwloc Perl wrapper,
which is currently found at
The code for list input/output of hwloc bitmaps was adapted from recent
linux kernel code, see e.g.
(functions bitmap_scnlistprintf, bitmap_parselist).
Dr. Bernd Kallies
Konrad-Zuse-Zentrum für Informationstechnik Berlin