hwloc\_distances\_s(3) Library Functions Manual hwloc\_distances\_s(3)

# [NAME](#NAME)

hwloc\_distances\_s

# [SYNOPSIS](#SYNOPSIS)

#include &lt;distances.h&gt;

## [Data Fields](#Data_Fields)

unsigned **nbobjs**  
**hwloc\_obj\_t** * **objs**  
unsigned long **kind**  
hwloc\_uint64\_t * **values**

# [Detailed Description](#Detailed_Description)

Matrix of distances between a set of objects.

The most common matrix contains latencies between NUMA nodes (as reported in the System Locality Distance Information Table (SLIT) in the ACPI specification), which may or may not be physically accurate. It corresponds to the latency for accessing the memory of one node from a core in another node. The corresponding kind is **HWLOC\_DISTANCES\_KIND\_MEANS\_LATENCY** | **HWLOC\_DISTANCES\_KIND\_FROM\_USER**. The name of this distances structure is "NUMALatency".

The matrix may also contain bandwidths between random sets of objects, possibly provided by the user, as specified in the kind attribute. Others common distance structures include and "XGMIBandwidth", "XGMIHops", "XeLinkBandwidth" and "NVLinkBandwidth".

Pointers objs and values should not be replaced, reallocated, freed, etc. However callers are allowed to modify kind as well as the contents of objs and values arrays. For instance, if there is a single NUMA node per Package, **hwloc\_get\_obj\_with\_same\_locality()** may be used to convert between them and replace NUMA nodes in the objs array with the corresponding Packages. See also **hwloc\_distances\_transform()** for applying some transformations to the structure.

# [Field Documentation](#Field_Documentation)

## [unsigned long hwloc\_distances\_s::kind](#unsigned_long_hwloc_distances_s::kind)

OR'ed set of **hwloc\_distances\_kind\_e**.

## [unsigned hwloc\_distances\_s::nbobjs](#unsigned_hwloc_distances_s::nbobjs)

Number of objects described by the distance matrix.

## **hwloc\_obj\_t*** hwloc\_distances\_s::objs

Array of objects described by the distance matrix. These objects are not in any particular order, see **hwloc\_distances\_obj\_index()** and **hwloc\_distances\_obj\_pair\_values()** for easy ways to find objects in this array and their corresponding values.

## [hwloc\_uint64\_t* hwloc\_distances\_s::values](#hwloc_uint64_t*_hwloc_distances_s::values)

Matrix of distances between objects, stored as a one-dimension array. Distance from i-th to j-th object is stored in slot i\*nbobjs+j. The meaning of the value depends on the kind attribute.

# [Author](#Author)

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

Version 2.15.0 Hardware Locality (hwloc)

---

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