File: a00195.html

package info (click to toggle)
hwloc 2.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,496 kB
  • sloc: ansic: 61,022; xml: 13,559; sh: 7,352; makefile: 2,150; javascript: 879; cpp: 93; sed: 5
file content (219 lines) | stat: -rw-r--r-- 12,152 bytes parent folder | download | duplicates (4)
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
<!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" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Locality (hwloc): Linux-specific helpers</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 id="projectrow">
  <td id="projectalign">
   <div id="projectname">Hardware Locality (hwloc)<span id="projectnumber">&#160;2.12.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<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:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(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="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Linux-specific helpers</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga630e699c56b5f3d2e534b475944c216e" id="r_ga630e699c56b5f3d2e534b475944c216e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00195.html#ga630e699c56b5f3d2e534b475944c216e">hwloc_linux_set_tid_cpubind</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, pid_t tid, <a class="el" href="a00163.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a> set)</td></tr>
<tr class="separator:ga630e699c56b5f3d2e534b475944c216e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaddcb985cb56337a4d6693cee72e7bf94" id="r_gaddcb985cb56337a4d6693cee72e7bf94"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00195.html#gaddcb985cb56337a4d6693cee72e7bf94">hwloc_linux_get_tid_cpubind</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, pid_t tid, <a class="el" href="a00163.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> set)</td></tr>
<tr class="separator:gaddcb985cb56337a4d6693cee72e7bf94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacc7945c2d06c6db1e58f8fd953009134" id="r_gacc7945c2d06c6db1e58f8fd953009134"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00195.html#gacc7945c2d06c6db1e58f8fd953009134">hwloc_linux_get_tid_last_cpu_location</a> (<a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, pid_t tid, <a class="el" href="a00185.html#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> set)</td></tr>
<tr class="separator:gacc7945c2d06c6db1e58f8fd953009134"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf72d83e273803226ce772973e37b85de" id="r_gaf72d83e273803226ce772973e37b85de"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00195.html#gaf72d83e273803226ce772973e37b85de">hwloc_linux_read_path_as_cpumask</a> (const char *path, <a class="el" href="a00185.html#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a> set)</td></tr>
<tr class="separator:gaf72d83e273803226ce772973e37b85de"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This includes helpers for manipulating Linux kernel cpumap files, and hwloc equivalents of the Linux sched_setaffinity and sched_getaffinity system calls. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaddcb985cb56337a4d6693cee72e7bf94" name="gaddcb985cb56337a4d6693cee72e7bf94"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaddcb985cb56337a4d6693cee72e7bf94">&#9670;&#160;</a></span>hwloc_linux_get_tid_cpubind()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_linux_get_tid_cpubind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a>&#160;</td>
          <td class="paramname"><em>topology</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">pid_t&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00163.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a>&#160;</td>
          <td class="paramname"><em>set</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the current binding of thread <code>tid</code>. </p>
<p>The CPU-set <code>set</code> (previously allocated by the caller) is filled with the list of PUs which the thread was last bound to.</p>
<p>The behavior is exactly the same as the Linux sched_getaffinity system call, but uses a hwloc cpuset.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This is equivalent to calling <a class="el" href="a00170.html#gac82de91f788fa82dacf99c6e0d4b7158" title="Get the current physical binding of process pid.">hwloc_get_proc_cpubind()</a> with <a class="el" href="a00170.html#gga217dc8d373f8958cc93c154ebce1c71caf1b6bbad00d7b1017b918e3719f4d421" title="Bind current thread of current process.">HWLOC_CPUBIND_THREAD</a> as flags. </dd></dl>

</div>
</div>
<a id="gacc7945c2d06c6db1e58f8fd953009134" name="gacc7945c2d06c6db1e58f8fd953009134"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacc7945c2d06c6db1e58f8fd953009134">&#9670;&#160;</a></span>hwloc_linux_get_tid_last_cpu_location()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_linux_get_tid_last_cpu_location </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a>&#160;</td>
          <td class="paramname"><em>topology</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">pid_t&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00185.html#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a>&#160;</td>
          <td class="paramname"><em>set</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the last physical CPU where thread <code>tid</code> ran. </p>
<p>The CPU-set <code>set</code> (previously allocated by the caller) is filled with the PU which the thread last ran on.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This is equivalent to calling <a class="el" href="a00170.html#ga910a05c2d47f68a3155bf176b50fa555" title="Get the last physical CPU where a process ran.">hwloc_get_proc_last_cpu_location()</a> with <a class="el" href="a00170.html#gga217dc8d373f8958cc93c154ebce1c71caf1b6bbad00d7b1017b918e3719f4d421" title="Bind current thread of current process.">HWLOC_CPUBIND_THREAD</a> as flags. </dd></dl>

</div>
</div>
<a id="gaf72d83e273803226ce772973e37b85de" name="gaf72d83e273803226ce772973e37b85de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf72d83e273803226ce772973e37b85de">&#9670;&#160;</a></span>hwloc_linux_read_path_as_cpumask()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_linux_read_path_as_cpumask </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00185.html#gaa3c2bf4c776d603dcebbb61b0c923d84">hwloc_bitmap_t</a>&#160;</td>
          <td class="paramname"><em>set</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Convert a linux kernel cpumask file <code>path</code> into a hwloc bitmap <code>set</code>. </p>
<p>Might be used when reading CPU set from sysfs attributes such as topology and caches for processors, or local_cpus for devices.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function ignores the HWLOC_FSROOT environment variable. </dd></dl>

</div>
</div>
<a id="ga630e699c56b5f3d2e534b475944c216e" name="ga630e699c56b5f3d2e534b475944c216e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga630e699c56b5f3d2e534b475944c216e">&#9670;&#160;</a></span>hwloc_linux_set_tid_cpubind()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_linux_set_tid_cpubind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00166.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a>&#160;</td>
          <td class="paramname"><em>topology</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">pid_t&#160;</td>
          <td class="paramname"><em>tid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00163.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a>&#160;</td>
          <td class="paramname"><em>set</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bind a thread <code>tid</code> on cpus given in cpuset <code>set</code>. </p>
<p>The behavior is exactly the same as the Linux sched_setaffinity system call, but uses a hwloc cpuset.</p>
<dl class="section return"><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This is equivalent to calling <a class="el" href="a00170.html#ga296db8a3c6d49b51fb83d6f3e45c02a6" title="Bind a process pid on CPUs given in physical bitmap set.">hwloc_set_proc_cpubind()</a> with HWLOC_CPUBIND_THREAD as flags. </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>