Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: [hwloc-devel] Feature request: bitmap ASCII list representation
From: Bernd Kallies (kallies_at_[hidden])
Date: 2011-01-04 06:50:44


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.

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.

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).

Regards BK

-- 
Dr. Bernd Kallies
Konrad-Zuse-Zentrum für Informationstechnik Berlin
Takustr. 7
14195 Berlin
Tel: +49-30-84185-270
Fax: +49-30-84185-311
e-mail: kallies_at_[hidden]