hwlocality_linux(3)
β¨ NAME β¨
hwlocality_linux(3) β Linux-specific helpers π
Bestie, this is the Linux-only corner of hwloc: itβs giving βkernel cpumap files but make it cute,β and itβs here to help. π§β¨
πΈ SYNOPSIS πΈ
π Functions π
int hwloc_linux_set_tid_cpubind (hwloc_topology_t topology, pid_t tid,
hwloc_const_cpuset_t set)
int hwloc_linux_get_tid_cpubind (hwloc_topology_t topology, pid_t tid,
hwloc_cpuset_t set)
int hwloc_linux_get_tid_last_cpu_location (hwloc_topology_t topology,
pid_t tid, hwloc_bitmap_t set)
int hwloc_linux_read_path_as_cpumask (const char *path, hwloc_bitmap_t
set)
π§ Detailed Description π§
Okay so this section is literally: it includes helpers for manipulating Linux kernel cpumap files, plus hwloc equivalents of the Linux sched_setaffinity and sched_getaffinity system calls. Thatβs the whole vibe. π«Ά
π Function Documentation π
π
int hwloc_linux_get_tid_cpubind (hwloc_topology_t topology, pid_t tid, hwloc_cpuset_t set)
This one gets the current binding of thread tid. The CPU-set set β which the caller already allocated, bestie, donβt forget β gets filled with the list of PUs that the thread was last bound to. π§΅β¨
The behavior is exactly the same as the Linux sched_getaffinity system call, except it uses a hwloc cpuset. No cap.
Returns 0 on success, -1 on error.
Note: This is equivalent to callinghwloc_get_proc_cpubind()withHWLOC_CPUBIND_THREADas flags. π
π¦ int hwloc_linux_get_tid_last_cpu_location (hwloc_topology_t topology, pid_t tid, hwloc_bitmap_t set)
This one gets the last physical CPU where thread tid ran. The CPU-set set β again, previously allocated by the caller β is filled with the PU that the thread last ran on. ππ₯
Returns 0 on success, -1 on error.
Note: This is equivalent to callinghwloc_get_proc_last_cpu_location()withHWLOC_CPUBIND_THREADas flags. π«Ά
π int hwloc_linux_read_path_as_cpumask (const char * path, hwloc_bitmap_t set)
Convert a Linux kernel cpumask file path into a hwloc bitmap set. Might be used when reading CPU set from sysfs attributes such as topology and caches for processors, or local_cpus for devices. ποΈβ¨
Returns 0 on success, -1 on error.
Note: This function ignores the HWLOC_FSROOT environment variable. Lowkey important, highkey iconic. π
π int hwloc_linux_set_tid_cpubind (hwloc_topology_t topology, pid_t tid, hwloc_const_cpuset_t set)
Bind a thread tid on CPUs given in cpuset set. The behavior is exactly the same as the Linux sched_setaffinity system call, but it uses a hwloc cpuset. π
π₯
Returns 0 on success, -1 on error.
Note: This is equivalent to callinghwloc_set_proc_cpubind()withHWLOC_CPUBIND_THREADas flags. π
π Author π
Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code. So yes, the robots wrote this one, but weβre giving it main character energy anyway. π€π
π Cute sign-off: Hardware Locality (hwloc) Β· Version 2.15.0 Β· hwlocality_linux(3) β the footer date isnβt listed on this one, bestie, but the source and version are absolutely serving. π«Άβ¨
π¦ where this page comes from
- arch rolling: hwloc 2.15.0-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms