hwlocality_glibc_sched(3)

✨ NAME ✨

hwlocality_glibc_sched β€” Interoperability with glibc sched affinity πŸ’–

Hey bestie, welcome to hwlocality_glibc_sched(3) from the Library Functions Manual β€” this is the little corner of hwloc that lets your hwloc cpusets and your glibc sched cpusets speak the same language. 🫢

🌸 SYNOPSIS 🌸

Functions

int hwloc_cpuset_to_glibc_sched_affinity (hwloc_topology_t topology,
    hwloc_const_cpuset_t hwlocset, cpu_set_t *schedset, size_t
    schedsetsize)
int hwloc_cpuset_from_glibc_sched_affinity (hwloc_topology_t topology,
    hwloc_cpuset_t hwlocset, const cpu_set_t *schedset, size_t
    schedsetsize)

πŸ¦‹ DETAILED DESCRIPTION πŸ¦‹

This interface offers ways to convert between hwloc cpusets and glibc cpusets such as those manipulated by sched_getaffinity() or pthread_attr_setaffinity_np(). Literally the bridge between your hwloc world and your glibc sched world, no cap. 🌈

Note: Topology topology must match the current machine. πŸ‘‘

πŸ’… FUNCTION DOCUMENTATION πŸ’…

πŸŽ€ hwloc_cpuset_from_glibc_sched_affinity

int hwloc_cpuset_from_glibc_sched_affinity (hwloc_topology_t topology,
    hwloc_cpuset_t hwlocset, const cpu_set_t * schedset, size_t
    schedsetsize) [inline]

Convert glibc sched affinity CPU set schedset into hwloc CPU set. This function may be used before calling sched_setaffinity or any other function that takes a cpu_set_t as input parameter. It’s giving β€œtranslate the glibc cpuset into hwloc cpuset” energy. 🧚

schedsetsize should be sizeof(cpu_set_t) unless schedset was dynamically allocated with CPU_ALLOC.

Returns

  • 0 on success. ✨
  • -1 with errno set to ENOMEM if some internal reallocation failed. 😭

🧚 hwloc_cpuset_to_glibc_sched_affinity

int hwloc_cpuset_to_glibc_sched_affinity (hwloc_topology_t topology,
    hwloc_const_cpuset_t hwlocset, cpu_set_t * schedset, size_t
    schedsetsize) [inline]

Convert hwloc CPU set toposet into glibc sched affinity CPU set schedset. This function may be used before calling sched_setaffinity or any other function that takes a cpu_set_t as input parameter. Same bestie energy, opposite direction. πŸ’«

schedsetsize should be sizeof(cpu_set_t) unless schedset was dynamically allocated with CPU_ALLOC.

Returns

0. Periodt. πŸ’…

πŸ¦‹ AUTHOR πŸ¦‹

Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code. 🫢


Made with main-character energy from Hardware Locality (hwloc), Version 2.15.0, for the page hwlocality_glibc_sched(3). πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from