.TH "hwlocality_helper_ancestors" 3 "Version 2.10.0rc2" "Hardware Locality (hwloc)" \" -*- nroff -*- .ad l .nh .SH NAME hwlocality_helper_ancestors \- Looking at Ancestor and Child Objects .SH SYNOPSIS .br .PP .SS "Functions" .in +1c .ti -1c .RI "static \fBhwloc_obj_t\fP \fBhwloc_get_ancestor_obj_by_depth\fP (\fBhwloc_topology_t\fP topology, int depth, \fBhwloc_obj_t\fP obj)" .br .ti -1c .RI "static \fBhwloc_obj_t\fP \fBhwloc_get_ancestor_obj_by_type\fP (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_type_t\fP type, \fBhwloc_obj_t\fP obj)" .br .ti -1c .RI "static \fBhwloc_obj_t\fP \fBhwloc_get_common_ancestor_obj\fP (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP obj1, \fBhwloc_obj_t\fP obj2)" .br .ti -1c .RI "static int \fBhwloc_obj_is_in_subtree\fP (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP obj, \fBhwloc_obj_t\fP subtree_root)" .br .ti -1c .RI "static \fBhwloc_obj_t\fP \fBhwloc_get_next_child\fP (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP parent, \fBhwloc_obj_t\fP prev)" .br .in -1c .SH "Detailed Description" .PP Be sure to see the figure in \fBTerms and Definitions\fP that 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\&. .SH "Function Documentation" .PP .SS "static \fBhwloc_obj_t\fP hwloc_get_ancestor_obj_by_depth (\fBhwloc_topology_t\fP topology, int depth, \fBhwloc_obj_t\fP obj)\fC [inline]\fP, \fC [static]\fP" .PP Returns the ancestor object of \fCobj\fP at depth \fCdepth\fP\&. .PP \fBReturns\fP .RS 4 the ancestor if any\&. .PP \fCNULL\fP if no such ancestor exists\&. .RE .PP \fBNote\fP .RS 4 \fCdepth\fP 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\&. .RE .PP .SS "static \fBhwloc_obj_t\fP hwloc_get_ancestor_obj_by_type (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_type_t\fP type, \fBhwloc_obj_t\fP obj)\fC [inline]\fP, \fC [static]\fP" .PP Returns the ancestor object of \fCobj\fP with type \fCtype\fP\&. .PP \fBReturns\fP .RS 4 the ancestor if any\&. .PP \fCNULL\fP if no such ancestor exists\&. .RE .PP \fBNote\fP .RS 4 if multiple matching ancestors exist (e\&.g\&. multiple levels of \fBHWLOC_OBJ_GROUP\fP) the lowest one is returned\&. .PP \fCtype\fP should not be \fBHWLOC_OBJ_PU\fP or \fBHWLOC_OBJ_NUMANODE\fP since these objects are ancestors of no objects (except Misc or I/O)\&. This function rather expects an intermediate object type, such as \fBHWLOC_OBJ_PACKAGE\fP, \fBHWLOC_OBJ_CORE\fP, etc\&. .RE .PP .SS "static \fBhwloc_obj_t\fP hwloc_get_common_ancestor_obj (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP obj1, \fBhwloc_obj_t\fP obj2)\fC [inline]\fP, \fC [static]\fP" .PP Returns the common parent object to objects \fCobj1\fP and \fCobj2\fP\&. .PP \fBReturns\fP .RS 4 the common ancestor\&. .RE .PP \fBNote\fP .RS 4 This function cannot return \fCNULL\fP\&. .RE .PP .SS "static \fBhwloc_obj_t\fP hwloc_get_next_child (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP parent, \fBhwloc_obj_t\fP prev)\fC [inline]\fP, \fC [static]\fP" .PP 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\&. .PP \fBReturns\fP .RS 4 the first child if \fCprev\fP is \fCNULL\fP\&. .PP the next child if \fCprev\fP is not \fCNULL\fP\&. .PP \fCNULL\fP when there is no next child\&. .RE .PP .SS "static int hwloc_obj_is_in_subtree (\fBhwloc_topology_t\fP topology, \fBhwloc_obj_t\fP obj, \fBhwloc_obj_t\fP subtree_root)\fC [inline]\fP, \fC [static]\fP" .PP Returns true if \fCobj\fP is inside the subtree beginning with ancestor object \fCsubtree_root\fP\&. .PP \fBReturns\fP .RS 4 1 is the object is in the subtree, 0 otherwise\&. .RE .PP \fBNote\fP .RS 4 This function cannot work if \fCobj\fP and \fCsubtree_root\fP objects do not have CPU sets (I/O or Misc objects)\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code\&.