Debian Codegraph @

doc/doxygen-doc/html/a00169.html

raw
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=11"/>
6 <meta name="generator" content="Doxygen 1.15.0"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>Hardware Locality (hwloc): Topology Creation and Destruction</title>
9 <link href="tabs.css" rel="stylesheet" type="text/css"/>
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <script type="text/javascript" src="clipboard.js"></script>
13 <link href="doxygen.css" rel="stylesheet" type="text/css" />
14 </head>
15 <body>
16 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
17 <div id="titlearea">
18 <table cellspacing="0" cellpadding="0">
19 <tbody>
20 <tr id="projectrow">
21 <td id="projectalign">
22 <div id="projectname">Hardware Locality (hwloc)<span id="projectnumber">&#160;2.14.0</span>
23 </div>
24 </td>
25 </tr>
26 </tbody>
27 </table>
28 </div>
29 <!-- end header part -->
30 <!-- Generated by Doxygen 1.15.0 -->
31 <script type="text/javascript">
32 $(function() { codefold.init(); });
33 </script>
34 <script type="text/javascript" src="menudata.js"></script>
35 <script type="text/javascript" src="menu.js"></script>
36 <script type="text/javascript">
37 $(function() {
38 initMenu('',false,false,'search.php','Search',false);
39 });
40 </script>
41 <div id="main-nav"></div>
42 </div><!-- top -->
43 <div id="doc-content">
44 <div class="header">
45 <div class="summary">
46 <a href="#typedef-members">Typedefs</a> &#124;
47 <a href="#func-members">Functions</a> </div>
48 <div class="headertitle"><div class="title">Topology Creation and Destruction </div></div>
49 </div><!--header-->
50 <div class="contents">
51 <table class="memberdecls">
52 <tr class="heading"><td colspan="2"><h2 id="header-typedef-members" class="groupheader"><a id="typedef-members" name="typedef-members"></a>
53 Typedefs</h2></td></tr>
54 <tr class="memitem:ga9d1e76ee15a7dee158b786c30b6a6e38" id="r_ga9d1e76ee15a7dee158b786c30b6a6e38"><td class="memItemLeft" align="right" valign="top">typedef struct hwloc_topology *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td></tr>
55 </table><table class="memberdecls">
56 <tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
57 Functions</h2></td></tr>
58 <tr class="memitem:ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa" id="r_ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa">hwloc_topology_init</a> (<a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> *topologyp)</td></tr>
59 <tr class="memitem:gabdf58d87ad77f6615fccdfe0535ff826" id="r_gabdf58d87ad77f6615fccdfe0535ff826"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#gabdf58d87ad77f6615fccdfe0535ff826">hwloc_topology_load</a> (<a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology)</td></tr>
60 <tr class="memitem:ga9f34a640b6fd28d23699d4d084667b15" id="r_ga9f34a640b6fd28d23699d4d084667b15"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga9f34a640b6fd28d23699d4d084667b15">hwloc_topology_destroy</a> (<a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology)</td></tr>
61 <tr class="memitem:ga62a161fc5e6f120344dc69a7bee4e587" id="r_ga62a161fc5e6f120344dc69a7bee4e587"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga62a161fc5e6f120344dc69a7bee4e587">hwloc_topology_dup</a> (<a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> *newtopology, <a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> oldtopology)</td></tr>
62 <tr class="memitem:ga0647ae66458fe68172eb5a320042f870" id="r_ga0647ae66458fe68172eb5a320042f870"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ga0647ae66458fe68172eb5a320042f870">hwloc_topology_abi_check</a> (<a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology)</td></tr>
63 <tr class="memitem:gaf6746bc3a558ef1ac8348b4491d091b5" id="r_gaf6746bc3a558ef1ac8348b4491d091b5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#gaf6746bc3a558ef1ac8348b4491d091b5">hwloc_topology_check</a> (<a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology)</td></tr>
64 </table>
65 <a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
66 <a name="doc-typedef-members" id="doc-typedef-members"></a><h2 id="header-doc-typedef-members" class="groupheader">Typedef Documentation</h2>
67 <a id="ga9d1e76ee15a7dee158b786c30b6a6e38" name="ga9d1e76ee15a7dee158b786c30b6a6e38"></a>
68 <h2 class="memtitle"><span class="permalink"><a href="#ga9d1e76ee15a7dee158b786c30b6a6e38">&#9670;&#160;</a></span>hwloc_topology_t</h2>
69
70 <div class="memitem">
71 <div class="memproto">
72 <table class="memname">
73 <tr>
74 <td class="memname">typedef struct hwloc_topology* <a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td>
75 </tr>
76 </table>
77 </div><div class="memdoc">
78
79 <p>Topology context. </p>
80 <p>To be initialized with <a class="el" href="#ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa" title="Allocate a topology context.">hwloc_topology_init()</a> and built with <a class="el" href="#gabdf58d87ad77f6615fccdfe0535ff826" title="Build the actual topology.">hwloc_topology_load()</a>. </p>
81
82 </div>
83 </div>
84 <a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2>
85 <a id="ga0647ae66458fe68172eb5a320042f870" name="ga0647ae66458fe68172eb5a320042f870"></a>
86 <h2 class="memtitle"><span class="permalink"><a href="#ga0647ae66458fe68172eb5a320042f870">&#9670;&#160;</a></span>hwloc_topology_abi_check()</h2>
87
88 <div class="memitem">
89 <div class="memproto">
90 <table class="memname">
91 <tr>
92 <td class="memname">int hwloc_topology_abi_check </td>
93 <td>(</td>
94 <td class="paramtype"><a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span></td><td>)</td>
95 <td></td>
96 </tr>
97 </table>
98 </div><div class="memdoc">
99
100 <p>Verify that the topology is compatible with the current hwloc library. </p>
101 <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>
102 <p>If all libraries/programs use the same hwloc installation, this function always returns success.</p>
103 <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success.</dd>
104 <dd>
105 <code>-1</code> with <code class="param">errno</code> set to <code>EINVAL</code> if incompatible.</dd></dl>
106 <dl class="section note"><dt>Note</dt><dd>If sharing between processes with <a class="el" href="a00213.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="a00213.html#ga21545bd0f09d9b554c8e60a630e0e629" title="Adopt a shared memory topology stored in a file.">hwloc_shmem_topology_adopt()</a>. </dd></dl>
107
108 </div>
109 </div>
110 <a id="gaf6746bc3a558ef1ac8348b4491d091b5" name="gaf6746bc3a558ef1ac8348b4491d091b5"></a>
111 <h2 class="memtitle"><span class="permalink"><a href="#gaf6746bc3a558ef1ac8348b4491d091b5">&#9670;&#160;</a></span>hwloc_topology_check()</h2>
112
113 <div class="memitem">
114 <div class="memproto">
115 <table class="memname">
116 <tr>
117 <td class="memname">void hwloc_topology_check </td>
118 <td>(</td>
119 <td class="paramtype"><a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span></td><td>)</td>
120 <td></td>
121 </tr>
122 </table>
123 </div><div class="memdoc">
124
125 <p>Run internal checks on a topology structure. </p>
126 <p>The program aborts if an inconsistency is detected in the given topology.</p>
127 <dl class="params"><dt>Parameters</dt><dd>
128 <table class="params">
129 <tr><td class="paramname">topology</td><td>is the topology to be checked</td></tr>
130 </table>
131 </dd>
132 </dl>
133 <dl class="section note"><dt>Note</dt><dd>This routine is only useful to developers.</dd>
134 <dd>
135 The input topology should have been previously loaded with <a class="el" href="#gabdf58d87ad77f6615fccdfe0535ff826" title="Build the actual topology.">hwloc_topology_load()</a>. </dd></dl>
136
137 </div>
138 </div>
139 <a id="ga9f34a640b6fd28d23699d4d084667b15" name="ga9f34a640b6fd28d23699d4d084667b15"></a>
140 <h2 class="memtitle"><span class="permalink"><a href="#ga9f34a640b6fd28d23699d4d084667b15">&#9670;&#160;</a></span>hwloc_topology_destroy()</h2>
141
142 <div class="memitem">
143 <div class="memproto">
144 <table class="memname">
145 <tr>
146 <td class="memname">void hwloc_topology_destroy </td>
147 <td>(</td>
148 <td class="paramtype"><a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span></td><td>)</td>
149 <td></td>
150 </tr>
151 </table>
152 </div><div class="memdoc">
153
154 <p>Terminate and free a topology context. </p>
155 <dl class="params"><dt>Parameters</dt><dd>
156 <table class="params">
157 <tr><td class="paramname">topology</td><td>is the topology to be freed </td></tr>
158 </table>
159 </dd>
160 </dl>
161
162 </div>
163 </div>
164 <a id="ga62a161fc5e6f120344dc69a7bee4e587" name="ga62a161fc5e6f120344dc69a7bee4e587"></a>
165 <h2 class="memtitle"><span class="permalink"><a href="#ga62a161fc5e6f120344dc69a7bee4e587">&#9670;&#160;</a></span>hwloc_topology_dup()</h2>
166
167 <div class="memitem">
168 <div class="memproto">
169 <table class="memname">
170 <tr>
171 <td class="memname">int hwloc_topology_dup </td>
172 <td>(</td>
173 <td class="paramtype"><a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> *</td> <td class="paramname"><span class="paramname"><em>newtopology</em></span>, </td>
174 </tr>
175 <tr>
176 <td class="paramkey"></td>
177 <td></td>
178 <td class="paramtype"><a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>oldtopology</em></span>&#160;)</td>
179 </tr>
180 </table>
181 </div><div class="memdoc">
182
183 <p>Duplicate a topology. </p>
184 <p>The entire topology structure as well as its objects are duplicated into a new one.</p>
185 <p>This is useful for keeping a backup while modifying a topology.</p>
186 <dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl>
187 <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>
188
189 </div>
190 </div>
191 <a id="ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa" name="ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa"></a>
192 <h2 class="memtitle"><span class="permalink"><a href="#ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa">&#9670;&#160;</a></span>hwloc_topology_init()</h2>
193
194 <div class="memitem">
195 <div class="memproto">
196 <table class="memname">
197 <tr>
198 <td class="memname">int hwloc_topology_init </td>
199 <td>(</td>
200 <td class="paramtype"><a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> *</td> <td class="paramname"><span class="paramname"><em>topologyp</em></span></td><td>)</td>
201 <td></td>
202 </tr>
203 </table>
204 </div><div class="memdoc">
205
206 <p>Allocate a topology context. </p>
207 <dl class="params"><dt>Parameters</dt><dd>
208 <table class="params">
209 <tr><td class="paramdir">[out]</td><td class="paramname">topologyp</td><td>is assigned a pointer to the new allocated context.</td></tr>
210 </table>
211 </dd>
212 </dl>
213 <dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error. </dd></dl>
214
215 </div>
216 </div>
217 <a id="gabdf58d87ad77f6615fccdfe0535ff826" name="gabdf58d87ad77f6615fccdfe0535ff826"></a>
218 <h2 class="memtitle"><span class="permalink"><a href="#gabdf58d87ad77f6615fccdfe0535ff826">&#9670;&#160;</a></span>hwloc_topology_load()</h2>
219
220 <div class="memitem">
221 <div class="memproto">
222 <table class="memname">
223 <tr>
224 <td class="memname">int hwloc_topology_load </td>
225 <td>(</td>
226 <td class="paramtype"><a class="el" href="#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span></td><td>)</td>
227 <td></td>
228 </tr>
229 </table>
230 </div><div class="memdoc">
231
232 <p>Build the actual topology. </p>
233 <p>Build the actual topology once initialized with <a class="el" href="#ga03fd4a16d8b9ee1ffc32b25fd2f6bdfa" title="Allocate a topology context.">hwloc_topology_init()</a> and tuned with <a class="el" href="a00176.html">Topology Detection Configuration and Query</a> and <a class="el" href="a00175.html">Changing the Source of Topology Discovery</a> routines. No other routine may be called earlier using this topology context.</p>
234 <dl class="params"><dt>Parameters</dt><dd>
235 <table class="params">
236 <tr><td class="paramname">topology</td><td>is the topology to be loaded with objects.</td></tr>
237 </table>
238 </dd>
239 </dl>
240 <dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl>
241 <dl class="section note"><dt>Note</dt><dd>On failure, the topology is reinitialized. It should be either destroyed with <a class="el" href="#ga9f34a640b6fd28d23699d4d084667b15" title="Terminate and free a topology context.">hwloc_topology_destroy()</a> or configured and loaded again.</dd>
242 <dd>
243 This function may be called only once per topology.</dd>
244 <dd>
245 The binding of the current thread or process may temporarily change during this call but it will be restored before it returns.</dd></dl>
246 <dl class="section see"><dt>See also</dt><dd><a class="el" href="a00176.html">Topology Detection Configuration and Query</a> and <a class="el" href="a00175.html">Changing the Source of Topology Discovery</a> </dd></dl>
247
248 </div>
249 </div>
250 </div><!-- contents -->
251 <!-- start footer part -->
252 <hr class="footer"/><address class="footer"><small>
253 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.15.0
254 </small></address>
255 </div><!-- doc-content -->
256 </body>
257 </html>