Re: [hwloc-users] PCI devices topology

2015-01-08 Thread Brice Goglin
Hello,

hwloc_topology_init(&topology);
hwloc_topology_set_flags(topology, HWLOC_TOPOLOGY_FLAG_IO_DEVICES);
hwloc_topology_load(topology);

Then you can use hwloc_get_next_pcidev() to iterate over the entire list
PCI devices. If you want to know whether it's connected to a specific
NUMA node, start from the PCI hwloc_obj_t and walk up the ->parent
pointer until you find a NUMA node object (not guaranteed, could be
connected to something else, even something that is not a child of a
NUMA node, for instance the entire machine object).

Otherwise, you can start at the NUMA node object, walk its children
until you find some object of type Bridge, then recursively walk
children to find all PCI objects (it's often organized as a imbalanced
tree, there can other bridges in the middle).

Brice




Le 08/01/2015 17:19, Pradeep Kiruvale a écrit :
> Hi All,
>
> I am looking for a sample application which can provide me the list of
> PCI devices connected
> to each NUMA node. Please let me know how can access the information
> programmatically on 
> a Linux system using hwloc APIs.
>
> Regards,
> Pradeep
>
>
>
>
> ___
> hwloc-users mailing list
> hwloc-us...@open-mpi.org
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/hwloc-users
> Link to this post: 
> http://www.open-mpi.org/community/lists/hwloc-users/2015/01/1145.php



[hwloc-users] PCI devices topology

2015-01-08 Thread Pradeep Kiruvale
Hi All,

I am looking for a sample application which can provide me the list of PCI
devices connected
to each NUMA node. Please let me know how can access the information
programmatically on
a Linux system using hwloc APIs.

Regards,
Pradeep