hwlocality_linux.3 3.0 KB

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