| 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): Interoperability with Linux libnuma unsigned long masks</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">Interoperability with Linux libnuma unsigned long masks </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:gad681f9d6a3d4b3c3bbd815e371d127e8" id="r_gad681f9d6a3d4b3c3bbd815e371d127e8"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gad681f9d6a3d4b3c3bbd815e371d127e8">hwloc_cpuset_to_linux_libnuma_ulongs</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00166.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a> cpuset, unsigned long *mask, unsigned long *maxnode)</td></tr> |
| 54 |
<tr class="memitem:ga01582d6806cf9d9a7f843b03f9b8ce56" id="r_ga01582d6806cf9d9a7f843b03f9b8ce56"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga01582d6806cf9d9a7f843b03f9b8ce56">hwloc_nodeset_to_linux_libnuma_ulongs</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00166.html#ga2f5276235841ad66a79bedad16a5a10c">hwloc_const_nodeset_t</a> nodeset, unsigned long *mask, unsigned long *maxnode)</td></tr> |
| 55 |
<tr class="memitem:gaacfe1849ef4b085666702bc882a47119" id="r_gaacfe1849ef4b085666702bc882a47119"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaacfe1849ef4b085666702bc882a47119">hwloc_cpuset_from_linux_libnuma_ulongs</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> cpuset, const unsigned long *mask, unsigned long maxnode)</td></tr> |
| 56 |
<tr class="memitem:gad0b499b76557d4d2c535574c4e661efc" id="r_gad0b499b76557d4d2c535574c4e661efc"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gad0b499b76557d4d2c535574c4e661efc">hwloc_nodeset_from_linux_libnuma_ulongs</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00166.html#ga37e35730fa7e775b5bb0afe893d6d508">hwloc_nodeset_t</a> nodeset, const unsigned long *mask, unsigned long maxnode)</td></tr> |
| 57 |
</table> |
| 58 |
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2> |
| 59 |
<p>This interface helps converting between Linux libnuma unsigned long masks and hwloc cpusets and nodesets.</p> |
| 60 |
<dl class="section note"><dt>Note</dt><dd>Topology <code class="param">topology</code> must match the current machine.</dd> |
| 61 |
<dd> |
| 62 |
The behavior of libnuma is undefined if the kernel is not NUMA-aware. (when CONFIG_NUMA is not set in the kernel configuration). This helper and libnuma may thus not be strictly compatible in this case, which may be detected by checking whether numa_available() returns -1. </dd></dl> |
| 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="gaacfe1849ef4b085666702bc882a47119" name="gaacfe1849ef4b085666702bc882a47119"></a> |
| 65 |
<h2 class="memtitle"><span class="permalink"><a href="#gaacfe1849ef4b085666702bc882a47119">◆ </a></span>hwloc_cpuset_from_linux_libnuma_ulongs()</h2> |
| 66 |
|
| 67 |
<div class="memitem"> |
| 68 |
<div class="memproto"> |
| 69 |
<table class="mlabels"> |
| 70 |
<tr> |
| 71 |
<td class="mlabels-left"> |
| 72 |
<table class="memname"> |
| 73 |
<tr> |
| 74 |
<td class="memname">int hwloc_cpuset_from_linux_libnuma_ulongs </td> |
| 75 |
<td>(</td> |
| 76 |
<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> |
| 77 |
</tr> |
| 78 |
<tr> |
| 79 |
<td class="paramkey"></td> |
| 80 |
<td></td> |
| 81 |
<td class="paramtype"><a class="el" href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a></td> <td class="paramname"><span class="paramname"><em>cpuset</em></span>, </td> |
| 82 |
</tr> |
| 83 |
<tr> |
| 84 |
<td class="paramkey"></td> |
| 85 |
<td></td> |
| 86 |
<td class="paramtype">const unsigned long *</td> <td class="paramname"><span class="paramname"><em>mask</em></span>, </td> |
| 87 |
</tr> |
| 88 |
<tr> |
| 89 |
<td class="paramkey"></td> |
| 90 |
<td></td> |
| 91 |
<td class="paramtype">unsigned long</td> <td class="paramname"><span class="paramname"><em>maxnode</em></span> )</td> |
| 92 |
</tr> |
| 93 |
</table> |
| 94 |
</td> |
| 95 |
<td class="mlabels-right"> |
| 96 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 97 |
</tr> |
| 98 |
</table> |
| 99 |
</div><div class="memdoc"> |
| 100 |
|
| 101 |
<p>Convert the array of unsigned long <code class="param">mask</code> into hwloc CPU set. </p> |
| 102 |
<p><code class="param">mask</code> is a array of unsigned long that will be read. <code class="param">maxnode</code> contains the maximal node number that may be read in <code class="param">mask</code>.</p> |
| 103 |
<p>This function may be used after calling get_mempolicy or any other function that takes an array of unsigned long as output parameter (and possibly a maximal node number as input parameter).</p> |
| 104 |
<dl class="section return"><dt>Returns</dt><dd>0 on success. </dd> |
| 105 |
<dd> |
| 106 |
-1 on error, for instance if failing an internal reallocation. </dd></dl> |
| 107 |
|
| 108 |
</div> |
| 109 |
</div> |
| 110 |
<a id="gad681f9d6a3d4b3c3bbd815e371d127e8" name="gad681f9d6a3d4b3c3bbd815e371d127e8"></a> |
| 111 |
<h2 class="memtitle"><span class="permalink"><a href="#gad681f9d6a3d4b3c3bbd815e371d127e8">◆ </a></span>hwloc_cpuset_to_linux_libnuma_ulongs()</h2> |
| 112 |
|
| 113 |
<div class="memitem"> |
| 114 |
<div class="memproto"> |
| 115 |
<table class="mlabels"> |
| 116 |
<tr> |
| 117 |
<td class="mlabels-left"> |
| 118 |
<table class="memname"> |
| 119 |
<tr> |
| 120 |
<td class="memname">int hwloc_cpuset_to_linux_libnuma_ulongs </td> |
| 121 |
<td>(</td> |
| 122 |
<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> |
| 123 |
</tr> |
| 124 |
<tr> |
| 125 |
<td class="paramkey"></td> |
| 126 |
<td></td> |
| 127 |
<td class="paramtype"><a class="el" href="a00166.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a></td> <td class="paramname"><span class="paramname"><em>cpuset</em></span>, </td> |
| 128 |
</tr> |
| 129 |
<tr> |
| 130 |
<td class="paramkey"></td> |
| 131 |
<td></td> |
| 132 |
<td class="paramtype">unsigned long *</td> <td class="paramname"><span class="paramname"><em>mask</em></span>, </td> |
| 133 |
</tr> |
| 134 |
<tr> |
| 135 |
<td class="paramkey"></td> |
| 136 |
<td></td> |
| 137 |
<td class="paramtype">unsigned long *</td> <td class="paramname"><span class="paramname"><em>maxnode</em></span> )</td> |
| 138 |
</tr> |
| 139 |
</table> |
| 140 |
</td> |
| 141 |
<td class="mlabels-right"> |
| 142 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 143 |
</tr> |
| 144 |
</table> |
| 145 |
</div><div class="memdoc"> |
| 146 |
|
| 147 |
<p>Convert hwloc CPU set <code class="param">cpuset</code> into the array of unsigned long <code class="param">mask</code>. </p> |
| 148 |
<p><code class="param">mask</code> is the array of unsigned long that will be filled. <code class="param">maxnode</code> contains the maximal node number that may be stored in <code class="param">mask</code>. <code class="param">maxnode</code> will be set to the maximal node number that was found, plus one.</p> |
| 149 |
<p>This function may be used before calling set_mempolicy, mbind, migrate_pages or any other function that takes an array of unsigned long and a maximal node number as input parameter.</p> |
| 150 |
<dl class="section return"><dt>Returns</dt><dd>0.</dd></dl> |
| 151 |
<dl class="section note"><dt>Note</dt><dd>On heterogeneous memory platforms, we may return multiple local NUMA nodes even if libnuma reports only one (usually the first one). </dd></dl> |
| 152 |
|
| 153 |
</div> |
| 154 |
</div> |
| 155 |
<a id="gad0b499b76557d4d2c535574c4e661efc" name="gad0b499b76557d4d2c535574c4e661efc"></a> |
| 156 |
<h2 class="memtitle"><span class="permalink"><a href="#gad0b499b76557d4d2c535574c4e661efc">◆ </a></span>hwloc_nodeset_from_linux_libnuma_ulongs()</h2> |
| 157 |
|
| 158 |
<div class="memitem"> |
| 159 |
<div class="memproto"> |
| 160 |
<table class="mlabels"> |
| 161 |
<tr> |
| 162 |
<td class="mlabels-left"> |
| 163 |
<table class="memname"> |
| 164 |
<tr> |
| 165 |
<td class="memname">int hwloc_nodeset_from_linux_libnuma_ulongs </td> |
| 166 |
<td>(</td> |
| 167 |
<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> |
| 168 |
</tr> |
| 169 |
<tr> |
| 170 |
<td class="paramkey"></td> |
| 171 |
<td></td> |
| 172 |
<td class="paramtype"><a class="el" href="a00166.html#ga37e35730fa7e775b5bb0afe893d6d508">hwloc_nodeset_t</a></td> <td class="paramname"><span class="paramname"><em>nodeset</em></span>, </td> |
| 173 |
</tr> |
| 174 |
<tr> |
| 175 |
<td class="paramkey"></td> |
| 176 |
<td></td> |
| 177 |
<td class="paramtype">const unsigned long *</td> <td class="paramname"><span class="paramname"><em>mask</em></span>, </td> |
| 178 |
</tr> |
| 179 |
<tr> |
| 180 |
<td class="paramkey"></td> |
| 181 |
<td></td> |
| 182 |
<td class="paramtype">unsigned long</td> <td class="paramname"><span class="paramname"><em>maxnode</em></span> )</td> |
| 183 |
</tr> |
| 184 |
</table> |
| 185 |
</td> |
| 186 |
<td class="mlabels-right"> |
| 187 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 188 |
</tr> |
| 189 |
</table> |
| 190 |
</div><div class="memdoc"> |
| 191 |
|
| 192 |
<p>Convert the array of unsigned long <code class="param">mask</code> into hwloc NUMA node set. </p> |
| 193 |
<p><code class="param">mask</code> is a array of unsigned long that will be read. <code class="param">maxnode</code> contains the maximal node number that may be read in <code class="param">mask</code>.</p> |
| 194 |
<p>This function may be used after calling get_mempolicy or any other function that takes an array of unsigned long as output parameter (and possibly a maximal node number as input parameter).</p> |
| 195 |
<dl class="section return"><dt>Returns</dt><dd>0 on success. </dd> |
| 196 |
<dd> |
| 197 |
-1 with errno set to <code>ENOMEM</code> if some internal reallocation failed. </dd></dl> |
| 198 |
|
| 199 |
</div> |
| 200 |
</div> |
| 201 |
<a id="ga01582d6806cf9d9a7f843b03f9b8ce56" name="ga01582d6806cf9d9a7f843b03f9b8ce56"></a> |
| 202 |
<h2 class="memtitle"><span class="permalink"><a href="#ga01582d6806cf9d9a7f843b03f9b8ce56">◆ </a></span>hwloc_nodeset_to_linux_libnuma_ulongs()</h2> |
| 203 |
|
| 204 |
<div class="memitem"> |
| 205 |
<div class="memproto"> |
| 206 |
<table class="mlabels"> |
| 207 |
<tr> |
| 208 |
<td class="mlabels-left"> |
| 209 |
<table class="memname"> |
| 210 |
<tr> |
| 211 |
<td class="memname">int hwloc_nodeset_to_linux_libnuma_ulongs </td> |
| 212 |
<td>(</td> |
| 213 |
<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> |
| 214 |
</tr> |
| 215 |
<tr> |
| 216 |
<td class="paramkey"></td> |
| 217 |
<td></td> |
| 218 |
<td class="paramtype"><a class="el" href="a00166.html#ga2f5276235841ad66a79bedad16a5a10c">hwloc_const_nodeset_t</a></td> <td class="paramname"><span class="paramname"><em>nodeset</em></span>, </td> |
| 219 |
</tr> |
| 220 |
<tr> |
| 221 |
<td class="paramkey"></td> |
| 222 |
<td></td> |
| 223 |
<td class="paramtype">unsigned long *</td> <td class="paramname"><span class="paramname"><em>mask</em></span>, </td> |
| 224 |
</tr> |
| 225 |
<tr> |
| 226 |
<td class="paramkey"></td> |
| 227 |
<td></td> |
| 228 |
<td class="paramtype">unsigned long *</td> <td class="paramname"><span class="paramname"><em>maxnode</em></span> )</td> |
| 229 |
</tr> |
| 230 |
</table> |
| 231 |
</td> |
| 232 |
<td class="mlabels-right"> |
| 233 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 234 |
</tr> |
| 235 |
</table> |
| 236 |
</div><div class="memdoc"> |
| 237 |
|
| 238 |
<p>Convert hwloc NUMA node set <code class="param">nodeset</code> into the array of unsigned long <code class="param">mask</code>. </p> |
| 239 |
<p><code class="param">mask</code> is the array of unsigned long that will be filled. <code class="param">maxnode</code> contains the maximal node number that may be stored in <code class="param">mask</code>. <code class="param">maxnode</code> will be set to the maximal node number that was found, plus one.</p> |
| 240 |
<p>This function may be used before calling set_mempolicy, mbind, migrate_pages or any other function that takes an array of unsigned long and a maximal node number as input parameter.</p> |
| 241 |
<dl class="section return"><dt>Returns</dt><dd>0. </dd></dl> |
| 242 |
|
| 243 |
</div> |
| 244 |
</div> |
| 245 |
</div><!-- contents --> |
| 246 |
<!-- start footer part --> |
| 247 |
<hr class="footer"/><address class="footer"><small> |
| 248 |
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 |
| 249 |
</small></address> |
| 250 |
</div><!-- doc-content --> |
| 251 |
</body> |
| 252 |
</html> |