walk_linear/
walk_linear.rs

1extern crate hwloc;
2
3use hwloc::Topology;
4
5/// Walk the topology with an array style, from level 0 (always
6/// the system level) to the lowest level (always the proc level).
7fn main() {
8    let topo = Topology::new();
9
10    for i in 0..topo.depth() {
11        println!("*** Objects at level {}", i);
12
13        for (idx, object) in topo.objects_at_depth(i).iter().enumerate() {
14            println!("{}: {}", idx, object);
15        }
16    }
17}