hwlocality...distribute(3)
hwlocality...distribute(3) π¦
okay so bestie, welcome to the Library Functions Manual page for hwlocality...distribute(3) β yes, the name is a whole mouthful, but she's giving distributing items over a topology and we're obsessed β¨
β¨ NAME β¨
hwlocality_helper_distribute β literally distributing items over a topology π
periodt.
β¨ SYNOPSIS β¨
Enumerations
enum hwloc_distrib_flags_e { HWLOC_DISTRIB_FLAG_REVERSE }
Functions
int hwloc_distrib (hwloc_topology_t topology, hwloc_obj_t *roots,
unsigned n_roots, hwloc_cpuset_t *set, unsigned n, int until,
unsigned long flags)
β¨ Detailed Description β¨
No extra prose under this one in the original, bestie β we're going straight to the docs π
β¨ Enumeration Type Documentation β¨
enum hwloc_distrib_flags_e
Flags to be given to hwloc_distrib().
Enumerator
HWLOC_DISTRIB_FLAG_REVERSEβ Distrib in reverse order, starting from the last objects.
β¨ Function Documentation β¨
int hwloc_distrib (hwloc_topology_t topology, hwloc_obj_t * roots, unsigned
n_roots, hwloc_cpuset_t * set, unsigned n, int until, unsigned long
flags) [inline]
Distribute n items over the topology under roots β the array set will be filled with n cpusets recursively distributed linearly over the topology under the objects roots, down to depth until (which can be INT_MAX to distribute down to the finest level π«Ά).
n_roots is usually 1 and roots only contains the topology root object so as to distribute over the entire topology β¨.
This is typically useful when an application wants to distribute n threads over a machine, giving each of them as much private cache as possible and keeping them locally in number order β main character scheduling energy π.
The caller may typically want to also call hwloc_bitmap_singlify() before binding a thread so that it does not move at all π
.
flags should be 0 or a OR'ed set of hwloc_distrib_flags_e.
Returns
0 on success, -1 on error.
Note
On hybrid CPUs (or asymmetric platforms), distribution may be suboptimal since the number of cores or PUs inside packages or below caches may vary (the top-down recursive partitioning ignores these numbers until reaching their levels). Hence it is recommended to distribute only inside a single homogeneous domain. For instance on a CPU with energy-efficient E-cores and high-performance P-cores, one should distribute separately N tasks on E-cores and M tasks on P-cores instead of trying to distribute directly M+N tasks on the entire CPUs.
This function requires the roots objects to have a CPU set.
β¨ Author β¨
Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code β iconic, no notes π
okay bestie, that's the whole page π β cute sign-off: this one comes from Hardware Locality (hwloc), Version 2.15.0. The footer doesn't show a date, so we're not inventing one β stay distributed and hydrated! π«Άβ¨
π¦ 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