| 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 glibc sched affinity</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 glibc sched affinity </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:ga8029317e72d01945afab179892f8581e" id="r_ga8029317e72d01945afab179892f8581e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#ga8029317e72d01945afab179892f8581e">hwloc_cpuset_to_glibc_sched_affinity</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> hwlocset, cpu_set_t *schedset, size_t schedsetsize)</td></tr> |
| 54 |
<tr class="memitem:gaa3945bd96a56822fe43d912e384236cb" id="r_gaa3945bd96a56822fe43d912e384236cb"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="#gaa3945bd96a56822fe43d912e384236cb">hwloc_cpuset_from_glibc_sched_affinity</a> (<a class="el" href="a00169.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> hwlocset, const cpu_set_t *schedset, size_t schedsetsize)</td></tr> |
| 55 |
</table> |
| 56 |
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2> |
| 57 |
<p>This interface offers ways to convert between hwloc cpusets and glibc cpusets such as those manipulated by sched_getaffinity() or pthread_attr_setaffinity_np().</p> |
| 58 |
<dl class="section note"><dt>Note</dt><dd>Topology <code class="param">topology</code> must match the current machine. </dd></dl> |
| 59 |
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2> |
| 60 |
<a id="gaa3945bd96a56822fe43d912e384236cb" name="gaa3945bd96a56822fe43d912e384236cb"></a> |
| 61 |
<h2 class="memtitle"><span class="permalink"><a href="#gaa3945bd96a56822fe43d912e384236cb">◆ </a></span>hwloc_cpuset_from_glibc_sched_affinity()</h2> |
| 62 |
|
| 63 |
<div class="memitem"> |
| 64 |
<div class="memproto"> |
| 65 |
<table class="mlabels"> |
| 66 |
<tr> |
| 67 |
<td class="mlabels-left"> |
| 68 |
<table class="memname"> |
| 69 |
<tr> |
| 70 |
<td class="memname">int hwloc_cpuset_from_glibc_sched_affinity </td> |
| 71 |
<td>(</td> |
| 72 |
<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> |
| 73 |
</tr> |
| 74 |
<tr> |
| 75 |
<td class="paramkey"></td> |
| 76 |
<td></td> |
| 77 |
<td class="paramtype"><a class="el" href="a00166.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a></td> <td class="paramname"><span class="paramname"><em>hwlocset</em></span>, </td> |
| 78 |
</tr> |
| 79 |
<tr> |
| 80 |
<td class="paramkey"></td> |
| 81 |
<td></td> |
| 82 |
<td class="paramtype">const cpu_set_t *</td> <td class="paramname"><span class="paramname"><em>schedset</em></span>, </td> |
| 83 |
</tr> |
| 84 |
<tr> |
| 85 |
<td class="paramkey"></td> |
| 86 |
<td></td> |
| 87 |
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>schedsetsize</em></span> )</td> |
| 88 |
</tr> |
| 89 |
</table> |
| 90 |
</td> |
| 91 |
<td class="mlabels-right"> |
| 92 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 93 |
</tr> |
| 94 |
</table> |
| 95 |
</div><div class="memdoc"> |
| 96 |
|
| 97 |
<p>Convert glibc sched affinity CPU set <code class="param">schedset</code> into hwloc CPU set. </p> |
| 98 |
<p>This function may be used before calling sched_setaffinity or any other function that takes a cpu_set_t as input parameter.</p> |
| 99 |
<p><code class="param">schedsetsize</code> should be sizeof(cpu_set_t) unless <code class="param">schedset</code> was dynamically allocated with CPU_ALLOC</p> |
| 100 |
<dl class="section return"><dt>Returns</dt><dd>0 on success. </dd> |
| 101 |
<dd> |
| 102 |
-1 with errno set to <code>ENOMEM</code> if some internal reallocation failed. </dd></dl> |
| 103 |
|
| 104 |
</div> |
| 105 |
</div> |
| 106 |
<a id="ga8029317e72d01945afab179892f8581e" name="ga8029317e72d01945afab179892f8581e"></a> |
| 107 |
<h2 class="memtitle"><span class="permalink"><a href="#ga8029317e72d01945afab179892f8581e">◆ </a></span>hwloc_cpuset_to_glibc_sched_affinity()</h2> |
| 108 |
|
| 109 |
<div class="memitem"> |
| 110 |
<div class="memproto"> |
| 111 |
<table class="mlabels"> |
| 112 |
<tr> |
| 113 |
<td class="mlabels-left"> |
| 114 |
<table class="memname"> |
| 115 |
<tr> |
| 116 |
<td class="memname">int hwloc_cpuset_to_glibc_sched_affinity </td> |
| 117 |
<td>(</td> |
| 118 |
<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> |
| 119 |
</tr> |
| 120 |
<tr> |
| 121 |
<td class="paramkey"></td> |
| 122 |
<td></td> |
| 123 |
<td class="paramtype"><a class="el" href="a00166.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a></td> <td class="paramname"><span class="paramname"><em>hwlocset</em></span>, </td> |
| 124 |
</tr> |
| 125 |
<tr> |
| 126 |
<td class="paramkey"></td> |
| 127 |
<td></td> |
| 128 |
<td class="paramtype">cpu_set_t *</td> <td class="paramname"><span class="paramname"><em>schedset</em></span>, </td> |
| 129 |
</tr> |
| 130 |
<tr> |
| 131 |
<td class="paramkey"></td> |
| 132 |
<td></td> |
| 133 |
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>schedsetsize</em></span> )</td> |
| 134 |
</tr> |
| 135 |
</table> |
| 136 |
</td> |
| 137 |
<td class="mlabels-right"> |
| 138 |
<span class="mlabels"><span class="mlabel inline">inline</span></span> </td> |
| 139 |
</tr> |
| 140 |
</table> |
| 141 |
</div><div class="memdoc"> |
| 142 |
|
| 143 |
<p>Convert hwloc CPU set <code class="param">toposet</code> into glibc sched affinity CPU set <code class="param">schedset</code>. </p> |
| 144 |
<p>This function may be used before calling sched_setaffinity or any other function that takes a cpu_set_t as input parameter.</p> |
| 145 |
<p><code class="param">schedsetsize</code> should be sizeof(cpu_set_t) unless <code class="param">schedset</code> was dynamically allocated with CPU_ALLOC</p> |
| 146 |
<dl class="section return"><dt>Returns</dt><dd>0. </dd></dl> |
| 147 |
|
| 148 |
</div> |
| 149 |
</div> |
| 150 |
</div><!-- contents --> |
| 151 |
<!-- start footer part --> |
| 152 |
<hr class="footer"/><address class="footer"><small> |
| 153 |
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 |
| 154 |
</small></address> |
| 155 |
</div><!-- doc-content --> |
| 156 |
</body> |
| 157 |
</html> |