| 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): Finding objects, miscellaneous helpers</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"> 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="#func-members">Functions</a> </div> |
| 47 |
<div class="headertitle"><div class="title">Finding objects, miscellaneous helpers </div></div> |
| 48 |
</div><!--header--> |
| 49 |
<div class="contents"> |
| 50 |
<table class="memberdecls"> |
| 51 |
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a> |
| 52 |
Functions</h2></td></tr> |
| 53 |
<tr class="memitem:ga050646458efc8ca1120d9f124c5ad861" id="r_ga050646458efc8ca1120d9f124c5ad861"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga050646458efc8ca1120d9f124c5ad861">hwloc_bitmap_singlify_per_core</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00188.html#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> cpuset, unsigned which)</td></tr> |
| 54 |
<tr class="memitem:gac060ecf6683fb0d206e46b28c64648ac" id="r_gac060ecf6683fb0d206e46b28c64648ac"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#gac060ecf6683fb0d206e46b28c64648ac">hwloc_get_pu_obj_by_os_index</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, unsigned os_index)</td></tr> |
| 55 |
<tr class="memitem:gacc7623746b55a89bdc175ee99930c420" id="r_gacc7623746b55a89bdc175ee99930c420"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#gacc7623746b55a89bdc175ee99930c420">hwloc_get_numanode_obj_by_os_index</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, unsigned os_index)</td></tr> |
| 56 |
<tr class="memitem:ga2cd22a34360643f7f5bad09576dec205" id="r_ga2cd22a34360643f7f5bad09576dec205"><td class="memItemLeft" align="right" valign="top">unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga2cd22a34360643f7f5bad09576dec205">hwloc_get_closest_objs</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> src, <a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> *restrict objs, unsigned max)</td></tr> |
| 57 |
<tr class="memitem:ga3f37fd3b4e890d6d488163634f6befd9" id="r_ga3f37fd3b4e890d6d488163634f6befd9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga3f37fd3b4e890d6d488163634f6befd9">hwloc_get_obj_below_by_type</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00167.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a> type1, unsigned idx1, <a class="el" href="a00167.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a> type2, unsigned idx2)</td></tr> |
| 58 |
<tr class="memitem:gae63546ee8a2bf78aba775c74dae97920" id="r_gae63546ee8a2bf78aba775c74dae97920"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#gae63546ee8a2bf78aba775c74dae97920">hwloc_get_obj_below_array_by_type</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, int nr, <a class="el" href="a00167.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a> *typev, unsigned *idxv)</td></tr> |
| 59 |
<tr class="memitem:gab5df3ad1e8565ea0c2cf06412f6f6233" id="r_gab5df3ad1e8565ea0c2cf06412f6f6233"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="#gab5df3ad1e8565ea0c2cf06412f6f6233">hwloc_get_obj_with_same_locality</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> src, <a class="el" href="a00167.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a> type, const char *subtype, const char *nameprefix, unsigned long flags)</td></tr> |
| 60 |
</table> |
| 61 |
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2> |
| 62 |
<p>Be sure to see the figure in <a class="el" href="a00371.html">Terms and Definitions</a> that shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers. </p> |
| 63 |
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2> |
| 64 |
<a id="ga050646458efc8ca1120d9f124c5ad861" name="ga050646458efc8ca1120d9f124c5ad861"></a> |
| 65 |
<h2 class="memtitle"><span class="permalink"><a href="#ga050646458efc8ca1120d9f124c5ad861">◆ </a></span>hwloc_bitmap_singlify_per_core()</h2> |
| 66 |
|
| 67 |
<div class="memitem"> |
| 68 |
<div class="memproto"> |
| 69 |
<table class="memname"> |
| 70 |
<tr> |
| 71 |
<td class="memname">int hwloc_bitmap_singlify_per_core </td> |
| 72 |
<td>(</td> |
| 73 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 74 |
</tr> |
| 75 |
<tr> |
| 76 |
<td class="paramkey"></td> |
| 77 |
<td></td> |
| 78 |
<td class="paramtype"><a class="el" href="a00188.html#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a></td> <td class="paramname"><span class="paramname"><em>cpuset</em></span>, </td> |
| 79 |
</tr> |
| 80 |
<tr> |
| 81 |
<td class="paramkey"></td> |
| 82 |
<td></td> |
| 83 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>which</em></span> )</td> |
| 84 |
</tr> |
| 85 |
</table> |
| 86 |
</div><div class="memdoc"> |
| 87 |
|
| 88 |
<p>Remove simultaneous multithreading PUs from a CPU set. </p> |
| 89 |
<p>For each core in <code class="param">topology</code>, if <code class="param">cpuset</code> contains some PUs of that core, modify <code class="param">cpuset</code> to only keep a single PU for that core.</p> |
| 90 |
<p><code class="param">which</code> specifies which PU will be kept. PU are considered in physical index order. If 0, for each core, the function keeps the first PU that was originally set in <code class="param">cpuset</code>.</p> |
| 91 |
<p>If <code class="param">which</code> is larger than the number of PUs in a core there were originally set in <code class="param">cpuset</code>, no PU is kept for that core.</p> |
| 92 |
<dl class="section return"><dt>Returns</dt><dd>0.</dd></dl> |
| 93 |
<dl class="section note"><dt>Note</dt><dd>PUs that are not below a Core object are ignored (for instance if the topology does not contain any Core object). None of them is removed from <code class="param">cpuset</code>. </dd></dl> |
| 94 |
|
| 95 |
</div> |
| 96 |
</div> |
| 97 |
<a id="ga2cd22a34360643f7f5bad09576dec205" name="ga2cd22a34360643f7f5bad09576dec205"></a> |
| 98 |
<h2 class="memtitle"><span class="permalink"><a href="#ga2cd22a34360643f7f5bad09576dec205">◆ </a></span>hwloc_get_closest_objs()</h2> |
| 99 |
|
| 100 |
<div class="memitem"> |
| 101 |
<div class="memproto"> |
| 102 |
<table class="memname"> |
| 103 |
<tr> |
| 104 |
<td class="memname">unsigned hwloc_get_closest_objs </td> |
| 105 |
<td>(</td> |
| 106 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 107 |
</tr> |
| 108 |
<tr> |
| 109 |
<td class="paramkey"></td> |
| 110 |
<td></td> |
| 111 |
<td class="paramtype"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a></td> <td class="paramname"><span class="paramname"><em>src</em></span>, </td> |
| 112 |
</tr> |
| 113 |
<tr> |
| 114 |
<td class="paramkey"></td> |
| 115 |
<td></td> |
| 116 |
<td class="paramtype"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> *restrict</td> <td class="paramname"><span class="paramname"><em>objs</em></span>, </td> |
| 117 |
</tr> |
| 118 |
<tr> |
| 119 |
<td class="paramkey"></td> |
| 120 |
<td></td> |
| 121 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>max</em></span> )</td> |
| 122 |
</tr> |
| 123 |
</table> |
| 124 |
</div><div class="memdoc"> |
| 125 |
|
| 126 |
<p>Do a depth-first traversal of the topology to find and sort. </p> |
| 127 |
<p>all objects that are at the same depth than <code class="param">src</code>. Report in <code class="param">objs</code> up to <code class="param">max</code> physically closest ones to <code class="param">src</code>.</p> |
| 128 |
<dl class="section return"><dt>Returns</dt><dd>the number of objects returned in <code class="param">objs</code>.</dd> |
| 129 |
<dd> |
| 130 |
0 if <code class="param">src</code> is an I/O object.</dd></dl> |
| 131 |
<dl class="section note"><dt>Note</dt><dd>This function requires the <code class="param">src</code> object to have a CPU set. </dd></dl> |
| 132 |
|
| 133 |
</div> |
| 134 |
</div> |
| 135 |
<a id="gacc7623746b55a89bdc175ee99930c420" name="gacc7623746b55a89bdc175ee99930c420"></a> |
| 136 |
<h2 class="memtitle"><span class="permalink"><a href="#gacc7623746b55a89bdc175ee99930c420">◆ </a></span>hwloc_get_numanode_obj_by_os_index()</h2> |
| 137 |
|
| 138 |
<div class="memitem"> |
| 139 |
<div class="memproto"> |
| 140 |
<table class="mlabels"> |
| 141 |
<tr> |
| 142 |
<td class="mlabels-left"> |
| 143 |
<table class="memname"> |
| 144 |
<tr> |
| 145 |
<td class="memname"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_get_numanode_obj_by_os_index </td> |
| 146 |
<td>(</td> |
| 147 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 148 |
</tr> |
| 149 |
<tr> |
| 150 |
<td class="paramkey"></td> |
| 151 |
<td></td> |
| 152 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>os_index</em></span> )</td> |
| 153 |
</tr> |
| 154 |
</table> |
| 155 |
</td> |
| 156 |
<td class="mlabels-right"> |
| 157 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 158 |
</tr> |
| 159 |
</table> |
| 160 |
</div><div class="memdoc"> |
| 161 |
|
| 162 |
<p>Returns the object of type <a class="el" href="a00167.html#ggacd37bb612667dc437d66bfb175a8dc55a9d917a3e5497950c6d8948b8e183db5a" title="NUMA node. An object that contains memory that is directly and byte-accessible to the host processors...">HWLOC_OBJ_NUMANODE</a> with <code class="param">os_index</code>. </p> |
| 163 |
<p>This function is useful for converting a nodeset into the NUMA node objects it contains. When retrieving the current binding (e.g. with <a class="el" href="a00174.html#gae21f0a1a884929c784bebf070252aa56" title="Query the default memory binding policy and physical locality of the current process or thread.">hwloc_get_membind()</a> with HWLOC_MEMBIND_BYNODESET), one may iterate over the bits of the resulting nodeset with <a class="el" href="a00188.html#ga3f6861045a8029ade373510ffa727d2a" title="Loop macro iterating on bitmap bitmap.">hwloc_bitmap_foreach_begin()</a>, and find the corresponding NUMA nodes with this function.</p> |
| 164 |
<dl class="section return"><dt>Returns</dt><dd>the NUMA node object, or <code>NULL</code> if none matches. </dd></dl> |
| 165 |
|
| 166 |
</div> |
| 167 |
</div> |
| 168 |
<a id="gae63546ee8a2bf78aba775c74dae97920" name="gae63546ee8a2bf78aba775c74dae97920"></a> |
| 169 |
<h2 class="memtitle"><span class="permalink"><a href="#gae63546ee8a2bf78aba775c74dae97920">◆ </a></span>hwloc_get_obj_below_array_by_type()</h2> |
| 170 |
|
| 171 |
<div class="memitem"> |
| 172 |
<div class="memproto"> |
| 173 |
<table class="mlabels"> |
| 174 |
<tr> |
| 175 |
<td class="mlabels-left"> |
| 176 |
<table class="memname"> |
| 177 |
<tr> |
| 178 |
<td class="memname"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_get_obj_below_array_by_type </td> |
| 179 |
<td>(</td> |
| 180 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 181 |
</tr> |
| 182 |
<tr> |
| 183 |
<td class="paramkey"></td> |
| 184 |
<td></td> |
| 185 |
<td class="paramtype">int</td> <td class="paramname"><span class="paramname"><em>nr</em></span>, </td> |
| 186 |
</tr> |
| 187 |
<tr> |
| 188 |
<td class="paramkey"></td> |
| 189 |
<td></td> |
| 190 |
<td class="paramtype"><a class="el" href="a00167.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a> *</td> <td class="paramname"><span class="paramname"><em>typev</em></span>, </td> |
| 191 |
</tr> |
| 192 |
<tr> |
| 193 |
<td class="paramkey"></td> |
| 194 |
<td></td> |
| 195 |
<td class="paramtype">unsigned *</td> <td class="paramname"><span class="paramname"><em>idxv</em></span> )</td> |
| 196 |
</tr> |
| 197 |
</table> |
| 198 |
</td> |
| 199 |
<td class="mlabels-right"> |
| 200 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 201 |
</tr> |
| 202 |
</table> |
| 203 |
</div><div class="memdoc"> |
| 204 |
|
| 205 |
<p>Find an object below a chain of objects specified by types and indexes. </p> |
| 206 |
<p>This is a generalized version of <a class="el" href="#ga3f37fd3b4e890d6d488163634f6befd9" title="Find an object below another object, both specified by types and indexes.">hwloc_get_obj_below_by_type()</a>.</p> |
| 207 |
<p>Arrays <code class="param">typev</code> and <code class="param">idxv</code> must contain <code class="param">nr</code> types and indexes.</p> |
| 208 |
<p>Start from the top system object and walk the arrays <code class="param">typev</code> and <code class="param">idxv</code>. For each type and logical index couple in the arrays, look under the previously found object to find the index-th object of the given type. Indexes are specified within the parent, not withing the entire system.</p> |
| 209 |
<p>For instance, if nr is 3, typev contains NODE, PACKAGE and CORE, and idxv contains 0, 1 and 2, return the third core object below the second package below the first NUMA node.</p> |
| 210 |
<dl class="section return"><dt>Returns</dt><dd>a matching object if any, <code>NULL</code> otherwise.</dd></dl> |
| 211 |
<dl class="section note"><dt>Note</dt><dd>This function requires all these objects and the root object to have a CPU set. </dd></dl> |
| 212 |
|
| 213 |
</div> |
| 214 |
</div> |
| 215 |
<a id="ga3f37fd3b4e890d6d488163634f6befd9" name="ga3f37fd3b4e890d6d488163634f6befd9"></a> |
| 216 |
<h2 class="memtitle"><span class="permalink"><a href="#ga3f37fd3b4e890d6d488163634f6befd9">◆ </a></span>hwloc_get_obj_below_by_type()</h2> |
| 217 |
|
| 218 |
<div class="memitem"> |
| 219 |
<div class="memproto"> |
| 220 |
<table class="mlabels"> |
| 221 |
<tr> |
| 222 |
<td class="mlabels-left"> |
| 223 |
<table class="memname"> |
| 224 |
<tr> |
| 225 |
<td class="memname"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_get_obj_below_by_type </td> |
| 226 |
<td>(</td> |
| 227 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 228 |
</tr> |
| 229 |
<tr> |
| 230 |
<td class="paramkey"></td> |
| 231 |
<td></td> |
| 232 |
<td class="paramtype"><a class="el" href="a00167.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a></td> <td class="paramname"><span class="paramname"><em>type1</em></span>, </td> |
| 233 |
</tr> |
| 234 |
<tr> |
| 235 |
<td class="paramkey"></td> |
| 236 |
<td></td> |
| 237 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>idx1</em></span>, </td> |
| 238 |
</tr> |
| 239 |
<tr> |
| 240 |
<td class="paramkey"></td> |
| 241 |
<td></td> |
| 242 |
<td class="paramtype"><a class="el" href="a00167.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a></td> <td class="paramname"><span class="paramname"><em>type2</em></span>, </td> |
| 243 |
</tr> |
| 244 |
<tr> |
| 245 |
<td class="paramkey"></td> |
| 246 |
<td></td> |
| 247 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>idx2</em></span> )</td> |
| 248 |
</tr> |
| 249 |
</table> |
| 250 |
</td> |
| 251 |
<td class="mlabels-right"> |
| 252 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 253 |
</tr> |
| 254 |
</table> |
| 255 |
</div><div class="memdoc"> |
| 256 |
|
| 257 |
<p>Find an object below another object, both specified by types and indexes. </p> |
| 258 |
<p>Start from the top system object and find object of type <code class="param">type1</code> and logical index <code class="param">idx1</code>. Then look below this object and find another object of type <code class="param">type2</code> and logical index <code class="param">idx2</code>. Indexes are specified within the parent, not withing the entire system.</p> |
| 259 |
<p>For instance, if type1 is PACKAGE, idx1 is 2, type2 is CORE and idx2 is 3, return the fourth core object below the third package.</p> |
| 260 |
<dl class="section return"><dt>Returns</dt><dd>a matching object if any, <code>NULL</code> otherwise.</dd></dl> |
| 261 |
<dl class="section note"><dt>Note</dt><dd>This function requires these objects to have a CPU set. </dd></dl> |
| 262 |
|
| 263 |
</div> |
| 264 |
</div> |
| 265 |
<a id="gab5df3ad1e8565ea0c2cf06412f6f6233" name="gab5df3ad1e8565ea0c2cf06412f6f6233"></a> |
| 266 |
<h2 class="memtitle"><span class="permalink"><a href="#gab5df3ad1e8565ea0c2cf06412f6f6233">◆ </a></span>hwloc_get_obj_with_same_locality()</h2> |
| 267 |
|
| 268 |
<div class="memitem"> |
| 269 |
<div class="memproto"> |
| 270 |
<table class="memname"> |
| 271 |
<tr> |
| 272 |
<td class="memname"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_get_obj_with_same_locality </td> |
| 273 |
<td>(</td> |
| 274 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 275 |
</tr> |
| 276 |
<tr> |
| 277 |
<td class="paramkey"></td> |
| 278 |
<td></td> |
| 279 |
<td class="paramtype"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a></td> <td class="paramname"><span class="paramname"><em>src</em></span>, </td> |
| 280 |
</tr> |
| 281 |
<tr> |
| 282 |
<td class="paramkey"></td> |
| 283 |
<td></td> |
| 284 |
<td class="paramtype"><a class="el" href="a00167.html#gacd37bb612667dc437d66bfb175a8dc55">hwloc_obj_type_t</a></td> <td class="paramname"><span class="paramname"><em>type</em></span>, </td> |
| 285 |
</tr> |
| 286 |
<tr> |
| 287 |
<td class="paramkey"></td> |
| 288 |
<td></td> |
| 289 |
<td class="paramtype">const char *</td> <td class="paramname"><span class="paramname"><em>subtype</em></span>, </td> |
| 290 |
</tr> |
| 291 |
<tr> |
| 292 |
<td class="paramkey"></td> |
| 293 |
<td></td> |
| 294 |
<td class="paramtype">const char *</td> <td class="paramname"><span class="paramname"><em>nameprefix</em></span>, </td> |
| 295 |
</tr> |
| 296 |
<tr> |
| 297 |
<td class="paramkey"></td> |
| 298 |
<td></td> |
| 299 |
<td class="paramtype">unsigned long</td> <td class="paramname"><span class="paramname"><em>flags</em></span> )</td> |
| 300 |
</tr> |
| 301 |
</table> |
| 302 |
</div><div class="memdoc"> |
| 303 |
|
| 304 |
<p>Return an object of a different type with same locality. </p> |
| 305 |
<p>If the source object <code class="param">src</code> is a normal or memory type, this function returns an object of type <code class="param">type</code> with same CPU and node sets, either below or above in the hierarchy.</p> |
| 306 |
<p>If the source object <code class="param">src</code> is a PCI or an OS device within a PCI device, the function may either return that PCI device, or another OS device in the same PCI parent. This may for instance be useful for converting between OS devices such as "nvml0" or "rsmi1" used in distance structures into the the PCI device, or the CUDA or OpenCL OS device that correspond to the same physical card.</p> |
| 307 |
<p>If not <code>NULL</code>, parameter <code class="param">subtype</code> only select objects whose subtype attribute exists and is <code class="param">subtype</code> (case-insensitively), for instance "OpenCL" or "CUDA".</p> |
| 308 |
<p>If not <code>NULL</code>, parameter <code class="param">nameprefix</code> only selects objects whose name attribute exists and starts with <code class="param">nameprefix</code> (case-insensitively), for instance "rsmi" for matching "rsmi0".</p> |
| 309 |
<p>If multiple objects match, the first one is returned.</p> |
| 310 |
<p>This function will not walk the hierarchy across bridges since the PCI locality may become different. This function cannot also convert between normal/memory objects and I/O or Misc objects.</p> |
| 311 |
<p><code class="param">flags</code> must be <code>0</code> for now.</p> |
| 312 |
<dl class="section return"><dt>Returns</dt><dd>An object with identical locality, matching <code class="param">subtype</code> and <code class="param">nameprefix</code> if any.</dd> |
| 313 |
<dd> |
| 314 |
<code>NULL</code> if no matching object could be found, or if the source object and target type are incompatible, for instance if converting between CPU and I/O objects. </dd></dl> |
| 315 |
|
| 316 |
</div> |
| 317 |
</div> |
| 318 |
<a id="gac060ecf6683fb0d206e46b28c64648ac" name="gac060ecf6683fb0d206e46b28c64648ac"></a> |
| 319 |
<h2 class="memtitle"><span class="permalink"><a href="#gac060ecf6683fb0d206e46b28c64648ac">◆ </a></span>hwloc_get_pu_obj_by_os_index()</h2> |
| 320 |
|
| 321 |
<div class="memitem"> |
| 322 |
<div class="memproto"> |
| 323 |
<table class="mlabels"> |
| 324 |
<tr> |
| 325 |
<td class="mlabels-left"> |
| 326 |
<table class="memname"> |
| 327 |
<tr> |
| 328 |
<td class="memname"><a class="el" href="a00168.html#ga79b8ab56877ef99ac59b833203391c7d">hwloc_obj_t</a> hwloc_get_pu_obj_by_os_index </td> |
| 329 |
<td>(</td> |
| 330 |
<td class="paramtype"><a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a></td> <td class="paramname"><span class="paramname"><em>topology</em></span>, </td> |
| 331 |
</tr> |
| 332 |
<tr> |
| 333 |
<td class="paramkey"></td> |
| 334 |
<td></td> |
| 335 |
<td class="paramtype">unsigned</td> <td class="paramname"><span class="paramname"><em>os_index</em></span> )</td> |
| 336 |
</tr> |
| 337 |
</table> |
| 338 |
</td> |
| 339 |
<td class="mlabels-right"> |
| 340 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 341 |
</tr> |
| 342 |
</table> |
| 343 |
</div><div class="memdoc"> |
| 344 |
|
| 345 |
<p>Returns the object of type <a class="el" href="a00167.html#ggacd37bb612667dc437d66bfb175a8dc55abca6887e80cb291353b0a0c1da83f661" title="Processing Unit, or (Logical) Processor. An execution unit (may share a core with some other logical ...">HWLOC_OBJ_PU</a> with <code class="param">os_index</code>. </p> |
| 346 |
<p>This function is useful for converting a CPU set into the PU objects it contains. When retrieving the current binding (e.g. with <a class="el" href="a00173.html#gacba7ecb979baf824d5240fa2cb2a8be6" title="Get current process or thread binding.">hwloc_get_cpubind()</a>), one may iterate over the bits of the resulting CPU set with <a class="el" href="a00188.html#ga3f6861045a8029ade373510ffa727d2a" title="Loop macro iterating on bitmap bitmap.">hwloc_bitmap_foreach_begin()</a>, and find the corresponding PUs with this function.</p> |
| 347 |
<dl class="section return"><dt>Returns</dt><dd>the PU object, or <code>NULL</code> if none matches. </dd></dl> |
| 348 |
|
| 349 |
</div> |
| 350 |
</div> |
| 351 |
</div><!-- contents --> |
| 352 |
<!-- start footer part --> |
| 353 |
<hr class="footer"/><address class="footer"><small> |
| 354 |
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.15.0 |
| 355 |
</small></address> |
| 356 |
</div><!-- doc-content --> |
| 357 |
</body> |
| 358 |
</html> |