---
name: "hwlocality_traversal"
section: "3"
platform: "linux"
package: "libhwloc-doc"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/hwlocality_traversal"
---

# hwlocality\_traversal(3)

## NAME

Retrieve Objects -

### Functions

 **hwloc\_obj\_t** **hwloc\_get\_obj\_by\_depth** (**hwloc\_topology\_t** topology, unsigned depth, unsigned idx) \
 static inline **hwloc\_obj\_t** **hwloc\_get\_obj\_by\_type** (**hwloc\_topology\_t** topology, **hwloc\_obj\_type\_t** type, unsigned idx) \

## Detailed Description

Be sure to see the figure in **Terms and Definitions** that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one socket has fewer caches than its peers.

## Function Documentation

### hwloc\_obj\_t hwloc\_get\_obj\_by\_depth (hwloc\_topology\_ttopology, unsigneddepth, unsignedidx)

Returns the topology object at logical index `idx` from depth `depth`.

### static inline hwloc\_obj\_t hwloc\_get\_obj\_by\_type (hwloc\_topology\_ttopology, hwloc\_obj\_type\_ttype, unsignedidx)` [static]`

Returns the topology object at logical index `idx` with type `type`. If no object for that type exists, `NULL` is returned. If there are several levels with objects of that type, `NULL` is returned and ther caller may fallback to **hwloc\_get\_obj\_by\_depth()**.

## Author

Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code.
