File: a00080.html

package info (click to toggle)
hwloc-contrib 1.10.0-1
  • links: PTS, VCS
  • area: contrib
  • in suites: jessie, jessie-kfreebsd
  • size: 15,604 kB
  • ctags: 6,628
  • sloc: ansic: 34,014; sh: 12,810; xml: 8,466; makefile: 1,614; sed: 9; php: 8
file content (468 lines) | stat: -rw-r--r-- 27,703 bytes parent folder | download | duplicates (2)
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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.8.8"/>
<title>Hardware Locality (hwloc): CPU binding</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 style="padding-left: 0.5em;">
   <div id="projectname">Hardware Locality (hwloc)
   &#160;<span id="projectnumber">1.10.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">CPU binding</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:ga217dc8d373f8958cc93c154ebce1c71c"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#ga217dc8d373f8958cc93c154ebce1c71c">hwloc_cpubind_flags_t</a> { <a class="el" href="a00080.html#gga217dc8d373f8958cc93c154ebce1c71ca2e0dd0128dac6b03408c7dd170477fdc">HWLOC_CPUBIND_PROCESS</a>, 
<a class="el" href="a00080.html#gga217dc8d373f8958cc93c154ebce1c71caf1b6bbad00d7b1017b918e3719f4d421">HWLOC_CPUBIND_THREAD</a>, 
<a class="el" href="a00080.html#gga217dc8d373f8958cc93c154ebce1c71ca679a7e0f0c7ee06b123565f90d98e7fa">HWLOC_CPUBIND_STRICT</a>, 
<a class="el" href="a00080.html#gga217dc8d373f8958cc93c154ebce1c71ca41ce440443cc3087caed95ab60edcad6">HWLOC_CPUBIND_NOMEMBIND</a>
 }</td></tr>
<tr class="separator:ga217dc8d373f8958cc93c154ebce1c71c"><td class="memSeparator" colspan="2">&#160;</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:ga80bc07473a8edf840cae17bd7ec21d48"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#ga80bc07473a8edf840cae17bd7ec21d48">hwloc_set_cpubind</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00073.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a> set, int flags)</td></tr>
<tr class="separator:ga80bc07473a8edf840cae17bd7ec21d48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacba7ecb979baf824d5240fa2cb2a8be6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#gacba7ecb979baf824d5240fa2cb2a8be6">hwloc_get_cpubind</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00073.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> set, int flags)</td></tr>
<tr class="separator:gacba7ecb979baf824d5240fa2cb2a8be6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga296db8a3c6d49b51fb83d6f3e45c02a6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#ga296db8a3c6d49b51fb83d6f3e45c02a6">hwloc_set_proc_cpubind</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, hwloc_pid_t pid, <a class="el" href="a00073.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a> set, int flags)</td></tr>
<tr class="separator:ga296db8a3c6d49b51fb83d6f3e45c02a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac82de91f788fa82dacf99c6e0d4b7158"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#gac82de91f788fa82dacf99c6e0d4b7158">hwloc_get_proc_cpubind</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, hwloc_pid_t pid, <a class="el" href="a00073.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> set, int flags)</td></tr>
<tr class="separator:gac82de91f788fa82dacf99c6e0d4b7158"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae42c01b2addcfbf6048b9a516dd7a906"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#gae42c01b2addcfbf6048b9a516dd7a906">hwloc_set_thread_cpubind</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, hwloc_thread_t thread, <a class="el" href="a00073.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a> set, int flags)</td></tr>
<tr class="separator:gae42c01b2addcfbf6048b9a516dd7a906"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf13f765642b5d0d9a9813e6bb043671b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#gaf13f765642b5d0d9a9813e6bb043671b">hwloc_get_thread_cpubind</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, hwloc_thread_t thread, <a class="el" href="a00073.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> set, int flags)</td></tr>
<tr class="separator:gaf13f765642b5d0d9a9813e6bb043671b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafdb374627358bf09203b5a4215b13032"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#gafdb374627358bf09203b5a4215b13032">hwloc_get_last_cpu_location</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, <a class="el" href="a00073.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> set, int flags)</td></tr>
<tr class="separator:gafdb374627358bf09203b5a4215b13032"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga910a05c2d47f68a3155bf176b50fa555"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00080.html#ga910a05c2d47f68a3155bf176b50fa555">hwloc_get_proc_last_cpu_location</a> (<a class="el" href="a00076.html#ga9d1e76ee15a7dee158b786c30b6a6e38">hwloc_topology_t</a> topology, hwloc_pid_t pid, <a class="el" href="a00073.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a> set, int flags)</td></tr>
<tr class="separator:ga910a05c2d47f68a3155bf176b50fa555"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>It is often useful to call <a class="el" href="a00096.html#ga36d802130aa5d96bc1b5a90d2f0f3765" title="Keep a single index among those set in bitmap bitmap. ">hwloc_bitmap_singlify()</a> first so that a single CPU remains in the set. This way, the process will not even migrate between different CPUs inside the given set. Some operating systems also only support that kind of binding.</p>
<p>Some operating systems do not provide all hwloc-supported mechanisms to bind processes, threads, etc. <a class="el" href="a00077.html#gab8c76173c4a8ce1a9a9366012b1388e6" title="Retrieve the topology support. ">hwloc_topology_get_support()</a> may be used to query about the actual CPU binding support in the currently used operating system.</p>
<p>When the requested binding operation is not available and the <a class="el" href="a00080.html#gga217dc8d373f8958cc93c154ebce1c71ca679a7e0f0c7ee06b123565f90d98e7fa" title="Request for strict binding from the OS. ">HWLOC_CPUBIND_STRICT</a> flag was passed, the function returns -1. <code>errno</code> is set to <code>ENOSYS</code> when it is not possible to bind the requested kind of object processes/threads. errno is set to <code>EXDEV</code> when the requested cpuset can not be enforced (e.g. some systems only allow one CPU, and some other systems only allow one NUMA node).</p>
<p>If <a class="el" href="a00080.html#gga217dc8d373f8958cc93c154ebce1c71ca679a7e0f0c7ee06b123565f90d98e7fa" title="Request for strict binding from the OS. ">HWLOC_CPUBIND_STRICT</a> was not passed, the function may fail as well, or the operating system may use a slightly different operation (with side-effects, smaller binding set, etc.) when the requested operation is not exactly supported.</p>
<p>The most portable version that should be preferred over the others, whenever possible, is the following one which just binds the current program, assuming it is single-threaded:</p>
<div class="fragment"><div class="line"><a class="code" href="a00080.html#ga80bc07473a8edf840cae17bd7ec21d48">hwloc_set_cpubind</a>(topology, set, 0),</div>
</div><!-- fragment --><p>If the program may be multithreaded, the following one should be preferred to only bind the current thread:</p>
<div class="fragment"><div class="line"><a class="code" href="a00080.html#ga80bc07473a8edf840cae17bd7ec21d48">hwloc_set_cpubind</a>(topology, set, <a class="code" href="a00080.html#gga217dc8d373f8958cc93c154ebce1c71caf1b6bbad00d7b1017b918e3719f4d421">HWLOC_CPUBIND_THREAD</a>),</div>
</div><!-- fragment --><dl class="section see"><dt>See also</dt><dd>Some example codes are available under doc/examples/ in the source tree.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>To unbind, just call the binding function with either a full cpuset or a cpuset equal to the system cpuset.</dd>
<dd>
On some operating systems, CPU binding may have effects on memory binding, see <a class="el" href="a00080.html#gga217dc8d373f8958cc93c154ebce1c71ca41ce440443cc3087caed95ab60edcad6" title="Avoid any effect on memory binding. ">HWLOC_CPUBIND_NOMEMBIND</a></dd>
<dd>
Running lstopo &ndash;top or hwloc-ps can be a very convenient tool to check how binding actually happened. </dd></dl>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="ga217dc8d373f8958cc93c154ebce1c71c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="a00080.html#ga217dc8d373f8958cc93c154ebce1c71c">hwloc_cpubind_flags_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Process/Thread binding flags. </p>
<p>These bit flags can be used to refine the binding policy.</p>
<p>The default (0) is to bind the current process, assumed to be single-threaded, in a non-strict way. This is the most portable way to bind as all operating systems usually provide it.</p>
<dl class="section note"><dt>Note</dt><dd>Not all systems support all kinds of binding. See the "Detailed Description" section of <a class="el" href="a00080.html">CPU binding</a> for a description of errors that can occur. </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="gga217dc8d373f8958cc93c154ebce1c71ca2e0dd0128dac6b03408c7dd170477fdc"></a>HWLOC_CPUBIND_PROCESS&#160;</td><td class="fielddoc">
<p>Bind all threads of the current (possibly) multithreaded process. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga217dc8d373f8958cc93c154ebce1c71caf1b6bbad00d7b1017b918e3719f4d421"></a>HWLOC_CPUBIND_THREAD&#160;</td><td class="fielddoc">
<p>Bind current thread of current process. </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga217dc8d373f8958cc93c154ebce1c71ca679a7e0f0c7ee06b123565f90d98e7fa"></a>HWLOC_CPUBIND_STRICT&#160;</td><td class="fielddoc">
<p>Request for strict binding from the OS. </p>
<p>By default, when the designated CPUs are all busy while other CPUs are idle, operating systems may execute the thread/process on those other CPUs instead of the designated CPUs, to let them progress anyway. Strict binding means that the thread/process will _never_ execute on other cpus than the designated CPUs, even when those are busy with other tasks and other CPUs are idle.</p>
<dl class="section note"><dt>Note</dt><dd>Depending on the operating system, strict binding may not be possible (e.g., the OS does not implement it) or not allowed (e.g., for an administrative reasons), and the function will fail in that case.</dd></dl>
<p>When retrieving the binding of a process, this flag checks whether all its threads actually have the same binding. If the flag is not given, the binding of each thread will be accumulated.</p>
<dl class="section note"><dt>Note</dt><dd>This flag is meaningless when retrieving the binding of a thread. </dd></dl>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga217dc8d373f8958cc93c154ebce1c71ca41ce440443cc3087caed95ab60edcad6"></a>HWLOC_CPUBIND_NOMEMBIND&#160;</td><td class="fielddoc">
<p>Avoid any effect on memory binding. </p>
<p>On some operating systems, some CPU binding function would also bind the memory on the corresponding NUMA node. It is often not a problem for the application, but if it is, setting this flag will make hwloc avoid using OS functions that would also bind memory. This will however reduce the support of CPU bindings, i.e. potentially return -1 with errno set to ENOSYS in some cases.</p>
<p>This flag is only meaningful when used with functions that set the CPU binding. It is ignored when used with functions that get CPU binding information. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gacba7ecb979baf824d5240fa2cb2a8be6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_get_cpubind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00076.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"><a class="el" href="a00073.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a>&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get current process or thread binding. </p>
<p>Writes into <code>set</code> the physical cpuset which the process or thread (according to <em>flags</em>) was last bound to. </p>

</div>
</div>
<a class="anchor" id="gafdb374627358bf09203b5a4215b13032"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_get_last_cpu_location </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00076.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"><a class="el" href="a00073.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a>&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</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 the current process or thread ran. </p>
<p>The operating system may move some tasks from one processor to another at any time according to their binding, so this function may return something that is already outdated.</p>
<p><code>flags</code> can include either HWLOC_CPUBIND_PROCESS or HWLOC_CPUBIND_THREAD to specify whether the query should be for the whole process (union of all CPUs on which all threads are running), or only the current thread. If the process is single-threaded, flags can be set to zero to let hwloc use whichever method is available on the underlying OS. </p>

</div>
</div>
<a class="anchor" id="gac82de91f788fa82dacf99c6e0d4b7158"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_get_proc_cpubind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00076.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">hwloc_pid_t&#160;</td>
          <td class="paramname"><em>pid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00073.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a>&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the current physical binding of process <code>pid</code>. </p>
<dl class="section note"><dt>Note</dt><dd><code>hwloc_pid_t</code> is <code>pid_t</code> on Unix platforms, and <code>HANDLE</code> on native Windows platforms.</dd>
<dd>
As a special case on Linux, if a tid (thread ID) is supplied instead of a pid (process ID) and HWLOC_CPUBIND_THREAD is passed in flags, the binding for that specific thread is returned.</dd>
<dd>
On non-Linux systems, HWLOC_CPUBIND_THREAD can not be used in <code>flags</code>. </dd></dl>

</div>
</div>
<a class="anchor" id="ga910a05c2d47f68a3155bf176b50fa555"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_get_proc_last_cpu_location </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00076.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">hwloc_pid_t&#160;</td>
          <td class="paramname"><em>pid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00073.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a>&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</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 a process ran. </p>
<p>The operating system may move some tasks from one processor to another at any time according to their binding, so this function may return something that is already outdated.</p>
<dl class="section note"><dt>Note</dt><dd><code>hwloc_pid_t</code> is <code>pid_t</code> on Unix platforms, and <code>HANDLE</code> on native Windows platforms.</dd>
<dd>
As a special case on Linux, if a tid (thread ID) is supplied instead of a pid (process ID) and HWLOC_CPUBIND_THREAD is passed in flags, the last CPU location of that specific thread is returned.</dd>
<dd>
On non-Linux systems, HWLOC_CPUBIND_THREAD can not be used in <code>flags</code>. </dd></dl>

</div>
</div>
<a class="anchor" id="gaf13f765642b5d0d9a9813e6bb043671b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_get_thread_cpubind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00076.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">hwloc_thread_t&#160;</td>
          <td class="paramname"><em>thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00073.html#ga4bbf39b68b6f568fb92739e7c0ea7801">hwloc_cpuset_t</a>&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the current physical binding of thread <code>tid</code>. </p>
<dl class="section note"><dt>Note</dt><dd><code>hwloc_thread_t</code> is <code>pthread_t</code> on Unix platforms, and <code>HANDLE</code> on native Windows platforms.</dd>
<dd>
HWLOC_CPUBIND_PROCESS can not be used in <code>flags</code>. </dd></dl>

</div>
</div>
<a class="anchor" id="ga80bc07473a8edf840cae17bd7ec21d48"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_set_cpubind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00076.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"><a class="el" href="a00073.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a>&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bind current process or thread on cpus given in physical bitmap <code>set</code>. </p>
<dl class="section return"><dt>Returns</dt><dd>-1 with errno set to ENOSYS if the action is not supported </dd>
<dd>
-1 with errno set to EXDEV if the binding cannot be enforced </dd></dl>

</div>
</div>
<a class="anchor" id="ga296db8a3c6d49b51fb83d6f3e45c02a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_set_proc_cpubind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00076.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">hwloc_pid_t&#160;</td>
          <td class="paramname"><em>pid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00073.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a>&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bind a process <code>pid</code> on cpus given in physical bitmap <code>set</code>. </p>
<dl class="section note"><dt>Note</dt><dd><code>hwloc_pid_t</code> is <code>pid_t</code> on Unix platforms, and <code>HANDLE</code> on native Windows platforms.</dd>
<dd>
As a special case on Linux, if a tid (thread ID) is supplied instead of a pid (process ID) and HWLOC_CPUBIND_THREAD is passed in flags, the binding is applied to that specific thread.</dd>
<dd>
On non-Linux systems, HWLOC_CPUBIND_THREAD can not be used in <code>flags</code>. </dd></dl>

</div>
</div>
<a class="anchor" id="gae42c01b2addcfbf6048b9a516dd7a906"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int hwloc_set_thread_cpubind </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00076.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">hwloc_thread_t&#160;</td>
          <td class="paramname"><em>thread</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00073.html#ga1f784433e9b606261f62d1134f6a3b25">hwloc_const_cpuset_t</a>&#160;</td>
          <td class="paramname"><em>set</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bind a thread <code>thread</code> on cpus given in physical bitmap <code>set</code>. </p>
<dl class="section note"><dt>Note</dt><dd><code>hwloc_thread_t</code> is <code>pthread_t</code> on Unix platforms, and <code>HANDLE</code> on native Windows platforms.</dd>
<dd>
HWLOC_CPUBIND_PROCESS can not be used in <code>flags</code>. </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Oct 7 2014 11:56:52 for Hardware Locality (hwloc) by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>