hwloc 0.5.0

Rust bindings for the hwloc hardware locality library.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate hwloc;

use hwloc::Topology;

/// Walk the topology with an array style, from level 0 (always
/// the system level) to the lowest level (always the proc level).
fn main() {
    let topo = Topology::new();

    for i in 0..topo.depth() {
        println!("*** Objects at level {}", i);

        for (idx, object) in topo.objects_at_depth(i).iter().enumerate() {
            println!("{}: {}", idx, object);
        }
    }
}