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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.8.8"/>
<title>Hardware Locality (hwloc): Modifying a loaded Topology</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 style="padding-left: 0.5em;">
<div id="projectname">Hardware Locality (hwloc)
 <span id="projectnumber">1.10.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Modifying a loaded Topology</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga9d80f08eb25b7ac22f1b998dc8bf521f"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="a00082.html#ga9d80f08eb25b7ac22f1b998dc8bf521f">hwloc_restrict_flags_e</a> { <a class="el" href="a00082.html#gga9d80f08eb25b7ac22f1b998dc8bf521fa4d18407f5520793b50b9e892f5bb55d1">HWLOC_RESTRICT_FLAG_ADAPT_DISTANCES</a>,
<a class="el" href="a00082.html#gga9d80f08eb25b7ac22f1b998dc8bf521fa699969227a09bbc1a7de51dc9fb7be4b">HWLOC_RESTRICT_FLAG_ADAPT_MISC</a>,
<a class="el" href="a00082.html#gga9d80f08eb25b7ac22f1b998dc8bf521faa95d6985e36ec1e55f68b210297a85cb">HWLOC_RESTRICT_FLAG_ADAPT_IO</a>
}</td></tr>
<tr class="separator:ga9d80f08eb25b7ac22f1b998dc8bf521f"><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:ga77c753751f3b90fac14117523fe604df"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00075.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00082.html#ga77c753751f3b90fac14117523fe604df">hwloc_topology_insert_misc_object_by_cpuset</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00073.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a> cpuset, const char *name)</td></tr>
<tr class="separator:ga77c753751f3b90fac14117523fe604df"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga1472cdf93327dfff4b5b2aedfde29cf3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00075.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00082.html#ga1472cdf93327dfff4b5b2aedfde29cf3">hwloc_topology_insert_misc_object_by_parent</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00075.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> parent, const char *name)</td></tr>
<tr class="separator:ga1472cdf93327dfff4b5b2aedfde29cf3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaffdb5403e5178b0d29852dd3319de3fc"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00082.html#gaffdb5403e5178b0d29852dd3319de3fc">hwloc_topology_restrict</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> restrict topology, <a class="el" href="a00073.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a> cpuset, unsigned long flags)</td></tr>
<tr class="separator:gaffdb5403e5178b0d29852dd3319de3fc"><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="a00082.html#ga62a161fc5e6f120344dc69a7bee4e587">hwloc_topology_dup</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> *newtopology, <a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> oldtopology)</td></tr>
<tr class="separator:ga62a161fc5e6f120344dc69a7bee4e587"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="ga9d80f08eb25b7ac22f1b998dc8bf521f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="a00082.html#ga9d80f08eb25b7ac22f1b998dc8bf521f">hwloc_restrict_flags_e</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Flags to be given to <a class="el" href="a00082.html#gaffdb5403e5178b0d29852dd3319de3fc" title="Restrict the topology to the given CPU set. ">hwloc_topology_restrict()</a>. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="gga9d80f08eb25b7ac22f1b998dc8bf521fa4d18407f5520793b50b9e892f5bb55d1"></a>HWLOC_RESTRICT_FLAG_ADAPT_DISTANCES </td><td class="fielddoc">
<p>Adapt distance matrices according to objects being removed during restriction. If this flag is not set, distance matrices are removed. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga9d80f08eb25b7ac22f1b998dc8bf521fa699969227a09bbc1a7de51dc9fb7be4b"></a>HWLOC_RESTRICT_FLAG_ADAPT_MISC </td><td class="fielddoc">
<p>Move Misc objects to ancestors if their parents are removed during restriction. If this flag is not set, Misc objects are removed when their parents are removed. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga9d80f08eb25b7ac22f1b998dc8bf521faa95d6985e36ec1e55f68b210297a85cb"></a>HWLOC_RESTRICT_FLAG_ADAPT_IO </td><td class="fielddoc">
<p>Move I/O objects to ancestors if their parents are removed during restriction. If this flag is not set, I/O devices and bridges are removed when their parents are removed. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga62a161fc5e6f120344dc69a7bee4e587"></a>
<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="a00076.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="a00076.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>
</div>
</div>
<a class="anchor" id="ga77c753751f3b90fac14117523fe604df"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00075.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_topology_insert_misc_object_by_cpuset </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00076.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="a00073.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a> </td>
<td class="paramname"><em>cpuset</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></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add a MISC object to the topology. </p>
<p>A new MISC object will be created and inserted into the topology at the position given by bitmap <code>cpuset</code>. This offers a way to add new intermediate levels to the topology hierarchy.</p>
<p><code>cpuset</code> and <code>name</code> will be copied to setup the new object attributes.</p>
<dl class="section return"><dt>Returns</dt><dd>the newly-created object. </dd>
<dd>
<code>NULL</code> if the insertion conflicts with the existing topology tree.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If <code>name</code> contains some non-printable characters, they will be dropped when exporting to XML, see <a class="el" href="a00084.html#ga2bf166eda4d3605362ac86f77684002a" title="Export the topology into an XML file. ">hwloc_topology_export_xml()</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="ga1472cdf93327dfff4b5b2aedfde29cf3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00075.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_topology_insert_misc_object_by_parent </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00076.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="a00075.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td>
<td class="paramname"><em>parent</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></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add a MISC object as a leaf of the topology. </p>
<p>A new MISC object will be created and inserted into the topology at the position given by parent. It is appended to the list of existing children, without ever adding any intermediate hierarchy level. This is useful for annotating the topology without actually changing the hierarchy.</p>
<p><code>name</code> will be copied to the setup the new object attributes. However, the new leaf object will not have any <code>cpuset</code>.</p>
<dl class="section return"><dt>Returns</dt><dd>the newly-created object</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If <code>name</code> contains some non-printable characters, they will be dropped when exporting to XML, see <a class="el" href="a00084.html#ga2bf166eda4d3605362ac86f77684002a" title="Export the topology into an XML file. ">hwloc_topology_export_xml()</a>. </dd></dl>
</div>
</div>
<a class="anchor" id="gaffdb5403e5178b0d29852dd3319de3fc"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_topology_restrict </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> restrict </td>
<td class="paramname"><em>topology</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00073.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a> </td>
<td class="paramname"><em>cpuset</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>Restrict the topology to the given CPU set. </p>
<p>Topology <code>topology</code> is modified so as to remove all objects that are not included (or partially included) in the CPU set <code>cpuset</code>. All objects CPU and node sets are restricted accordingly.</p>
<p><code>flags</code> is a OR'ed set of <a class="el" href="a00082.html#ga9d80f08eb25b7ac22f1b998dc8bf521f" title="Flags to be given to hwloc_topology_restrict(). ">hwloc_restrict_flags_e</a>.</p>
<dl class="section note"><dt>Note</dt><dd>This call may not be reverted by restricting back to a larger cpuset. Once dropped during restriction, objects may not be brought back, except by loading another topology with <a class="el" href="a00076.html#gabdf58d87ad77f6615fccdfe0535ff826" title="Build the actual topology. ">hwloc_topology_load()</a>.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>0 on success.</dd>
<dd>
-1 with errno set to EINVAL if the input cpuset is invalid. The topology is not modified in this case.</dd>
<dd>
-1 with errno set to ENOMEM on failure to allocate internal data. The topology is reinitialized in this case. It should be either destroyed with <a class="el" href="a00076.html#ga9f34a640b6fd28d23699d4d084667b15" title="Terminate and free a topology context. ">hwloc_topology_destroy()</a> or configured and loaded again. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Oct 7 2014 11:56:52 for Hardware Locality (hwloc) by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
|