hwlocality\_distances\_consult(3) Library Functions Manual hwlocality\_distances\_consult(3)

# [NAME](#NAME)

hwlocality\_distances\_consult - Helpers for consulting distance matrices

# [SYNOPSIS](#SYNOPSIS)

## [Functions](#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](#Detailed_Description)

# [Function Documentation](#Function_Documentation)

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

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\]](#int_hwloc_distances_obj_pair_values_%28struct_)

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](#Author)

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

Version 2.15.0 Hardware Locality (hwloc)

---

Document: hwloc_distances_obj_index(3) from hwloc-cuda-12.6 2.15.0-r0 (Chainguard OS)
Source: https://github.com/open-mpi/hwloc
