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
|
<!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): 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 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="#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="a00200.html#ga9d80f08eb25b7ac22f1b998dc8bf521f">hwloc_restrict_flags_e</a> { <br />
  <a class="el" href="a00200.html#gga9d80f08eb25b7ac22f1b998dc8bf521fa80eeb9cbba401ab050f8fb4573725891">HWLOC_RESTRICT_FLAG_REMOVE_CPULESS</a>
, <a class="el" href="a00200.html#gga9d80f08eb25b7ac22f1b998dc8bf521fae4c5b1b87232f2d8a60559e77ac65a68">HWLOC_RESTRICT_FLAG_BYNODESET</a> = (1UL<<3)
, <a class="el" href="a00200.html#gga9d80f08eb25b7ac22f1b998dc8bf521faf5ba49808855704bfe9cb9fe7347f93b">HWLOC_RESTRICT_FLAG_REMOVE_MEMLESS</a>
, <a class="el" href="a00200.html#gga9d80f08eb25b7ac22f1b998dc8bf521fa699969227a09bbc1a7de51dc9fb7be4b">HWLOC_RESTRICT_FLAG_ADAPT_MISC</a>
, <br />
  <a class="el" href="a00200.html#gga9d80f08eb25b7ac22f1b998dc8bf521faa95d6985e36ec1e55f68b210297a85cb">HWLOC_RESTRICT_FLAG_ADAPT_IO</a>
<br />
}</td></tr>
<tr class="separator:ga9d80f08eb25b7ac22f1b998dc8bf521f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga38b1be3922094d880f6e76bf56c973d6"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="a00200.html#ga38b1be3922094d880f6e76bf56c973d6">hwloc_allow_flags_e</a> { <a class="el" href="a00200.html#gga38b1be3922094d880f6e76bf56c973d6aca107692455774f9d323d21b8abfce72">HWLOC_ALLOW_FLAG_ALL</a>
, <a class="el" href="a00200.html#gga38b1be3922094d880f6e76bf56c973d6a88c50088c09dcf1e1a496c0817556fb9">HWLOC_ALLOW_FLAG_LOCAL_RESTRICTIONS</a>
, <a class="el" href="a00200.html#gga38b1be3922094d880f6e76bf56c973d6a489c8c1b67ce7e0b8cf7a665852760e1">HWLOC_ALLOW_FLAG_CUSTOM</a>
}</td></tr>
<tr class="separator:ga38b1be3922094d880f6e76bf56c973d6"><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:ga6db81ed13ac0a9d70cc80372ab537815"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00200.html#ga6db81ed13ac0a9d70cc80372ab537815">hwloc_topology_restrict</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> restrict topology, <a class="el" href="a00211.html#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> set, unsigned long flags)</td></tr>
<tr class="separator:ga6db81ed13ac0a9d70cc80372ab537815"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf955b190c0299dcfb5bc985d777f92a1"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00200.html#gaf955b190c0299dcfb5bc985d777f92a1">hwloc_topology_allow</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> restrict topology, <a class="el" href="a00189.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a> cpuset, <a class="el" href="a00189.html#ga2f5276235841ad66a79bedad16a5a10c">hwloc_const_nodeset_t</a> nodeset, unsigned long flags)</td></tr>
<tr class="separator:gaf955b190c0299dcfb5bc985d777f92a1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gad980782ade737900c5cf208946768c30"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00200.html#gad980782ade737900c5cf208946768c30">hwloc_topology_insert_misc_object</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> parent, const char *name)</td></tr>
<tr class="separator:gad980782ade737900c5cf208946768c30"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga4cea4741165faf5323931a9ed8786ef7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00200.html#ga4cea4741165faf5323931a9ed8786ef7">hwloc_topology_alloc_group_object</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology)</td></tr>
<tr class="separator:ga4cea4741165faf5323931a9ed8786ef7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga1fc6012b3e1c249b83f48cb7bcacaa5b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="a00200.html#ga1fc6012b3e1c249b83f48cb7bcacaa5b">hwloc_topology_insert_group_object</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> group)</td></tr>
<tr class="separator:ga1fc6012b3e1c249b83f48cb7bcacaa5b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gad458715d3335df44849216cc123d1055"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00200.html#gad458715d3335df44849216cc123d1055">hwloc_obj_add_other_obj_sets</a> (<a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> dst, <a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> src)</td></tr>
<tr class="separator:gad458715d3335df44849216cc123d1055"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga698ecd640d2b76742bba3829a145cd9a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="a00200.html#ga698ecd640d2b76742bba3829a145cd9a">hwloc_topology_refresh</a> (<a class="el" href="a00192.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology)</td></tr>
<tr class="separator:ga698ecd640d2b76742bba3829a145cd9a"><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 id="ga38b1be3922094d880f6e76bf56c973d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga38b1be3922094d880f6e76bf56c973d6">◆ </a></span>hwloc_allow_flags_e</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="a00200.html#ga38b1be3922094d880f6e76bf56c973d6">hwloc_allow_flags_e</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Flags to be given to <a class="el" href="a00200.html#gaf955b190c0299dcfb5bc985d777f92a1" title="Change the sets of allowed PUs and NUMA nodes in the topology.">hwloc_topology_allow()</a>. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga38b1be3922094d880f6e76bf56c973d6aca107692455774f9d323d21b8abfce72"></a>HWLOC_ALLOW_FLAG_ALL </td><td class="fielddoc"><p>Mark all objects as allowed in the topology. </p>
<p><code>cpuset</code> and <code>nođeset</code> given to <a class="el" href="a00200.html#gaf955b190c0299dcfb5bc985d777f92a1" title="Change the sets of allowed PUs and NUMA nodes in the topology.">hwloc_topology_allow()</a> must be <code>NULL</code>. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga38b1be3922094d880f6e76bf56c973d6a88c50088c09dcf1e1a496c0817556fb9"></a>HWLOC_ALLOW_FLAG_LOCAL_RESTRICTIONS </td><td class="fielddoc"><p>Only allow objects that are available to the current process. </p>
<p>The topology must have <a class="el" href="a00199.html#ggada025d3ec20b4b420f8038d23d6e7bdea6ecb6abc6a0bb75e81564f8bca85783b" title="Assume that the selected backend provides the topology for the system on which we are running.">HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM</a> so that the set of available resources can actually be retrieved from the operating system.</p>
<p><code>cpuset</code> and <code>nođeset</code> given to <a class="el" href="a00200.html#gaf955b190c0299dcfb5bc985d777f92a1" title="Change the sets of allowed PUs and NUMA nodes in the topology.">hwloc_topology_allow()</a> must be <code>NULL</code>. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga38b1be3922094d880f6e76bf56c973d6a489c8c1b67ce7e0b8cf7a665852760e1"></a>HWLOC_ALLOW_FLAG_CUSTOM </td><td class="fielddoc"><p>Allow a custom set of objects, given to <a class="el" href="a00200.html#gaf955b190c0299dcfb5bc985d777f92a1" title="Change the sets of allowed PUs and NUMA nodes in the topology.">hwloc_topology_allow()</a> as <code>cpuset</code> and/or <code>nodeset</code> parameters. </p>
</td></tr>
</table>
</div>
</div>
<a id="ga9d80f08eb25b7ac22f1b998dc8bf521f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9d80f08eb25b7ac22f1b998dc8bf521f">◆ </a></span>hwloc_restrict_flags_e</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="a00200.html#ga9d80f08eb25b7ac22f1b998dc8bf521f">hwloc_restrict_flags_e</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Flags to be given to <a class="el" href="a00200.html#ga6db81ed13ac0a9d70cc80372ab537815" title="Restrict the topology to the given CPU set or nodeset.">hwloc_topology_restrict()</a>. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga9d80f08eb25b7ac22f1b998dc8bf521fa80eeb9cbba401ab050f8fb4573725891"></a>HWLOC_RESTRICT_FLAG_REMOVE_CPULESS </td><td class="fielddoc"><p>Remove all objects that became CPU-less. By default, only objects that contain no PU and no memory are removed. This flag may not be used with <a class="el" href="a00200.html#gga9d80f08eb25b7ac22f1b998dc8bf521fae4c5b1b87232f2d8a60559e77ac65a68" title="Restrict by nodeset instead of CPU set. Only keep objects whose nodeset is included or partially incl...">HWLOC_RESTRICT_FLAG_BYNODESET</a>. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga9d80f08eb25b7ac22f1b998dc8bf521fae4c5b1b87232f2d8a60559e77ac65a68"></a>HWLOC_RESTRICT_FLAG_BYNODESET </td><td class="fielddoc"><p>Restrict by nodeset instead of CPU set. Only keep objects whose nodeset is included or partially included in the given set. This flag may not be used with <a class="el" href="a00200.html#gga9d80f08eb25b7ac22f1b998dc8bf521fa80eeb9cbba401ab050f8fb4573725891" title="Remove all objects that became CPU-less. By default, only objects that contain no PU and no memory ar...">HWLOC_RESTRICT_FLAG_REMOVE_CPULESS</a>. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga9d80f08eb25b7ac22f1b998dc8bf521faf5ba49808855704bfe9cb9fe7347f93b"></a>HWLOC_RESTRICT_FLAG_REMOVE_MEMLESS </td><td class="fielddoc"><p>Remove all objects that became Memory-less. By default, only objects that contain no PU and no memory are removed. This flag may only be used with <a class="el" href="a00200.html#gga9d80f08eb25b7ac22f1b998dc8bf521fae4c5b1b87232f2d8a60559e77ac65a68" title="Restrict by nodeset instead of CPU set. Only keep objects whose nodeset is included or partially incl...">HWLOC_RESTRICT_FLAG_BYNODESET</a>. </p>
</td></tr>
<tr><td class="fieldname"><a 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 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 id="gad458715d3335df44849216cc123d1055"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad458715d3335df44849216cc123d1055">◆ </a></span>hwloc_obj_add_other_obj_sets()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_obj_add_other_obj_sets </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td>
<td class="paramname"><em>dst</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td>
<td class="paramname"><em>src</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Setup object cpusets/nodesets by OR'ing another object's sets. </p>
<p>For each defined cpuset or nodeset in <code>src</code>, allocate the corresponding set in <code>dst</code> and add <code>src</code> to it by OR'ing sets.</p>
<p>This function is convenient between <a class="el" href="a00200.html#ga4cea4741165faf5323931a9ed8786ef7" title="Allocate a Group object to insert later with hwloc_topology_insert_group_object().">hwloc_topology_alloc_group_object()</a> and <a class="el" href="a00200.html#ga1fc6012b3e1c249b83f48cb7bcacaa5b" title="Add more structure to the topology by adding an intermediate Group.">hwloc_topology_insert_group_object()</a>. It builds the sets of the new Group that will be inserted as a new intermediate parent of several objects. </p>
</div>
</div>
<a id="ga4cea4741165faf5323931a9ed8786ef7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4cea4741165faf5323931a9ed8786ef7">◆ </a></span>hwloc_topology_alloc_group_object()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_topology_alloc_group_object </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>Allocate a Group object to insert later with <a class="el" href="a00200.html#ga1fc6012b3e1c249b83f48cb7bcacaa5b" title="Add more structure to the topology by adding an intermediate Group.">hwloc_topology_insert_group_object()</a>. </p>
<p>This function returns a new Group object.</p>
<p>The caller should (at least) initialize its sets before inserting the object in the topology. See <a class="el" href="a00200.html#ga1fc6012b3e1c249b83f48cb7bcacaa5b" title="Add more structure to the topology by adding an intermediate Group.">hwloc_topology_insert_group_object()</a>. </p>
</div>
</div>
<a id="gaf955b190c0299dcfb5bc985d777f92a1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf955b190c0299dcfb5bc985d777f92a1">◆ </a></span>hwloc_topology_allow()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_topology_allow </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00192.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="a00189.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"><a class="el" href="a00189.html#ga2f5276235841ad66a79bedad16a5a10c">hwloc_const_nodeset_t</a> </td>
<td class="paramname"><em>nodeset</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>Change the sets of allowed PUs and NUMA nodes in the topology. </p>
<p>This function only works if the <a class="el" href="a00199.html#ggada025d3ec20b4b420f8038d23d6e7bdea10907044bbb306fd0dc76acf046d9258" title="Detect the whole system, ignore reservations, include disallowed objects.">HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED</a> was set on the topology. It does not modify any object, it only changes the sets returned by <a class="el" href="a00208.html#ga517d5d68ec9f24583d8933aab713be8e" title="Get allowed CPU set.">hwloc_topology_get_allowed_cpuset()</a> and <a class="el" href="a00208.html#ga21a4d7237a11e76b912ed4524ab78cbd" title="Get allowed node set.">hwloc_topology_get_allowed_nodeset()</a>.</p>
<p>It is notably useful when importing a topology from another process running in a different Linux Cgroup.</p>
<p><code>flags</code> must be set to one flag among <a class="el" href="a00200.html#ga38b1be3922094d880f6e76bf56c973d6" title="Flags to be given to hwloc_topology_allow().">hwloc_allow_flags_e</a>.</p>
<dl class="section note"><dt>Note</dt><dd>Removing objects from a topology should rather be performed with <a class="el" href="a00200.html#ga6db81ed13ac0a9d70cc80372ab537815" title="Restrict the topology to the given CPU set or nodeset.">hwloc_topology_restrict()</a>. </dd></dl>
</div>
</div>
<a id="ga1fc6012b3e1c249b83f48cb7bcacaa5b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1fc6012b3e1c249b83f48cb7bcacaa5b">◆ </a></span>hwloc_topology_insert_group_object()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_topology_insert_group_object </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>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td>
<td class="paramname"><em>group</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Add more structure to the topology by adding an intermediate Group. </p>
<p>The caller should first allocate a new Group object with <a class="el" href="a00200.html#ga4cea4741165faf5323931a9ed8786ef7" title="Allocate a Group object to insert later with hwloc_topology_insert_group_object().">hwloc_topology_alloc_group_object()</a>. Then it must setup at least one of its CPU or node sets to specify the final location of the Group in the topology. Then the object can be passed to this function for actual insertion in the topology.</p>
<p>Either the cpuset or nodeset field (or both, if compatible) must be set to a non-empty bitmap. The complete_cpuset or complete_nodeset may be set instead if inserting with respect to the complete topology (including disallowed, offline or unknown objects). If grouping several objects, <a class="el" href="a00200.html#gad458715d3335df44849216cc123d1055" title="Setup object cpusets/nodesets by OR'ing another object's sets.">hwloc_obj_add_other_obj_sets()</a> is an easy way to build the Group sets iteratively. These sets cannot be larger than the current topology, or they would get restricted silently. The core will setup the other sets after actual insertion.</p>
<p>The <code>subtype</code> object attribute may be defined (to a dynamically allocated string) to display something else than "Group" as the type name for this object in lstopo. Custom name/value info pairs may be added with <a class="el" href="a00195.html#gace7654bb8a9002caae1a4b8a59e7452e" title="Add the given info name and value pair to the given object.">hwloc_obj_add_info()</a> after insertion.</p>
<p>The group <code>dont_merge</code> attribute may be set to <code>1</code> to prevent the hwloc core from ever merging this object with another hierarchically-identical object. This is useful when the Group itself describes an important feature that cannot be exposed anywhere else in the hierarchy.</p>
<p>The group <code>kind</code> attribute may be set to a high value such as <code>0xffffffff</code> to tell hwloc that this new Group should always be discarded in favor of any existing Group with the same locality.</p>
<dl class="section return"><dt>Returns</dt><dd>The inserted object if it was properly inserted.</dd>
<dd>
An existing object if the Group was merged or discarded because the topology already contained an object at the same location (the Group did not add any hierarchy information).</dd>
<dd>
<code>NULL</code> if the insertion failed because of conflicting sets in topology tree.</dd>
<dd>
<code>NULL</code> if Group objects are filtered-out of the topology (<a class="el" href="a00199.html#gga9a5a1f0140cd1952544477833733195ba4f835955414de92c77d99b8419d4647a" title="Ignore all objects of this type.">HWLOC_TYPE_FILTER_KEEP_NONE</a>).</dd>
<dd>
<code>NULL</code> if the object was discarded because no set was initialized in the Group before insert, or all of them were empty. </dd></dl>
</div>
</div>
<a id="gad980782ade737900c5cf208946768c30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad980782ade737900c5cf208946768c30">◆ </a></span>hwloc_topology_insert_misc_object()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="a00191.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_topology_insert_misc_object </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>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="a00191.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 Misc 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> is supposed to be unique across all Misc objects in the topology. It will be duplicated to setup the new object attributes.</p>
<p>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>
<dd>
<code>NULL</code> on error.</dd>
<dd>
<code>NULL</code> if Misc objects are filtered-out of the topology (<a class="el" href="a00199.html#gga9a5a1f0140cd1952544477833733195ba4f835955414de92c77d99b8419d4647a" title="Ignore all objects of this type.">HWLOC_TYPE_FILTER_KEEP_NONE</a>).</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="a00212.html#ga333f79975b4eeb28a3d8fad3373583ce" title="Export the topology into an XML file.">hwloc_topology_export_xml()</a> in <a class="el" href="a00134_source.html">hwloc/export.h</a>. </dd></dl>
</div>
</div>
<a id="ga698ecd640d2b76742bba3829a145cd9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga698ecd640d2b76742bba3829a145cd9a">◆ </a></span>hwloc_topology_refresh()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int hwloc_topology_refresh </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>Refresh internal structures after topology modification. </p>
<p>Modifying the topology (by restricting, adding objects, modifying structures such as distances or memory attributes, etc.) may cause some internal caches to become invalid. These caches are automatically refreshed when accessed but this refreshing is not thread-safe.</p>
<p>This function is not thread-safe either, but it is a good way to end a non-thread-safe phase of topology modification. Once this refresh is done, multiple threads may concurrently consult the topology, objects, distances, attributes, etc.</p>
<p>See also <a class="el" href="a00397.html">Thread Safety</a> </p>
</div>
</div>
<a id="ga6db81ed13ac0a9d70cc80372ab537815"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6db81ed13ac0a9d70cc80372ab537815">◆ </a></span>hwloc_topology_restrict()</h2>
<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="a00192.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="a00211.html#gae991a108af01d408be2776c5b2c467b2">hwloc_const_bitmap_t</a> </td>
<td class="paramname"><em>set</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 or nodeset. </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>set</code>. All objects CPU and node sets are restricted accordingly.</p>
<p>If <a class="el" href="a00200.html#gga9d80f08eb25b7ac22f1b998dc8bf521fae4c5b1b87232f2d8a60559e77ac65a68" title="Restrict by nodeset instead of CPU set. Only keep objects whose nodeset is included or partially incl...">HWLOC_RESTRICT_FLAG_BYNODESET</a> is passed in <code>flags</code>, <code>set</code> is considered a nodeset instead of a CPU set.</p>
<p><code>flags</code> is a OR'ed set of <a class="el" href="a00200.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 set. Once dropped during restriction, objects may not be brought back, except by loading another topology with <a class="el" href="a00192.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 set 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="a00192.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 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>
|