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

# hwlocality\_information(3)

## NAME

Get Some Topology Information -

### Enumerations

enum **hwloc\_get\_type\_depth\_e** { **HWLOC\_TYPE\_DEPTH\_UNKNOWN**, **HWLOC\_TYPE\_DEPTH\_MULTIPLE**, **HWLOC\_TYPE\_DEPTH\_BRIDGE**, **HWLOC\_TYPE\_DEPTH\_PCI\_DEVICE**, **HWLOC\_TYPE\_DEPTH\_OS\_DEVICE** }\

### Functions

 unsigned **hwloc\_topology\_get\_depth** (**hwloc\_topology\_t** restrict topology) \
  int **hwloc\_get\_type\_depth** (**hwloc\_topology\_t** topology, **hwloc\_obj\_type\_t** type)\
  **hwloc\_obj\_type\_t** **hwloc\_get\_depth\_type** (**hwloc\_topology\_t** topology, unsigned depth) \
  unsigned **hwloc\_get\_nbobjs\_by\_depth** (**hwloc\_topology\_t** topology, unsigned depth) \
 static inline int **hwloc\_get\_nbobjs\_by\_type** (**hwloc\_topology\_t** topology, **hwloc\_obj\_type\_t** type) \
  int **hwloc\_topology\_is\_thissystem** (**hwloc\_topology\_t** restrict topology) \

## 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.

## Enumeration Type Documentation

### enum hwloc\_get\_type\_depth\_e

**Enumerator:**

- *HWLOC\_TYPE\_DEPTH\_UNKNOWN*

  *No object of given type exists in the topology.*

- *HWLOC\_TYPE\_DEPTH\_MULTIPLE*

  *Objects of given type exist at different depth in the topology.*

- *HWLOC\_TYPE\_DEPTH\_BRIDGE*

  *Virtual depth for bridge object level.*

- *HWLOC\_TYPE\_DEPTH\_PCI\_DEVICE*

  *Virtual depth for PCI device object level.*

- *HWLOC\_TYPE\_DEPTH\_OS\_DEVICE*

  *Virtual depth for software device object level.*

## Function Documentation

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

*Returns the type of objects at depth* `depth`*.* **Returns:**

*-1 if depth* `depth` *does not exist.*

### unsigned hwloc\_get\_nbobjs\_by\_depth (hwloc\_topology\_ttopology, unsigneddepth)

*Returns the width of level at depth* `depth`*.*

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

*Returns the width of level type* `type`*. If no object for that type exists, 0 is returned. If there are several levels with objects of that type, -1 is returned.*

### int hwloc\_get\_type\_depth (hwloc\_topology\_ttopology, hwloc\_obj\_type\_ttype)

*Returns the depth of objects of type* `type`*. If no object of this type is present on the underlying architecture, or if the OS doesn't provide this kind of information, the function returns HWLOC\_TYPE\_DEPTH\_UNKNOWN.*

*If type is absent but a similar type is acceptable, see also* **hwloc\_get\_type\_or\_below\_depth()** *and* **hwloc\_get\_type\_or\_above\_depth()***.*

*If some objects of the given type exist in different levels, for instance L1 and L2 caches, the function returns HWLOC\_TYPE\_DEPTH\_MULTIPLE.*

*If an I/O object type is given, the function returns a virtual value because I/O objects are stored in special levels that are not CPU-related. This virtual depth may be passed to other hwloc functions such as* **hwloc\_get\_obj\_by\_depth()** *but it should not be considered as an actual depth by the application. In particular, it should not be compared with any other object depth or with the entire topology depth.*

### unsigned hwloc\_topology\_get\_depth (hwloc\_topology\_t restricttopology)

*Get the depth of the hierarchical tree of objects. This is the depth of HWLOC\_OBJ\_PU objects plus one.*

### int hwloc\_topology\_is\_thissystem (hwloc\_topology\_t restricttopology)

*Does the topology context come from this system?* **Returns:**

*1 if this topology context was built using the system running this program.*

*0 instead (for instance if using another file-system root, a XML topology file, or a synthetic topology).*

## Author

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