---
name: "hwlocality_distances_consult"
section: "3"
platform: "linux"
package: "hwloc"
version: "2.15.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/hwlocality_distances_consult"
---

# hwlocality\_distances\_consult(3)

Helpers for consulting distance matrices

## NAME

hwlocality\_distances\_consult - Helpers for consulting distance matrices

## SYNOPSIS

### Functions

int **hwloc\_distances\_obj\_index** (struct **hwloc\_distances\_s** \*distances, **hwloc\_obj\_t** obj)\
 int **hwloc\_distances\_obj\_pair\_values** (struct **hwloc\_distances\_s** \*distances, **hwloc\_obj\_t** obj1, **hwloc\_obj\_t** obj2, hwloc\_uint64\_t \*value1to2, hwloc\_uint64\_t \*value2to1)\

## Detailed Description

## Function Documentation

### int hwloc\_distances\_obj\_index (struct hwloc\_distances\_s \* distances, hwloc\_obj\_t obj) \[inline\]

Find the index of an object in a distances structure.

**Returns**

the index of the object in the distances structure if any.

\-1 if object obj is not involved in structure distances.

### int hwloc\_distances\_obj\_pair\_values (struct hwloc\_distances\_s \* distances, hwloc\_obj\_t obj1, hwloc\_obj\_t obj2, hwloc\_uint64\_t \* value1to2, hwloc\_uint64\_t \* value2to1) \[inline\]

Find the values between two objects in a distance matrices. The distance from obj1 to obj2 is stored in the value pointed by value1to2 and reciprocally.

**Returns**

0 on success.

\-1 if object obj1 or obj2 is not involved in structure distances.

## Author

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