]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/fiber/examples/numa/topology.cpp
2 // Copyright Oliver Kowalke 2017.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
13 #include <boost/assert.hpp>
14 #include <boost/fiber/numa/topology.hpp>
16 int main( int argc
, char * argv
[]) {
18 std::vector
< boost::fibers::numa::node
> topo
= boost::fibers::numa::topology();
19 for ( auto n
: topo
) {
20 std::cout
<< "node: " << n
.id
<< " | ";
21 std::cout
<< "cpus: ";
22 for ( auto cpu_id
: n
.logical_cpus
) {
23 std::cout
<< cpu_id
<< " ";
25 std::cout
<< "| distance: ";
26 for ( auto d
: n
.distance
) {
27 std::cout
<< d
<< " ";
29 std::cout
<< std::endl
;
31 std::cout
<< "done" << std::endl
;
33 } catch ( std::exception
const& ex
) {
34 std::cerr
<< "exception: " << ex
.what() << std::endl
;