OpenMPI  0.1.1
helper.h File Reference

High-level hwloc traversal helpers. More...

#include <stdlib.h>
#include <errno.h>

Go to the source code of this file.

Functions

static __hwloc_inline int
__hwloc_attribute_pure 
hwloc_get_type_or_below_depth (hwloc_topology_t topology, hwloc_obj_type_t type)
 Returns the depth of objects of type type or below. More...
 
static __hwloc_inline int
__hwloc_attribute_pure 
hwloc_get_type_or_above_depth (hwloc_topology_t topology, hwloc_obj_type_t type)
 Returns the depth of objects of type type or above. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_root_obj (hwloc_topology_t topology)
 Returns the top-object of the topology-tree. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_ancestor_obj_by_depth (hwloc_topology_t topology __hwloc_attribute_unused, unsigned depth, hwloc_obj_t obj)
 Returns the ancestor object of obj at depth depth. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_ancestor_obj_by_type (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_type_t type, hwloc_obj_t obj)
 Returns the ancestor object of obj with type type. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_next_obj_by_depth (hwloc_topology_t topology, unsigned depth, hwloc_obj_t prev)
 Returns the next object at depth depth. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_next_obj_by_type (hwloc_topology_t topology, hwloc_obj_type_t type, hwloc_obj_t prev)
 Returns the next object of type type. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_pu_obj_by_os_index (hwloc_topology_t topology, unsigned os_index)
 Returns the object of type HWLOC_OBJ_PU with os_index. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_next_child (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t parent, hwloc_obj_t prev)
 Return the next child. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_common_ancestor_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj1, hwloc_obj_t obj2)
 Returns the common parent object to objects lvl1 and lvl2.
 
static __hwloc_inline int
__hwloc_attribute_pure 
hwloc_obj_is_in_subtree (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj, hwloc_obj_t subtree_root)
 Returns true if obj is inside the subtree beginning with subtree_root. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_first_largest_obj_inside_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set)
 Get the first largest object included in the given cpuset set. More...
 
HWLOC_DECLSPEC int hwloc_get_largest_objs_inside_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_t *__hwloc_restrict objs, int max)
 Get the set of largest objects covering exactly a given cpuset set. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, unsigned depth, hwloc_obj_t prev)
 Return the next object at depth depth included in CPU set set. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_next_obj_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev)
 Return the next object of type type included in CPU set set. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_obj_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, unsigned depth, unsigned idx)
 Return the (logically) idx -th object at depth depth included in CPU set set.
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_obj_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, unsigned idx)
 Return the idx -th object of type type included in CPU set set. More...
 
static __hwloc_inline unsigned
__hwloc_attribute_pure 
hwloc_get_nbobjs_inside_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, unsigned depth)
 Return the number of objects at depth depth included in CPU set set. More...
 
static __hwloc_inline int
__hwloc_attribute_pure 
hwloc_get_nbobjs_inside_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type)
 Return the number of objects of type type included in CPU set set. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_child_covering_cpuset (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_const_cpuset_t set, hwloc_obj_t parent)
 Get the child covering at least CPU set set. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_obj_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set)
 Get the lowest object covering at least CPU set set. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_depth (hwloc_topology_t topology, hwloc_const_cpuset_t set, unsigned depth, hwloc_obj_t prev)
 Iterate through same-depth objects covering at least CPU set set. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_next_obj_covering_cpuset_by_type (hwloc_topology_t topology, hwloc_const_cpuset_t set, hwloc_obj_type_t type, hwloc_obj_t prev)
 Iterate through same-type objects covering at least CPU set set. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_cache_covering_cpuset (hwloc_topology_t topology, hwloc_const_cpuset_t set)
 Get the first cache covering a cpuset set. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_shared_cache_covering_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t obj)
 Get the first cache shared between an object and somebody else. More...
 
HWLOC_DECLSPEC unsigned hwloc_get_closest_objs (hwloc_topology_t topology, hwloc_obj_t src, hwloc_obj_t *__hwloc_restrict objs, unsigned max)
 Do a depth-first traversal of the topology to find and sort. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_obj_below_by_type (hwloc_topology_t topology, hwloc_obj_type_t type1, unsigned idx1, hwloc_obj_type_t type2, unsigned idx2)
 Find an object below another object, both specified by types and indexes. More...
 
static __hwloc_inline
hwloc_obj_t
__hwloc_attribute_pure 
hwloc_get_obj_below_array_by_type (hwloc_topology_t topology, int nr, hwloc_obj_type_t *typev, unsigned *idxv)
 Find an object below a chain of objects specified by types and indexes. More...
 
static __hwloc_inline void hwloc_distributev (hwloc_topology_t topology, hwloc_obj_t *root, unsigned n_roots, hwloc_cpuset_t *cpuset, unsigned n, unsigned until)
 Distribute n items over the topology under root. More...
 
static __hwloc_inline void hwloc_distribute (hwloc_topology_t topology, hwloc_obj_t root, hwloc_cpuset_t *cpuset, unsigned n, unsigned until)
 
static __hwloc_inline void * hwloc_alloc_membind_policy_nodeset (hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
 Allocate some memory on the given nodeset nodeset. More...
 
static __hwloc_inline void * hwloc_alloc_membind_policy (hwloc_topology_t topology, size_t len, hwloc_const_cpuset_t cpuset, hwloc_membind_policy_t policy, int flags)
 Allocate some memory on the memory nodes near given cpuset cpuset. More...
 
static __hwloc_inline
hwloc_const_cpuset_t
__hwloc_attribute_pure 
hwloc_topology_get_complete_cpuset (hwloc_topology_t topology)
 Get complete CPU set. More...
 
static __hwloc_inline
hwloc_const_cpuset_t
__hwloc_attribute_pure 
hwloc_topology_get_topology_cpuset (hwloc_topology_t topology)
 Get topology CPU set. More...
 
static __hwloc_inline
hwloc_const_cpuset_t
__hwloc_attribute_pure 
hwloc_topology_get_online_cpuset (hwloc_topology_t topology)
 Get online CPU set. More...
 
static __hwloc_inline
hwloc_const_cpuset_t
__hwloc_attribute_pure 
hwloc_topology_get_allowed_cpuset (hwloc_topology_t topology)
 Get allowed CPU set. More...
 
static __hwloc_inline
hwloc_const_nodeset_t
__hwloc_attribute_pure 
hwloc_topology_get_complete_nodeset (hwloc_topology_t topology)
 Get complete node set. More...
 
static __hwloc_inline
hwloc_const_nodeset_t
__hwloc_attribute_pure 
hwloc_topology_get_topology_nodeset (hwloc_topology_t topology)
 Get topology node set. More...
 
static __hwloc_inline
hwloc_const_nodeset_t
__hwloc_attribute_pure 
hwloc_topology_get_allowed_nodeset (hwloc_topology_t topology)
 Get allowed node set. More...
 
static __hwloc_inline void hwloc_cpuset_to_nodeset (hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, hwloc_nodeset_t nodeset)
 Convert a CPU set into a NUMA node set and handle non-NUMA cases. More...
 
static __hwloc_inline void hwloc_cpuset_to_nodeset_strict (struct hwloc_topology *topology, hwloc_const_cpuset_t cpuset, hwloc_nodeset_t nodeset)
 Convert a CPU set into a NUMA node set without handling non-NUMA cases. More...
 
static __hwloc_inline void hwloc_cpuset_from_nodeset (hwloc_topology_t topology, hwloc_cpuset_t cpuset, hwloc_const_nodeset_t nodeset)
 Convert a NUMA node set into a CPU set and handle non-NUMA cases. More...
 
static __hwloc_inline void hwloc_cpuset_from_nodeset_strict (struct hwloc_topology *topology, hwloc_cpuset_t cpuset, hwloc_const_nodeset_t nodeset)
 Convert a NUMA node set into a CPU set without handling non-NUMA cases. More...
 
static __hwloc_inline const
struct hwloc_distances_s
hwloc_get_whole_distance_matrix_by_depth (hwloc_topology_t topology, unsigned depth)
 Get the distances between all objects at the given depth. More...
 
static __hwloc_inline const
struct hwloc_distances_s
hwloc_get_whole_distance_matrix_by_type (hwloc_topology_t topology, hwloc_obj_type_t type)
 Get the distances between all objects of a given type. More...
 
static __hwloc_inline const
struct hwloc_distances_s
hwloc_get_distance_matrix_covering_obj_by_depth (hwloc_topology_t topology, hwloc_obj_t obj, unsigned depth, unsigned *firstp)
 Get distances for the given depth and covering some objects. More...
 
static __hwloc_inline int hwloc_get_latency (hwloc_topology_t topology, hwloc_obj_t obj1, hwloc_obj_t obj2, float *latency, float *reverse_latency)
 Get the latency in both directions between two objects. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_non_io_ancestor_obj (hwloc_topology_t topology __hwloc_attribute_unused, hwloc_obj_t ioobj)
 Get the first non-I/O ancestor object. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_next_pcidev (hwloc_topology_t topology, hwloc_obj_t prev)
 Get the next PCI device in the system. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_pcidev_by_busid (hwloc_topology_t topology, unsigned domain, unsigned bus, unsigned dev, unsigned func)
 Find the PCI device object matching the PCI bus id given domain, bus device and function PCI bus id.
 
static __hwloc_inline hwloc_obj_t hwloc_get_pcidev_by_busidstring (hwloc_topology_t topology, const char *busid)
 Find the PCI device object matching the PCI bus id given as a string xxxx:yy:zz.t or yy:zz.t.
 
static __hwloc_inline hwloc_obj_t hwloc_get_next_osdev (hwloc_topology_t topology, hwloc_obj_t prev)
 Get the next OS device in the system. More...
 
static __hwloc_inline hwloc_obj_t hwloc_get_next_bridge (hwloc_topology_t topology, hwloc_obj_t prev)
 Get the next bridge in the system. More...
 
static __hwloc_inline int hwloc_bridge_covers_pcibus (hwloc_obj_t bridge, unsigned domain, unsigned bus)
 
static __hwloc_inline hwloc_obj_t hwloc_get_hostbridge_by_pcibus (hwloc_topology_t topology, unsigned domain, unsigned bus)
 Find the hostbridge that covers the given PCI bus. More...
 

Detailed Description

High-level hwloc traversal helpers.