Le 04/01/2011 12:50, Bernd Kallies a écrit : > Dear all, > > 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. >
Hello Bernd, Right, this has been in the TODO list for a while, I haven't had time to work on it yet. > 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, > bitmask_parselist. > Both are LGPL unfortunately, we can't use this in hwloc (BSD). > I added something like that to the most recent Sys::Hwloc Perl wrapper, > which is currently found at > > http://www.cpan.org/modules/by-authors/id/B/BK/BKA/Sys-Hwloc-0.07.tar.gz > > The code for list input/output of hwloc bitmaps was adapted from recent > linux kernel code, see e.g. > http://lxr.free-electrons.com/source/lib/bitmap.c > (functions bitmap_scnlistprintf, bitmap_parselist). > This is GPL as well. The code isn't hard to write anyway, I'll try to do it for 1.2. I guess it would be hwloc_bitmap_list_snprintf/sscanf (we already have hwloc_bitmap_taskset_snprintf/sccanf for taskset format printing/parsing). Brice