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
|
<!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): Add 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"> 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&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="#typedef-members">Typedefs</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">Add distances between objects</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga554a4c1e315265f961830e2b616e4989" id="r_ga554a4c1e315265f961830e2b616e4989"><td class="memItemLeft" align="right" valign="top">typedef void * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00190.html#ga554a4c1e315265f961830e2b616e4989">hwloc_distances_add_handle_t</a></td></tr>
<tr class="separator:ga554a4c1e315265f961830e2b616e4989"><td class="memSeparator" colspan="2"> </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:ga22428b6bab271411e3834e6b4ca22e37" id="r_ga22428b6bab271411e3834e6b4ca22e37"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="a00190.html#ga22428b6bab271411e3834e6b4ca22e37">hwloc_distances_add_flag_e</a> { <a class="el" href="a00190.html#gga22428b6bab271411e3834e6b4ca22e37a7f6baba797d70538d03c9d13052c62ab">HWLOC_DISTANCES_ADD_FLAG_GROUP</a>
, <a class="el" href="a00190.html#gga22428b6bab271411e3834e6b4ca22e37a5233ccf631c3bc53dd5c3e7a5d5c9b77">HWLOC_DISTANCES_ADD_FLAG_GROUP_INACCURATE</a>
}</td></tr>
<tr class="separator:ga22428b6bab271411e3834e6b4ca22e37"><td class="memSeparator" colspan="2"> </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:ga823d38fa8d21dc338497fb0f79c96704" id="r_ga823d38fa8d21dc338497fb0f79c96704"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00190.html#ga554a4c1e315265f961830e2b616e4989">hwloc_distances_add_handle_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00190.html#ga823d38fa8d21dc338497fb0f79c96704">hwloc_distances_add_create</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, const char *name, unsigned long kind, unsigned long flags)</td></tr>
<tr class="separator:ga823d38fa8d21dc338497fb0f79c96704"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga8c9715481b0bce344c8a33c6e6a56469" id="r_ga8c9715481b0bce344c8a33c6e6a56469"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00190.html#ga8c9715481b0bce344c8a33c6e6a56469">hwloc_distances_add_values</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00190.html#ga554a4c1e315265f961830e2b616e4989">hwloc_distances_add_handle_t</a> handle, unsigned nbobjs, <a class="el" href="a00165.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> *objs, hwloc_uint64_t *values, unsigned long flags)</td></tr>
<tr class="separator:ga8c9715481b0bce344c8a33c6e6a56469"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga1f5a29760ebb8f9af831e645315f553c" id="r_ga1f5a29760ebb8f9af831e645315f553c"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00190.html#ga1f5a29760ebb8f9af831e645315f553c">hwloc_distances_add_commit</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00190.html#ga554a4c1e315265f961830e2b616e4989">hwloc_distances_add_handle_t</a> handle, unsigned long flags)</td></tr>
<tr class="separator:ga1f5a29760ebb8f9af831e645315f553c"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>The usual way to add distances is: </p><div class="fragment"><div class="line"><a class="code hl_typedef" href="a00190.html#ga554a4c1e315265f961830e2b616e4989">hwloc_distances_add_handle_t</a> handle;</div>
<div class="line"><span class="keywordtype">int</span> err = -1;</div>
<div class="line">handle = <a class="code hl_function" href="a00190.html#ga823d38fa8d21dc338497fb0f79c96704">hwloc_distances_add_create</a>(topology, <span class="stringliteral">"name"</span>, kind, 0);</div>
<div class="line"><span class="keywordflow">if</span> (handle) {</div>
<div class="line"> err = <a class="code hl_function" href="a00190.html#ga8c9715481b0bce344c8a33c6e6a56469">hwloc_distances_add_values</a>(topology, handle, nbobjs, objs, values, 0);</div>
<div class="line"> <span class="keywordflow">if</span> (!err)</div>
<div class="line"> err = <a class="code hl_function" href="a00190.html#ga1f5a29760ebb8f9af831e645315f553c">hwloc_distances_add_commit</a>(topology, handle, flags);</div>
<div class="line">}</div>
<div class="ttc" id="aa00190_html_ga1f5a29760ebb8f9af831e645315f553c"><div class="ttname"><a href="a00190.html#ga1f5a29760ebb8f9af831e645315f553c">hwloc_distances_add_commit</a></div><div class="ttdeci">int hwloc_distances_add_commit(hwloc_topology_t topology, hwloc_distances_add_handle_t handle, unsigned long flags)</div><div class="ttdoc">Commit a new distances structure.</div></div>
<div class="ttc" id="aa00190_html_ga554a4c1e315265f961830e2b616e4989"><div class="ttname"><a href="a00190.html#ga554a4c1e315265f961830e2b616e4989">hwloc_distances_add_handle_t</a></div><div class="ttdeci">void * hwloc_distances_add_handle_t</div><div class="ttdoc">Handle to a new distances structure during its addition to the topology.</div><div class="ttdef"><b>Definition</b> distances.h:354</div></div>
<div class="ttc" id="aa00190_html_ga823d38fa8d21dc338497fb0f79c96704"><div class="ttname"><a href="a00190.html#ga823d38fa8d21dc338497fb0f79c96704">hwloc_distances_add_create</a></div><div class="ttdeci">hwloc_distances_add_handle_t hwloc_distances_add_create(hwloc_topology_t topology, const char *name, unsigned long kind, unsigned long flags)</div><div class="ttdoc">Create a new empty distances structure.</div></div>
<div class="ttc" id="aa00190_html_ga8c9715481b0bce344c8a33c6e6a56469"><div class="ttname"><a href="a00190.html#ga8c9715481b0bce344c8a33c6e6a56469">hwloc_distances_add_values</a></div><div class="ttdeci">int hwloc_distances_add_values(hwloc_topology_t topology, hwloc_distances_add_handle_t handle, unsigned nbobjs, hwloc_obj_t *objs, hwloc_uint64_t *values, unsigned long flags)</div><div class="ttdoc">Specify the objects and values in a new empty distances structure.</div></div>
</div><!-- fragment --><p> If <code>err</code> is <code>0</code> at the end, then addition was successful. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga554a4c1e315265f961830e2b616e4989" name="ga554a4c1e315265f961830e2b616e4989"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga554a4c1e315265f961830e2b616e4989">◆ </a></span>hwloc_distances_add_handle_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef void* <a class="el" href="a00190.html#ga554a4c1e315265f961830e2b616e4989">hwloc_distances_add_handle_t</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Handle to a new distances structure during its addition to the topology. </p>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga22428b6bab271411e3834e6b4ca22e37" name="ga22428b6bab271411e3834e6b4ca22e37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga22428b6bab271411e3834e6b4ca22e37">◆ </a></span>hwloc_distances_add_flag_e</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="a00190.html#ga22428b6bab271411e3834e6b4ca22e37">hwloc_distances_add_flag_e</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Flags for adding a new distances to a topology. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga22428b6bab271411e3834e6b4ca22e37a7f6baba797d70538d03c9d13052c62ab" name="gga22428b6bab271411e3834e6b4ca22e37a7f6baba797d70538d03c9d13052c62ab"></a>HWLOC_DISTANCES_ADD_FLAG_GROUP </td><td class="fielddoc"><p>Try to group objects based on the newly provided distance information. Grouping is only performed when the distances structure contains latencies, and when all objects are of the same type. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga22428b6bab271411e3834e6b4ca22e37a5233ccf631c3bc53dd5c3e7a5d5c9b77" name="gga22428b6bab271411e3834e6b4ca22e37a5233ccf631c3bc53dd5c3e7a5d5c9b77"></a>HWLOC_DISTANCES_ADD_FLAG_GROUP_INACCURATE </td><td class="fielddoc"><p>If grouping, consider the distance values as inaccurate and relax the comparisons during the grouping algorithms. The actual accuracy may be modified through the HWLOC_GROUPING_ACCURACY environment variable (see <a class="el" href="a00369.html">Environment Variables</a>). </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga1f5a29760ebb8f9af831e645315f553c" name="ga1f5a29760ebb8f9af831e645315f553c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1f5a29760ebb8f9af831e645315f553c">◆ </a></span>hwloc_distances_add_commit()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_distances_add_commit </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> </td>
<td class="paramname"><em>topology</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00190.html#ga554a4c1e315265f961830e2b616e4989">hwloc_distances_add_handle_t</a> </td>
<td class="paramname"><em>handle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long </td>
<td class="paramname"><em>flags</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Commit a new distances structure. </p>
<p>This function finalizes the distances structure and inserts in it the topology.</p>
<p>Parameter <code>handle</code> was previously returned by <a class="el" href="a00190.html#ga823d38fa8d21dc338497fb0f79c96704" title="Create a new empty distances structure.">hwloc_distances_add_create()</a>. Then objects and values were specified with <a class="el" href="a00190.html#ga8c9715481b0bce344c8a33c6e6a56469" title="Specify the objects and values in a new empty distances structure.">hwloc_distances_add_values()</a>.</p>
<p><code>flags</code> configures the behavior of the function using an optional OR'ed set of <a class="el" href="a00190.html#ga22428b6bab271411e3834e6b4ca22e37" title="Flags for adding a new distances to a topology.">hwloc_distances_add_flag_e</a>. It may be used to request the grouping of existing objects based on distances.</p>
<p>On error, the temporary distances structure and its content are destroyed.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success. </dd>
<dd>
-1 on error. </dd></dl>
</div>
</div>
<a id="ga823d38fa8d21dc338497fb0f79c96704" name="ga823d38fa8d21dc338497fb0f79c96704"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga823d38fa8d21dc338497fb0f79c96704">◆ </a></span>hwloc_distances_add_create()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00190.html#ga554a4c1e315265f961830e2b616e4989">hwloc_distances_add_handle_t</a> hwloc_distances_add_create </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> </td>
<td class="paramname"><em>topology</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long </td>
<td class="paramname"><em>kind</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long </td>
<td class="paramname"><em>flags</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a new empty distances structure. </p>
<p>Create an empty distances structure to be filled with <a class="el" href="a00190.html#ga8c9715481b0bce344c8a33c6e6a56469" title="Specify the objects and values in a new empty distances structure.">hwloc_distances_add_values()</a> and then committed with <a class="el" href="a00190.html#ga1f5a29760ebb8f9af831e645315f553c" title="Commit a new distances structure.">hwloc_distances_add_commit()</a>.</p>
<p>Parameter <code>name</code> is optional, it may be <code>NULL</code>. Otherwise, it will be copied internally and may later be freed by the caller.</p>
<p><code>kind</code> specifies the kind of distance as a OR'ed set of <a class="el" href="a00188.html#gab1bb10d3adb85b52cdc6fe5a7f74f108" title="Kinds of distance matrices.">hwloc_distances_kind_e</a>. Only one kind of meaning and one kind of provenance may be given if appropriate (e.g. <a class="el" href="a00188.html#ggab1bb10d3adb85b52cdc6fe5a7f74f108a41b19f141a3c0ffe85f9affaca4b0293" title="Distance values are similar to bandwidths between objects. Values are higher for closer objects,...">HWLOC_DISTANCES_KIND_MEANS_BANDWIDTH</a> and <a class="el" href="a00188.html#ggab1bb10d3adb85b52cdc6fe5a7f74f108a0148d7f9be833a04f5a55455437c227b" title="These distances were provided by the user.">HWLOC_DISTANCES_KIND_FROM_USER</a>). Kind <a class="el" href="a00188.html#ggab1bb10d3adb85b52cdc6fe5a7f74f108aa6cf2b6dfcf148b65952f811814efbe1" title="This distances structure covers objects of different types. This may apply to the "NVLinkBandwidth" s...">HWLOC_DISTANCES_KIND_HETEROGENEOUS_TYPES</a> will be automatically set according to objects having different types in <a class="el" href="a00190.html#ga8c9715481b0bce344c8a33c6e6a56469" title="Specify the objects and values in a new empty distances structure.">hwloc_distances_add_values()</a>.</p>
<p><code>flags</code> must be <code>0</code> for now.</p>
<dl class="section return"><dt>Returns</dt><dd>A hwloc_distances_add_handle_t that should then be passed to <a class="el" href="a00190.html#ga8c9715481b0bce344c8a33c6e6a56469" title="Specify the objects and values in a new empty distances structure.">hwloc_distances_add_values()</a> and <a class="el" href="a00190.html#ga1f5a29760ebb8f9af831e645315f553c" title="Commit a new distances structure.">hwloc_distances_add_commit()</a>.</dd>
<dd>
<code>NULL</code> on error. </dd></dl>
</div>
</div>
<a id="ga8c9715481b0bce344c8a33c6e6a56469" name="ga8c9715481b0bce344c8a33c6e6a56469"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8c9715481b0bce344c8a33c6e6a56469">◆ </a></span>hwloc_distances_add_values()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_distances_add_values </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> </td>
<td class="paramname"><em>topology</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00190.html#ga554a4c1e315265f961830e2b616e4989">hwloc_distances_add_handle_t</a> </td>
<td class="paramname"><em>handle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned </td>
<td class="paramname"><em>nbobjs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00165.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> * </td>
<td class="paramname"><em>objs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">hwloc_uint64_t * </td>
<td class="paramname"><em>values</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">unsigned long </td>
<td class="paramname"><em>flags</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Specify the objects and values in a new empty distances structure. </p>
<p>Specify the objects and values for a new distances structure that was returned as a handle by <a class="el" href="a00190.html#ga823d38fa8d21dc338497fb0f79c96704" title="Create a new empty distances structure.">hwloc_distances_add_create()</a>. The structure must then be committed with <a class="el" href="a00190.html#ga1f5a29760ebb8f9af831e645315f553c" title="Commit a new distances structure.">hwloc_distances_add_commit()</a>.</p>
<p>The number of objects is <code>nbobjs</code> and the array of objects is <code>objs</code>. Distance values are stored as a one-dimension array in <code>values</code>. The distance from object i to object j is in slot i*nbobjs+j.</p>
<p><code>nbobjs</code> must be at least 2.</p>
<p>Arrays <code>objs</code> and <code>values</code> will be copied internally, they may later be freed by the caller.</p>
<p>On error, the temporary distances structure and its content are destroyed.</p>
<p><code>flags</code> must be <code>0</code> for now.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success. </dd>
<dd>
-1 on error. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <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>
|