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
|
<!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">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Locality (hwloc): Topology Creation and Destruction</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 style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Hardware Locality (hwloc)
 <span id="projectnumber">2.4.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<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:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(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="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Topology Creation and Destruction</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga9d1e76ee15a7dee158b786c30b6a6e38"><td class="memItemLeft" align="right" valign="top">typedef struct hwloc_topology * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td></tr>
<tr class="separator:ga9d1e76ee15a7dee158b786c30b6a6e38"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00192.html#ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa">hwloc_topology_init</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> *topologyp)</td></tr>
<tr class="separator:ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gabdf58d87ad77f6615fccdfe0535ff826"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00192.html#gabdf58d87ad77f6615fccdfe0535ff826">hwloc_topology_load</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology)</td></tr>
<tr class="separator:gabdf58d87ad77f6615fccdfe0535ff826"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga9f34a640b6fd28d23699d4d084667b15"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00192.html#ga9f34a640b6fd28d23699d4d084667b15">hwloc_topology_destroy</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology)</td></tr>
<tr class="separator:ga9f34a640b6fd28d23699d4d084667b15"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga62a161fc5e6f120344dc69a7bee4e587"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00192.html#ga62a161fc5e6f120344dc69a7bee4e587">hwloc_topology_dup</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> *newtopology, <a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> oldtopology)</td></tr>
<tr class="separator:ga62a161fc5e6f120344dc69a7bee4e587"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga0647ae66458fe68172eb5a320042f870"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00192.html#ga0647ae66458fe68172eb5a320042f870">hwloc_topology_abi_check</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology)</td></tr>
<tr class="separator:ga0647ae66458fe68172eb5a320042f870"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf6746bc3a558ef1ac8348b4491d091b5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00192.html#gaf6746bc3a558ef1ac8348b4491d091b5">hwloc_topology_check</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology)</td></tr>
<tr class="separator:gaf6746bc3a558ef1ac8348b4491d091b5"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga9d1e76ee15a7dee158b786c30b6a6e38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9d1e76ee15a7dee158b786c30b6a6e38">◆ </a></span>hwloc_topology_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct hwloc_topology* <a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Topology context. </p>
<p>To be initialized with <a class="el" href="a00192.html#ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa" title="Allocate a topology context.">hwloc_topology_init()</a> and built with <a class="el" href="a00192.html#gabdf58d87ad77f6615fccdfe0535ff826" title="Build the actual topology.">hwloc_topology_load()</a>. </p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga0647ae66458fe68172eb5a320042f870"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0647ae66458fe68172eb5a320042f870">◆ </a></span>hwloc_topology_abi_check()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_topology_abi_check </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> </td>
<td class="paramname"><em>topology</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Verify that the topology is compatible with the current hwloc library. </p>
<p>This is useful when using the same topology structure (in memory) in different libraries that may use different hwloc installations (for instance if one library embeds a specific version of hwloc, while another library uses a default system-wide hwloc installation).</p>
<p>If all libraries/programs use the same hwloc installation, this function always returns success.</p>
<dl class="section return"><dt>Returns</dt><dd><code>0</code> on success.</dd>
<dd>
<code>-1</code> with <code>errno</code> set to <code>EINVAL</code> if incompatible.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If sharing between processes with <a class="el" href="a00232.html#ga61b20e346fc76f76420e3a88cc80a671" title="Duplicate a topology to a shared memory file.">hwloc_shmem_topology_write()</a>, the relevant check is already performed inside <a class="el" href="a00232.html#ga21545bd0f09d9b554c8e60a630e0e629" title="Adopt a shared memory topology stored in a file.">hwloc_shmem_topology_adopt()</a>. </dd></dl>
</div>
</div>
<a id="gaf6746bc3a558ef1ac8348b4491d091b5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf6746bc3a558ef1ac8348b4491d091b5">◆ </a></span>hwloc_topology_check()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void hwloc_topology_check </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> </td>
<td class="paramname"><em>topology</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Run internal checks on a topology structure. </p>
<p>The program aborts if an inconsistency is detected in the given topology.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">topology</td><td>is the topology to be checked</td></tr>
</table>
</dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This routine is only useful to developers.</dd>
<dd>
The input topology should have been previously loaded with <a class="el" href="a00192.html#gabdf58d87ad77f6615fccdfe0535ff826" title="Build the actual topology.">hwloc_topology_load()</a>. </dd></dl>
</div>
</div>
<a id="ga9f34a640b6fd28d23699d4d084667b15"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9f34a640b6fd28d23699d4d084667b15">◆ </a></span>hwloc_topology_destroy()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void hwloc_topology_destroy </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> </td>
<td class="paramname"><em>topology</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Terminate and free a topology context. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">topology</td><td>is the topology to be freed </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ga62a161fc5e6f120344dc69a7bee4e587"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga62a161fc5e6f120344dc69a7bee4e587">◆ </a></span>hwloc_topology_dup()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_topology_dup </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> * </td>
<td class="paramname"><em>newtopology</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> </td>
<td class="paramname"><em>oldtopology</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Duplicate a topology. </p>
<p>The entire topology structure as well as its objects are duplicated into a new one.</p>
<p>This is useful for keeping a backup while modifying a topology.</p>
<dl class="section note"><dt>Note</dt><dd>Object userdata is not duplicated since hwloc does not know what it point to. The objects of both old and new topologies will point to the same userdata. </dd></dl>
</div>
</div>
<a id="ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa">◆ </a></span>hwloc_topology_init()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_topology_init </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> * </td>
<td class="paramname"><em>topologyp</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Allocate a topology context. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">topologyp</td><td>is assigned a pointer to the new allocated context.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error. </dd></dl>
</div>
</div>
<a id="gabdf58d87ad77f6615fccdfe0535ff826"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabdf58d87ad77f6615fccdfe0535ff826">◆ </a></span>hwloc_topology_load()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_topology_load </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> </td>
<td class="paramname"><em>topology</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Build the actual topology. </p>
<p>Build the actual topology once initialized with <a class="el" href="a00192.html#ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa" title="Allocate a topology context.">hwloc_topology_init()</a> and tuned with <a class="el" href="a00199.html">Topology Detection Configuration and Query</a> and <a class="el" href="a00198.html">Changing the Source of Topology Discovery</a> routines. No other routine may be called earlier using this topology context.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">topology</td><td>is the topology to be loaded with objects.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>On failure, the topology is reinitialized. It should be either destroyed with <a class="el" href="a00192.html#ga9f34a640b6fd28d23699d4d084667b15" title="Terminate and free a topology context.">hwloc_topology_destroy()</a> or configured and loaded again.</dd>
<dd>
This function may be called only once per topology.</dd>
<dd>
The binding of the current thread or process may temporarily change during this call but it will be restored before it returns.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="a00199.html">Topology Detection Configuration and Query</a> and <a class="el" href="a00198.html">Changing the Source of Topology Discovery</a> </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.1
</small></address>
</body>
</html>
|