File: a00188.html

package info (click to toggle)
hwloc 2.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,496 kB
  • sloc: ansic: 61,022; xml: 13,559; sh: 7,352; makefile: 2,150; javascript: 879; cpp: 93; sed: 5
file content (503 lines) | stat: -rw-r--r-- 33,260 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Locality (hwloc): Retrieve distances between objects</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Hardware Locality (hwloc)<span id="projectnumber">&#160;2.12.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Retrieve distances between objects</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00292.html">hwloc_distances_s</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gab1bb10d3adb85b52cdc6fe5a7f74f108" id="r_gab1bb10d3adb85b52cdc6fe5a7f74f108"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00188.html#gab1bb10d3adb85b52cdc6fe5a7f74f108">hwloc_distances_kind_e</a> { <br />
&#160;&#160;<a class="el" href="a00188.html#ggab1bb10d3adb85b52cdc6fe5a7f74f108a90dc38248c8d5392d4dd3e88f391e984">HWLOC_DISTANCES_KIND_FROM_OS</a>
, <a class="el" href="a00188.html#ggab1bb10d3adb85b52cdc6fe5a7f74f108a0148d7f9be833a04f5a55455437c227b">HWLOC_DISTANCES_KIND_FROM_USER</a>
, <a class="el" href="a00188.html#ggab1bb10d3adb85b52cdc6fe5a7f74f108afd6a3503fbc8f7c1a31235373cefc4c6">HWLOC_DISTANCES_KIND_MEANS_LATENCY</a>
, <a class="el" href="a00188.html#ggab1bb10d3adb85b52cdc6fe5a7f74f108a41b19f141a3c0ffe85f9affaca4b0293">HWLOC_DISTANCES_KIND_MEANS_BANDWIDTH</a>
, <br />
&#160;&#160;<a class="el" href="a00188.html#ggab1bb10d3adb85b52cdc6fe5a7f74f108aa6cf2b6dfcf148b65952f811814efbe1">HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES</a>
<br />
 }</td></tr>
<tr class="separator:gab1bb10d3adb85b52cdc6fe5a7f74f108"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga42859b651adec5ef0aaacb53ff220b00" id="r_ga42859b651adec5ef0aaacb53ff220b00"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00188.html#ga42859b651adec5ef0aaacb53ff220b00">hwloc_distances_transform_e</a> { <a class="el" href="a00188.html#gga42859b651adec5ef0aaacb53ff220b00a4b7bdb7e3ccca30e03b7ae671e7f6dc1">HWLOC_DISTANCES_TRANSFORM_REMOVE_NULL</a>
, <a class="el" href="a00188.html#gga42859b651adec5ef0aaacb53ff220b00a441e6bb393558319af3bb1f89f51f44d">HWLOC_DISTANCES_TRANSFORM_LINKS</a>
, <a class="el" href="a00188.html#gga42859b651adec5ef0aaacb53ff220b00a3d2aaf03e17be54eddbb94aab327fded">HWLOC_DISTANCES_TRANSFORM_MERGE_SWITCH_PORTS</a>
, <a class="el" href="a00188.html#gga42859b651adec5ef0aaacb53ff220b00a1264abf9b9463f252995f37eb1057047">HWLOC_DISTANCES_TRANSFORM_TRANSITIVE_CLOSURE</a>
 }</td></tr>
<tr class="separator:ga42859b651adec5ef0aaacb53ff220b00"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga613e6b2a5d0f06626ee8d0c12fa46691" id="r_ga613e6b2a5d0f06626ee8d0c12fa46691"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00188.html#ga613e6b2a5d0f06626ee8d0c12fa46691">hwloc_distances_get</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, unsigned *nr, struct <a class="el" href="a00292.html">hwloc_distances_s</a> **distances, unsigned long kind, unsigned long flags)</td></tr>
<tr class="separator:ga613e6b2a5d0f06626ee8d0c12fa46691"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5d1d35eccfcc2ebcef71a10972ce9b03" id="r_ga5d1d35eccfcc2ebcef71a10972ce9b03"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00188.html#ga5d1d35eccfcc2ebcef71a10972ce9b03">hwloc_distances_get_by_depth</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, int depth, unsigned *nr, struct <a class="el" href="a00292.html">hwloc_distances_s</a> **distances, unsigned long kind, unsigned long flags)</td></tr>
<tr class="separator:ga5d1d35eccfcc2ebcef71a10972ce9b03"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaa6bfbc20072a4f4de132eec859067f6" id="r_gaaa6bfbc20072a4f4de132eec859067f6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00188.html#gaaa6bfbc20072a4f4de132eec859067f6">hwloc_distances_get_by_type</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00164.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a> type, unsigned *nr, struct <a class="el" href="a00292.html">hwloc_distances_s</a> **distances, unsigned long kind, unsigned long flags)</td></tr>
<tr class="separator:gaaa6bfbc20072a4f4de132eec859067f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa457f35b8745ca41ec17797c0d7b20f0" id="r_gaa457f35b8745ca41ec17797c0d7b20f0"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00188.html#gaa457f35b8745ca41ec17797c0d7b20f0">hwloc_distances_get_by_name</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, const char *name, unsigned *nr, struct <a class="el" href="a00292.html">hwloc_distances_s</a> **distances, unsigned long flags)</td></tr>
<tr class="separator:gaa457f35b8745ca41ec17797c0d7b20f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaff5366e26178f77d5e8dc3ac8863f2ed" id="r_gaff5366e26178f77d5e8dc3ac8863f2ed"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00188.html#gaff5366e26178f77d5e8dc3ac8863f2ed">hwloc_distances_get_name</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, struct <a class="el" href="a00292.html">hwloc_distances_s</a> *distances)</td></tr>
<tr class="separator:gaff5366e26178f77d5e8dc3ac8863f2ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1dd78c1f9acd54f26aba0e284e97e51d" id="r_ga1dd78c1f9acd54f26aba0e284e97e51d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00188.html#ga1dd78c1f9acd54f26aba0e284e97e51d">hwloc_distances_release</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, struct <a class="el" href="a00292.html">hwloc_distances_s</a> *distances)</td></tr>
<tr class="separator:ga1dd78c1f9acd54f26aba0e284e97e51d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabcadd041f3072999d68f2d94e38670f7" id="r_gabcadd041f3072999d68f2d94e38670f7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00188.html#gabcadd041f3072999d68f2d94e38670f7">hwloc_distances_transform</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, struct <a class="el" href="a00292.html">hwloc_distances_s</a> *distances, enum <a class="el" href="a00188.html#ga42859b651adec5ef0aaacb53ff220b00">hwloc_distances_transform_e</a> transform, void *transform_attr, unsigned long flags)</td></tr>
<tr class="separator:gabcadd041f3072999d68f2d94e38670f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gab1bb10d3adb85b52cdc6fe5a7f74f108" name="gab1bb10d3adb85b52cdc6fe5a7f74f108"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab1bb10d3adb85b52cdc6fe5a7f74f108">&#9670;&#160;</a></span>hwloc_distances_kind_e</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="a00188.html#gab1bb10d3adb85b52cdc6fe5a7f74f108">hwloc_distances_kind_e</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Kinds of distance matrices. </p>
<p>The <code>kind</code> attribute of struct <a class="el" href="a00292.html" title="Matrix of distances between a set of objects.">hwloc_distances_s</a> is a OR'ed set of kinds.</p>
<p>Each distance matrix may have only one kind among HWLOC_DISTANCES_KIND_FROM_* specifying where distance information comes from, and one kind among HWLOC_DISTANCES_KIND_MEANS_* specifying whether values are latencies or bandwidths. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggab1bb10d3adb85b52cdc6fe5a7f74f108a90dc38248c8d5392d4dd3e88f391e984" name="ggab1bb10d3adb85b52cdc6fe5a7f74f108a90dc38248c8d5392d4dd3e88f391e984"></a>HWLOC_DISTANCES_KIND_FROM_OS&#160;</td><td class="fielddoc"><p>These distances were obtained from the operating system or hardware. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab1bb10d3adb85b52cdc6fe5a7f74f108a0148d7f9be833a04f5a55455437c227b" name="ggab1bb10d3adb85b52cdc6fe5a7f74f108a0148d7f9be833a04f5a55455437c227b"></a>HWLOC_DISTANCES_KIND_FROM_USER&#160;</td><td class="fielddoc"><p>These distances were provided by the user. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab1bb10d3adb85b52cdc6fe5a7f74f108afd6a3503fbc8f7c1a31235373cefc4c6" name="ggab1bb10d3adb85b52cdc6fe5a7f74f108afd6a3503fbc8f7c1a31235373cefc4c6"></a>HWLOC_DISTANCES_KIND_MEANS_LATENCY&#160;</td><td class="fielddoc"><p>Distance values are similar to latencies between objects. Values are smaller for closer objects, hence minimal on the diagonal of the matrix (distance between an object and itself). It could also be the number of network hops between objects, etc. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab1bb10d3adb85b52cdc6fe5a7f74f108a41b19f141a3c0ffe85f9affaca4b0293" name="ggab1bb10d3adb85b52cdc6fe5a7f74f108a41b19f141a3c0ffe85f9affaca4b0293"></a>HWLOC_DISTANCES_KIND_MEANS_BANDWIDTH&#160;</td><td class="fielddoc"><p>Distance values are similar to bandwidths between objects. Values are higher for closer objects, hence maximal on the diagonal of the matrix (distance between an object and itself). Such values are currently ignored for distance-based grouping. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab1bb10d3adb85b52cdc6fe5a7f74f108aa6cf2b6dfcf148b65952f811814efbe1" name="ggab1bb10d3adb85b52cdc6fe5a7f74f108aa6cf2b6dfcf148b65952f811814efbe1"></a>HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES&#160;</td><td class="fielddoc"><p>This distances structure covers objects of different types. This may apply to the "NVLinkBandwidth" structure in presence of a NVSwitch or POWER processor NVLink port. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga42859b651adec5ef0aaacb53ff220b00" name="ga42859b651adec5ef0aaacb53ff220b00"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga42859b651adec5ef0aaacb53ff220b00">&#9670;&#160;</a></span>hwloc_distances_transform_e</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="a00188.html#ga42859b651adec5ef0aaacb53ff220b00">hwloc_distances_transform_e</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Transformations of distances structures. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga42859b651adec5ef0aaacb53ff220b00a4b7bdb7e3ccca30e03b7ae671e7f6dc1" name="gga42859b651adec5ef0aaacb53ff220b00a4b7bdb7e3ccca30e03b7ae671e7f6dc1"></a>HWLOC_DISTANCES_TRANSFORM_REMOVE_NULL&#160;</td><td class="fielddoc"><p>Remove <code>NULL</code> objects from the distances structure. </p>
<p>Every object that was replaced with <code>NULL</code> in the <code>objs</code> array is removed and the <code>values</code> array is updated accordingly.</p>
<p>At least <code>2</code> objects must remain, otherwise <a class="el" href="a00188.html#gabcadd041f3072999d68f2d94e38670f7" title="Apply a transformation to a distances structure.">hwloc_distances_transform()</a> will return <code>-1</code> with <code>errno</code> set to <code>EINVAL</code>.</p>
<p><code>kind</code> will be updated with or without <a class="el" href="a00188.html#ggab1bb10d3adb85b52cdc6fe5a7f74f108aa6cf2b6dfcf148b65952f811814efbe1" title="This distances structure covers objects of different types. This may apply to the &quot;NVLinkBandwidth&quot; s...">HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES</a> according to the remaining objects. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga42859b651adec5ef0aaacb53ff220b00a441e6bb393558319af3bb1f89f51f44d" name="gga42859b651adec5ef0aaacb53ff220b00a441e6bb393558319af3bb1f89f51f44d"></a>HWLOC_DISTANCES_TRANSFORM_LINKS&#160;</td><td class="fielddoc"><p>Replace bandwidth values with a number of links. </p>
<p>Usually all values will be either <code>0</code> (no link) or <code>1</code> (one link). However some matrices could get larger values if some pairs of peers are connected by different numbers of links.</p>
<p>Values on the diagonal are set to <code>0</code>.</p>
<p>This transformation only applies to bandwidth matrices. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga42859b651adec5ef0aaacb53ff220b00a3d2aaf03e17be54eddbb94aab327fded" name="gga42859b651adec5ef0aaacb53ff220b00a3d2aaf03e17be54eddbb94aab327fded"></a>HWLOC_DISTANCES_TRANSFORM_MERGE_SWITCH_PORTS&#160;</td><td class="fielddoc"><p>Merge switches with multiple ports into a single object. </p>
<p>This currently only applies to NVSwitches where GPUs seem connected to different switch ports. Switch ports must be objects with subtype "NVSwitch" as in the NVLinkBandwidth matrix.</p>
<p>This transformation will replace all ports with only the first one, now connected to all GPUs. Other ports are removed by applying <a class="el" href="a00188.html#gga42859b651adec5ef0aaacb53ff220b00a4b7bdb7e3ccca30e03b7ae671e7f6dc1" title="Remove NULL objects from the distances structure.">HWLOC_DISTANCES_TRANSFORM_REMOVE_NULL</a> internally. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga42859b651adec5ef0aaacb53ff220b00a1264abf9b9463f252995f37eb1057047" name="gga42859b651adec5ef0aaacb53ff220b00a1264abf9b9463f252995f37eb1057047"></a>HWLOC_DISTANCES_TRANSFORM_TRANSITIVE_CLOSURE&#160;</td><td class="fielddoc"><p>Apply a transitive closure to the matrix to connect objects across switches. </p>
<p>All pairs of GPUs will be reported as directly connected instead GPUs being only connected to switches.</p>
<p>Switch ports must be objects with subtype "NVSwitch" as in the NVLinkBandwidth matrix. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga613e6b2a5d0f06626ee8d0c12fa46691" name="ga613e6b2a5d0f06626ee8d0c12fa46691"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga613e6b2a5d0f06626ee8d0c12fa46691">&#9670;&#160;</a></span>hwloc_distances_get()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_distances_get </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a>&#160;</td>
          <td class="paramname"><em>topology</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned *&#160;</td>
          <td class="paramname"><em>nr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="a00292.html">hwloc_distances_s</a> **&#160;</td>
          <td class="paramname"><em>distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>kind</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve distance matrices. </p>
<p>Retrieve distance matrices from the topology into the <code>distances</code> array.</p>
<p><code>flags</code> is currently unused, should be <code>0</code>.</p>
<p><code>kind</code> serves as a filter. If <code>0</code>, all distance matrices are returned. If it contains some HWLOC_DISTANCES_KIND_FROM_*, only distance matrices whose kind matches one of these are returned. If it contains some HWLOC_DISTANCES_KIND_MEANS_*, only distance matrices whose kind matches one of these are returned.</p>
<p>On input, <code>nr</code> points to the number of distance matrices that may be stored in <code>distances</code>. On output, <code>nr</code> points to the number of distance matrices that were actually found, even if some of them couldn't be stored in <code>distances</code>. Distance matrices that couldn't be stored are ignored, but the function still returns success (<code>0</code>). The caller may find out by comparing the value pointed by <code>nr</code> before and after the function call.</p>
<p>Each distance matrix returned in the <code>distances</code> array should be released by the caller using <a class="el" href="a00188.html#ga1dd78c1f9acd54f26aba0e284e97e51d" title="Release a distance matrix structure previously returned by hwloc_distances_get().">hwloc_distances_release()</a>.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error. </dd></dl>

</div>
</div>
<a id="ga5d1d35eccfcc2ebcef71a10972ce9b03" name="ga5d1d35eccfcc2ebcef71a10972ce9b03"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5d1d35eccfcc2ebcef71a10972ce9b03">&#9670;&#160;</a></span>hwloc_distances_get_by_depth()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_distances_get_by_depth </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a>&#160;</td>
          <td class="paramname"><em>topology</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>depth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned *&#160;</td>
          <td class="paramname"><em>nr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="a00292.html">hwloc_distances_s</a> **&#160;</td>
          <td class="paramname"><em>distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>kind</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve distance matrices for object at a specific depth in the topology. </p>
<p>Identical to <a class="el" href="a00188.html#ga613e6b2a5d0f06626ee8d0c12fa46691" title="Retrieve distance matrices.">hwloc_distances_get()</a> with the additional <code>depth</code> filter.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error. </dd></dl>

</div>
</div>
<a id="gaa457f35b8745ca41ec17797c0d7b20f0" name="gaa457f35b8745ca41ec17797c0d7b20f0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa457f35b8745ca41ec17797c0d7b20f0">&#9670;&#160;</a></span>hwloc_distances_get_by_name()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_distances_get_by_name </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a>&#160;</td>
          <td class="paramname"><em>topology</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned *&#160;</td>
          <td class="paramname"><em>nr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="a00292.html">hwloc_distances_s</a> **&#160;</td>
          <td class="paramname"><em>distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve a distance matrix with the given name. </p>
<p>Usually only one distances structure may match a given name.</p>
<p>The name of the most common structure is "NUMALatency". Others include "XGMIBandwidth", "XGMIHops", "XeLinkBandwidth", and "NVLinkBandwidth".</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error. </dd></dl>

</div>
</div>
<a id="gaaa6bfbc20072a4f4de132eec859067f6" name="gaaa6bfbc20072a4f4de132eec859067f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaa6bfbc20072a4f4de132eec859067f6">&#9670;&#160;</a></span>hwloc_distances_get_by_type()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_distances_get_by_type </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a>&#160;</td>
          <td class="paramname"><em>topology</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00164.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned *&#160;</td>
          <td class="paramname"><em>nr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="a00292.html">hwloc_distances_s</a> **&#160;</td>
          <td class="paramname"><em>distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>kind</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieve distance matrices for object of a specific type. </p>
<p>Identical to <a class="el" href="a00188.html#ga613e6b2a5d0f06626ee8d0c12fa46691" title="Retrieve distance matrices.">hwloc_distances_get()</a> with the additional <code>type</code> filter.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error. </dd></dl>

</div>
</div>
<a id="gaff5366e26178f77d5e8dc3ac8863f2ed" name="gaff5366e26178f77d5e8dc3ac8863f2ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaff5366e26178f77d5e8dc3ac8863f2ed">&#9670;&#160;</a></span>hwloc_distances_get_name()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char * hwloc_distances_get_name </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a>&#160;</td>
          <td class="paramname"><em>topology</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="a00292.html">hwloc_distances_s</a> *&#160;</td>
          <td class="paramname"><em>distances</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get a description of what a distances structure contains. </p>
<p>For instance "NUMALatency" for hardware-provided NUMA distances (ACPI SLIT), or <code>NULL</code> if unknown.</p>
<dl class="section return"><dt>Returns</dt><dd>the constant string with the name of the distance structure.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The returned name should not be freed by the caller, it belongs to the hwloc library. </dd></dl>

</div>
</div>
<a id="ga1dd78c1f9acd54f26aba0e284e97e51d" name="ga1dd78c1f9acd54f26aba0e284e97e51d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1dd78c1f9acd54f26aba0e284e97e51d">&#9670;&#160;</a></span>hwloc_distances_release()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void hwloc_distances_release </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a>&#160;</td>
          <td class="paramname"><em>topology</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="a00292.html">hwloc_distances_s</a> *&#160;</td>
          <td class="paramname"><em>distances</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Release a distance matrix structure previously returned by <a class="el" href="a00188.html#ga613e6b2a5d0f06626ee8d0c12fa46691" title="Retrieve distance matrices.">hwloc_distances_get()</a>. </p>
<dl class="section note"><dt>Note</dt><dd>This function is not required if the structure is removed with <a class="el" href="a00191.html#ga80bbf6f0db9af48c61780dd5152664c2" title="Release and remove the given distance matrice from the topology.">hwloc_distances_release_remove()</a>. </dd></dl>

</div>
</div>
<a id="gabcadd041f3072999d68f2d94e38670f7" name="gabcadd041f3072999d68f2d94e38670f7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabcadd041f3072999d68f2d94e38670f7">&#9670;&#160;</a></span>hwloc_distances_transform()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_distances_transform </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a>&#160;</td>
          <td class="paramname"><em>topology</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="a00292.html">hwloc_distances_s</a> *&#160;</td>
          <td class="paramname"><em>distances</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">enum <a class="el" href="a00188.html#ga42859b651adec5ef0aaacb53ff220b00">hwloc_distances_transform_e</a>&#160;</td>
          <td class="paramname"><em>transform</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>transform_attr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned long&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Apply a transformation to a distances structure. </p>
<p>Modify a distances structure that was previously obtained with <a class="el" href="a00188.html#ga613e6b2a5d0f06626ee8d0c12fa46691" title="Retrieve distance matrices.">hwloc_distances_get()</a> or one of its variants.</p>
<p>This modifies the local copy of the distances structures but does not modify the distances information stored inside the topology (retrieved by another call to <a class="el" href="a00188.html#ga613e6b2a5d0f06626ee8d0c12fa46691" title="Retrieve distance matrices.">hwloc_distances_get()</a> or exported to XML). To do so, one should add a new distances structure with same name, kind, objects and values (see <a class="el" href="a00190.html">Add distances between objects</a>) and then remove this old one with <a class="el" href="a00191.html#ga80bbf6f0db9af48c61780dd5152664c2" title="Release and remove the given distance matrice from the topology.">hwloc_distances_release_remove()</a>.</p>
<p><code>transform</code> must be one of the transformations listed in <a class="el" href="a00188.html#ga42859b651adec5ef0aaacb53ff220b00" title="Transformations of distances structures.">hwloc_distances_transform_e</a>.</p>
<p>These transformations may modify the contents of the <code>objs</code> or <code>values</code> arrays.</p>
<p><code>transform_attr</code> must be <code>NULL</code> for now.</p>
<p><code>flags</code> must be <code>0</code> for now.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error for instance if flags are invalid.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Objects in distances array <code>objs</code> may be directly modified in place without using <a class="el" href="a00188.html#gabcadd041f3072999d68f2d94e38670f7" title="Apply a transformation to a distances structure.">hwloc_distances_transform()</a>. One may use <a class="el" href="a00180.html#gab5df3ad1e8565ea0c2cf06412f6f6233" title="Return an object of a different type with same locality.">hwloc_get_obj_with_same_locality()</a> to easily convert between similar objects of different types. </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>