| 1 |
.TH "hwlocality_linux" 3 "Version 2.14.0" "Hardware Locality (hwloc)" \" -*- nroff -*- |
| 2 |
.ad l |
| 3 |
.nh |
| 4 |
.SH NAME |
| 5 |
hwlocality_linux \- Linux-specific helpers |
| 6 |
.SH SYNOPSIS |
| 7 |
.br |
| 8 |
.PP |
| 9 |
.SS "Functions" |
| 10 |
|
| 11 |
.in +1c |
| 12 |
.ti -1c |
| 13 |
.RI "int \fBhwloc_linux_set_tid_cpubind\fP (\fBhwloc_topology_t\fP topology, pid_t tid, \fBhwloc_const_cpuset_t\fP set)" |
| 14 |
.br |
| 15 |
.ti -1c |
| 16 |
.RI "int \fBhwloc_linux_get_tid_cpubind\fP (\fBhwloc_topology_t\fP topology, pid_t tid, \fBhwloc_cpuset_t\fP set)" |
| 17 |
.br |
| 18 |
.ti -1c |
| 19 |
.RI "int \fBhwloc_linux_get_tid_last_cpu_location\fP (\fBhwloc_topology_t\fP topology, pid_t tid, \fBhwloc_bitmap_t\fP set)" |
| 20 |
.br |
| 21 |
.ti -1c |
| 22 |
.RI "int \fBhwloc_linux_read_path_as_cpumask\fP (const char *path, \fBhwloc_bitmap_t\fP set)" |
| 23 |
.br |
| 24 |
.in -1c |
| 25 |
.SH "Detailed Description" |
| 26 |
.PP |
| 27 |
This includes helpers for manipulating Linux kernel cpumap files, and hwloc equivalents of the Linux sched_setaffinity and sched_getaffinity system calls\&. |
| 28 |
.SH "Function Documentation" |
| 29 |
.PP |
| 30 |
.SS "int hwloc_linux_get_tid_cpubind (\fBhwloc_topology_t\fP topology, pid_t tid, \fBhwloc_cpuset_t\fP set)" |
| 31 |
|
| 32 |
.PP |
| 33 |
Get the current binding of thread \fRtid\fP\&. The CPU-set \fRset\fP (previously allocated by the caller) is filled with the list of PUs which the thread was last bound to\&. |
| 34 |
|
| 35 |
.PP |
| 36 |
The behavior is exactly the same as the Linux sched_getaffinity system call, but uses a hwloc cpuset\&. |
| 37 |
|
| 38 |
.PP |
| 39 |
\fBReturns\fP |
| 40 |
.RS 4 |
| 41 |
0 on success, -1 on error\&. |
| 42 |
.RE |
| 43 |
.PP |
| 44 |
\fBNote\fP |
| 45 |
.RS 4 |
| 46 |
This is equivalent to calling \fBhwloc_get_proc_cpubind()\fP with \fBHWLOC_CPUBIND_THREAD\fP as flags\&. |
| 47 |
.RE |
| 48 |
.PP |
| 49 |
|
| 50 |
.SS "int hwloc_linux_get_tid_last_cpu_location (\fBhwloc_topology_t\fP topology, pid_t tid, \fBhwloc_bitmap_t\fP set)" |
| 51 |
|
| 52 |
.PP |
| 53 |
Get the last physical CPU where thread \fRtid\fP ran\&. The CPU-set \fRset\fP (previously allocated by the caller) is filled with the PU which the thread last ran on\&. |
| 54 |
|
| 55 |
.PP |
| 56 |
\fBReturns\fP |
| 57 |
.RS 4 |
| 58 |
0 on success, -1 on error\&. |
| 59 |
.RE |
| 60 |
.PP |
| 61 |
\fBNote\fP |
| 62 |
.RS 4 |
| 63 |
This is equivalent to calling \fBhwloc_get_proc_last_cpu_location()\fP with \fBHWLOC_CPUBIND_THREAD\fP as flags\&. |
| 64 |
.RE |
| 65 |
.PP |
| 66 |
|
| 67 |
.SS "int hwloc_linux_read_path_as_cpumask (const char * path, \fBhwloc_bitmap_t\fP set)" |
| 68 |
|
| 69 |
.PP |
| 70 |
Convert a linux kernel cpumask file \fRpath\fP into a hwloc bitmap \fRset\fP\&. Might be used when reading CPU set from sysfs attributes such as topology and caches for processors, or local_cpus for devices\&. |
| 71 |
|
| 72 |
.PP |
| 73 |
\fBReturns\fP |
| 74 |
.RS 4 |
| 75 |
0 on success, -1 on error\&. |
| 76 |
.RE |
| 77 |
.PP |
| 78 |
\fBNote\fP |
| 79 |
.RS 4 |
| 80 |
This function ignores the HWLOC_FSROOT environment variable\&. |
| 81 |
.RE |
| 82 |
.PP |
| 83 |
|
| 84 |
.SS "int hwloc_linux_set_tid_cpubind (\fBhwloc_topology_t\fP topology, pid_t tid, \fBhwloc_const_cpuset_t\fP set)" |
| 85 |
|
| 86 |
.PP |
| 87 |
Bind a thread \fRtid\fP on cpus given in cpuset \fRset\fP\&. The behavior is exactly the same as the Linux sched_setaffinity system call, but uses a hwloc cpuset\&. |
| 88 |
|
| 89 |
.PP |
| 90 |
\fBReturns\fP |
| 91 |
.RS 4 |
| 92 |
0 on success, -1 on error\&. |
| 93 |
.RE |
| 94 |
.PP |
| 95 |
\fBNote\fP |
| 96 |
.RS 4 |
| 97 |
This is equivalent to calling \fBhwloc_set_proc_cpubind()\fP with HWLOC_CPUBIND_THREAD as flags\&. |
| 98 |
.RE |
| 99 |
.PP |
| 100 |
|
| 101 |
.SH "Author" |
| 102 |
.PP |
| 103 |
Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&. |