Open MPI logo

Hardware Locality Development Mailing List Archives

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

Subject: Re: [hwloc-devel] [hwloc-svn] svn:hwloc r3971
From: Brice Goglin (Brice.Goglin_at_[hidden])
Date: 2011-11-25 08:59:43


Le 25/11/2011 08:56, sthibaul_at_[hidden] a écrit :
> +static hwloc_obj_t hwloc_topology_get_pcidev(hwloc_topology_t topology, hwloc_obj_t parent, int domain, int bus, int dev)
> +{
> + hwloc_obj_t child;
> +
> + if (parent->type == HWLOC_OBJ_PCI_DEVICE
> + && parent->attr->pcidev.domain == domain
> + && parent->attr->pcidev.bus == bus
> + && parent->attr->pcidev.dev == dev)
> + return parent;
> +
> + for (child = parent->first_child; child; child = child->next_sibling) {
> + hwloc_obj_t found;
> + found = hwloc_topology_get_pcidev(topology, child, domain, bus, dev);
> + if (found)
> + return found;
> + }
> + pci_card = hwloc_topology_get_pcidev(topology, topology->levels[0][0], domain, bus, dev);
> + if (!pci_card)
> + return;

hwloc_get_pcidev_by_busid(topology, domain, bus, dev, 0) should work
here (hwloc/helper.h). Unless you have some complex plans with the
"parent" parameter?

Brice