HWLOCALITY_HELPER_ANCESTORS(3)
π NAME
hwlocality_helper_ancestors β Looking at Ancestor and Child Objects. This is the hwlocality...r_ancestors(3) page from the Library Functions Manual, bestie, and it's all about peeking at ancestors, common parents, subtrees, and next children. π¦
β¨ SYNOPSIS
Functions
hwloc_obj_t hwloc_get_ancestor_obj_by_depth (hwloc_topology_t topology,
int depth, hwloc_obj_t obj)
hwloc_obj_t hwloc_get_ancestor_obj_by_type (hwloc_topology_t topology,
hwloc_obj_type_t type, hwloc_obj_t obj)
hwloc_obj_t hwloc_get_common_ancestor_obj (hwloc_topology_t topology,
hwloc_obj_t obj1, hwloc_obj_t obj2)
int hwloc_obj_is_in_subtree (hwloc_topology_t topology, hwloc_obj_t obj,
hwloc_obj_t subtree_root)
hwloc_obj_t hwloc_get_next_child (hwloc_topology_t topology, hwloc_obj_t
parent, hwloc_obj_t prev)
π¦ Detailed Description
Bestie, do not skip the figure in Terms and Definitions β it shows a complete topology tree, including depths, child/sibling/cousin relationships, and an example of an asymmetric topology where one package has fewer caches than its peers. It's literally giving full map energy. π
π₯ Function Documentation
π hwloc_get_ancestor_obj_by_depth [inline]
hwloc_obj_t hwloc_get_ancestor_obj_by_depth (hwloc_topology_t topology, int
depth, hwloc_obj_t obj)
Returns the ancestor object of obj at depth depth. Basically: "who's your ancestor at this level, bestie?" π
Returns
- the ancestor if any.
NULLif no such ancestor exists.
Note: depth should not be the depth of PU or NUMA objects since they are ancestors of no objects (except Misc or I/O). This function rather expects an intermediate level depth, such as the depth of Packages, Cores, or Caches. So like, don't come for PU/NUMA depth with this one, okay? π
π hwloc_get_ancestor_obj_by_type [inline]
hwloc_obj_t hwloc_get_ancestor_obj_by_type (hwloc_topology_t topology,
hwloc_obj_type_t type, hwloc_obj_t obj)
Returns the ancestor object of obj with type type. Same ancestor hunt, but you're matching by type instead of depth. β¨
Returns
- the ancestor if any.
NULLif no such ancestor exists.
Note: if multiple matching ancestors exist (e.g. multiple levels ofHWLOC_OBJ_GROUP) the lowest one is returned. Also,typeshould not beHWLOC_OBJ_PUorHWLOC_OBJ_NUMANODEsince these objects are ancestors of no objects (except Misc or I/O). This function rather expects an intermediate object type, such asHWLOC_OBJ_PACKAGE,HWLOC_OBJ_CORE, etc. Lowkey important, fr fr. π«Ά
πΈ hwloc_get_common_ancestor_obj [inline]
hwloc_obj_t hwloc_get_common_ancestor_obj (hwloc_topology_t topology,
hwloc_obj_t obj1, hwloc_obj_t obj2)
Returns the common parent object to objects obj1 and obj2. It's giving "find the shared ancestor so these two can link up" energy. π§
Returns
- the common ancestor.
Note: This function cannot return NULL. It's just not that kind of function, bestie. π
π hwloc_get_next_child [inline]
hwloc_obj_t hwloc_get_next_child (hwloc_topology_t topology, hwloc_obj_t
parent, hwloc_obj_t prev)
Return the next child. Return the next child among the normal children list, then among the memory children list, then among the I/O children list, then among the Misc children list. So the order is: normal β‘οΈ memory β‘οΈ I/O β‘οΈ Misc. Slay. π
Returns
- the first child if
previsNULL. - the next child if
previs notNULL. NULLwhen there is no next child.
β hwloc_obj_is_in_subtree [inline]
int hwloc_obj_is_in_subtree (hwloc_topology_t topology, hwloc_obj_t obj,
hwloc_obj_t subtree_root)
Returns true if obj is inside the subtree beginning with ancestor object subtree_root. Like, "is this object in that subtree? vibe check." π¦
Returns
1if the object is in the subtree,0otherwise.
Note: This function cannot work ifobjandsubtree_rootobjects do not have CPU sets (I/O or Misc objects). No CPU sets, no subtree check β that's the tea. β
π Author
Author: Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code.
π Footer sign-off: Hardware Locality (hwloc), Version 2.15.0, hwlocality...r_ancestors(3) β and there's no date listed on this page, so no invented date, bestie. That's the Library Functions Manual tea, periodt. π
π¦ 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