13 #ifndef HWLOC_HELPER_H
14 #define HWLOC_HELPER_H
17 #error Please include the main hwloc.h instead
47 static __hwloc_inline
int __hwloc_attribute_pure
73 static __hwloc_inline
int __hwloc_attribute_pure
82 for(depth = 0; ; depth++)
109 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
116 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
120 if (obj->
depth < depth)
122 while (ancestor && ancestor->
depth > depth)
123 ancestor = ancestor->
parent;
128 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
132 while (ancestor && ancestor->
type != type)
133 ancestor = ancestor->
parent;
146 if (prev->
depth != depth)
175 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
194 if (prev->
parent != parent)
200 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
208 while (obj1 != obj2) {
213 if (obj1 != obj2 && obj1->
depth == obj2->
depth) {
225 static __hwloc_inline
int __hwloc_attribute_pure
313 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
315 unsigned depth,
unsigned idx)
337 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
348 static __hwloc_inline
unsigned __hwloc_attribute_pure
369 static __hwloc_inline
int __hwloc_attribute_pure
393 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
415 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
496 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
503 current = current->
parent;
512 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
518 while (current && current->
cpuset) {
522 current = current->
parent;
562 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
591 static __hwloc_inline
hwloc_obj_t __hwloc_attribute_pure
598 for(i=0; i<nr; i++) {
628 static __hwloc_inline
void
630 static __hwloc_inline
void
636 if (!root->
arity || n == 1 || root->
depth >= until) {
651 static __hwloc_inline
void
659 for (i = 0; i < n_roots; i++)
660 if (roots[i]->cpuset)
663 for (i = 0; i < n_roots && tot_weight; i++) {
666 unsigned chunk = (n * weight + tot_weight-1) / tot_weight;
667 hwloc_distribute(topology, roots[i], cpusetp, chunk, until);
669 tot_weight -= weight;
680 static __hwloc_inline
void *
698 static __hwloc_inline
void *
863 static __hwloc_inline
void
891 static __hwloc_inline
void
912 static __hwloc_inline
void
943 static __hwloc_inline
void
990 for(i=0; i<root->distances_count; i++)
1042 while (obj && obj->
cpuset) {
1044 for(i=0; i<obj->distances_count; i++)
1067 static __hwloc_inline
int
1070 float *
latency,
float *reverse_latency)
1074 unsigned first_logical ;
1083 if (distances && distances->
latency) {
1084 const float * latency_matrix = distances->
latency;
1088 *latency = latency_matrix[l1*nbobjs+l2];
1089 *reverse_latency = latency_matrix[l2*nbobjs+l1];
1116 while (obj && !obj->
cpuset) {
1137 unsigned domain,
unsigned bus,
unsigned dev,
unsigned func)
1141 if (obj->
attr->pcidev.domain == domain
1142 && obj->
attr->pcidev.bus == bus
1143 && obj->
attr->pcidev.dev == dev
1144 && obj->
attr->pcidev.func == func)
1156 unsigned domain = 0;
1157 unsigned bus, dev, func;
1159 if (sscanf(busid,
"%x:%x.%x", &bus, &dev, &func) != 3
1160 && sscanf(busid,
"%x:%x:%x.%x", &domain, &bus, &dev, &func) != 4) {
1190 static __hwloc_inline
int
1192 unsigned domain,
unsigned bus)
1196 && bridge->
attr->bridge.downstream.pci.domain == domain
1197 && bridge->
attr->bridge.downstream.pci.secondary_bus <= bus
1198 && bridge->
attr->bridge.downstream.pci.subordinate_bus >= bus;
1208 unsigned domain,
unsigned bus)
1212 if (hwloc_bridge_covers_pcibus(obj, domain, bus)) {
HWLOC_DECLSPEC void hwloc_bitmap_zero(hwloc_bitmap_t bitmap)
Empty the bitmap bitmap.
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.
Definition: helper.h:190
Host-side of a bridge, only possible upstream.
Definition: hwloc.h:257
Data cache.
Definition: hwloc.h:192
unsigned os_index
OS-provided physical index number.
Definition: hwloc.h:332
HWLOC_DECLSPEC int hwloc_bitmap_iszero(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure
Test whether bitmap bitmap is empty.
Distances between objects.
Definition: hwloc.h:522
Operating system device.
Definition: hwloc.h:237
unsigned nbobjs
Number of objects considered in the matrix.
Definition: hwloc.h:525
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.
Definition: helper.h:513
Allocate memory but do not immediately bind it to a specific locality.
Definition: hwloc.h:1482
struct hwloc_obj * next_sibling
Next object below the same parent.
Definition: hwloc.h:353
HWLOC_DECLSPEC hwloc_bitmap_t hwloc_bitmap_dup(hwloc_const_bitmap_t bitmap) __hwloc_attribute_malloc
Duplicate bitmap bitmap by allocating a new bitmap and copying bitmap contents.
hwloc_cpuset_t allowed_cpuset
The CPU set of allowed logical processors.
Definition: hwloc.h:398
static __hwloc_inline hwloc_const_nodeset_t __hwloc_attribute_pure hwloc_topology_get_topology_nodeset(hwloc_topology_t topology)
Get topology node set.
Definition: helper.h:813
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.
Definition: helper.h:986
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.
Definition: helper.h:129
struct hwloc_obj * first_child
First child.
Definition: hwloc.h:359
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...
Definition: helper.h:1136
struct hwloc_obj * parent
Parent, NULL if root (system object)
Definition: hwloc.h:351
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.
Definition: helper.h:416
hwloc_cpuset_t online_cpuset
The CPU set of online logical processors.
Definition: hwloc.h:390
HWLOC_DECLSPEC int hwloc_bitmap_isincluded(hwloc_const_bitmap_t sub_bitmap, hwloc_const_bitmap_t super_bitmap) __hwloc_attribute_pure
Test whether bitmap sub_bitmap is part of bitmap super_bitmap.
hwloc_cpuset_t complete_cpuset
The complete CPU set of logical processors of this object,.
Definition: hwloc.h:379
static __hwloc_inline hwloc_const_nodeset_t __hwloc_attribute_pure hwloc_topology_get_complete_nodeset(hwloc_topology_t topology)
Get complete node set.
Definition: helper.h:797
hwloc_obj_type_t type
Type of object.
Definition: hwloc.h:331
HWLOC_DECLSPEC int hwloc_set_membind_nodeset(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
Set the default memory binding policy of the current process or thread to prefer the NUMA node(s) spe...
Definition: bind.c:260
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.
Definition: helper.h:370
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.
Definition: helper.h:1038
Bridge.
Definition: hwloc.h:225
hwloc_nodeset_t nodeset
NUMA nodes covered by this object or containing this object.
Definition: hwloc.h:409
HWLOC_DECLSPEC int hwloc_bitmap_isset(hwloc_const_bitmap_t bitmap, unsigned id) __hwloc_attribute_pure
Test whether index id is part of bitmap bitmap.
static __hwloc_inline hwloc_const_cpuset_t __hwloc_attribute_pure hwloc_topology_get_complete_cpuset(hwloc_topology_t topology)
Get complete CPU set.
Definition: helper.h:729
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.
Definition: helper.h:1127
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.
Definition: helper.h:944
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.
Definition: helper.h:302
HWLOC_DECLSPEC int hwloc_compare_types(hwloc_obj_type_t type1, hwloc_obj_type_t type2) __hwloc_attribute_const
Compare the depth of two object types.
Definition: topology.c:384
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.
Definition: helper.h:394
struct hwloc_obj ** children
Children, children[0 .
Definition: hwloc.h:358
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.
Definition: helper.h:475
Structure of a topology object.
Definition: hwloc.h:329
struct hwloc_obj * next_cousin
Next object of same type and depth.
Definition: hwloc.h:347
float * latency
Matrix of latencies between objects, stored as a one-dimension array.
Definition: hwloc.h:530
unsigned relative_depth
Relative depth of the considered objects below the object containing this distance information...
Definition: hwloc.h:523
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.
Definition: helper.h:349
HWLOC_DECLSPEC void * hwloc_alloc_membind(hwloc_topology_t topology, size_t len, hwloc_const_cpuset_t cpuset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc
Allocate some memory on memory nodes near the given physical cpuset cpuset.
Definition: bind.c:532
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.
Definition: helper.h:497
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.
Definition: helper.h:226
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.
Definition: helper.h:1207
HWLOC_DECLSPEC int hwloc_bitmap_isequal(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure
Test whether bitmap bitmap1 is equal to bitmap bitmap2.
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.
Definition: helper.h:142
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.
Definition: helper.h:201
static __hwloc_inline hwloc_const_cpuset_t __hwloc_attribute_pure hwloc_topology_get_online_cpuset(hwloc_topology_t topology)
Get online CPU set.
Definition: helper.h:760
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.
Definition: helper.h:1016
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.
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.
Definition: helper.h:74
HWLOC_DECLSPEC void * hwloc_alloc_membind_nodeset(hwloc_topology_t topology, size_t len, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags) __hwloc_attribute_malloc
Allocate some memory on the given physical nodeset nodeset.
Definition: bind.c:495
HWLOC_DECLSPEC int hwloc_bitmap_intersects(hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2) __hwloc_attribute_pure
Test whether bitmaps bitmap1 and bitmap2 intersects.
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.
Definition: helper.h:110
unsigned logical_index
Horizontal index in the whole list of similar objects, could be a "cousin_rank" since it's the rank w...
Definition: hwloc.h:342
PCI device.
Definition: hwloc.h:232
NUMA node.
Definition: hwloc.h:184
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.
Definition: helper.h:592
hwloc_nodeset_t complete_nodeset
The complete NUMA node set of this object,.
Definition: hwloc.h:426
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.
Definition: helper.h:314
static __hwloc_inline hwloc_const_nodeset_t __hwloc_attribute_pure hwloc_topology_get_allowed_nodeset(hwloc_topology_t topology)
Get allowed node set.
Definition: helper.h:828
unsigned arity
Number of children.
Definition: hwloc.h:357
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.
Definition: helper.h:158
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.
Definition: helper.h:699
static __hwloc_inline hwloc_obj_t __hwloc_attribute_pure hwloc_get_obj_by_type(hwloc_topology_t topology, hwloc_obj_type_t type, unsigned idx)
Returns the topology object at logical index idx with type type.
Definition: hwloc.h:1110
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.
Definition: helper.h:1068
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.
Definition: helper.h:285
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.
Definition: helper.h:652
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.
Definition: helper.h:48
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.
Definition: helper.h:338
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...
Definition: helper.h:1154
HWLOC_DECLSPEC void * hwloc_alloc(hwloc_topology_t topology, size_t len)
Allocate some memory.
Definition: bind.c:487
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.
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.
Definition: helper.h:1173
hwloc_obj_type_t
Type of topology object.
Definition: hwloc.h:164
HWLOC_DECLSPEC void hwloc_bitmap_fill(hwloc_bitmap_t bitmap)
Fill bitmap bitmap with all possible indexes (even if those objects don't exist or are otherwise unav...
PCI-side of a bridge.
Definition: hwloc.h:258
HWLOC_DECLSPEC void hwloc_bitmap_set(hwloc_bitmap_t bitmap, unsigned id)
Add index id in bitmap bitmap.
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.
Definition: helper.h:1183
HWLOC_DECLSPEC void hwloc_bitmap_or(hwloc_bitmap_t res, hwloc_const_bitmap_t bitmap1, hwloc_const_bitmap_t bitmap2)
Or bitmaps bitmap1 and bitmap2 and store the result in bitmap res.
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.
Definition: helper.h:864
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.
Definition: helper.h:248
static __hwloc_inline hwloc_const_cpuset_t __hwloc_attribute_pure hwloc_topology_get_allowed_cpuset(hwloc_topology_t topology)
Get allowed CPU set.
Definition: helper.h:775
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.
Definition: helper.h:892
hwloc_cpuset_t cpuset
CPUs covered by this object.
Definition: hwloc.h:366
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.
Definition: helper.h:176
HWLOC_DECLSPEC int hwloc_bitmap_weight(hwloc_const_bitmap_t bitmap) __hwloc_attribute_pure
Compute the "weight" of bitmap bitmap (i.e., number of indexes that are in the bitmap).
hwloc_membind_policy_t
Memory binding policy.
Definition: hwloc.h:1479
static __hwloc_inline hwloc_const_cpuset_t __hwloc_attribute_pure hwloc_topology_get_topology_cpuset(hwloc_topology_t topology)
Get topology CPU set.
Definition: helper.h:745
HWLOC_DECLSPEC hwloc_obj_t hwloc_get_obj_by_depth(hwloc_topology_t topology, unsigned depth, unsigned idx) __hwloc_attribute_pure
Returns the topology object at logical index idx from depth depth.
union hwloc_obj_attr_u * attr
Object type-specific Attributes, may be NULL if no attribute value was found.
Definition: hwloc.h:337
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.
Definition: helper.h:1112
HWLOC_DECLSPEC int hwloc_set_membind(hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, hwloc_membind_policy_t policy, int flags)
Set the default memory binding policy of the current process or thread to prefer the NUMA node(s) nea...
Definition: bind.c:284
hwloc_nodeset_t allowed_nodeset
The set of allowed NUMA memory nodes.
Definition: hwloc.h:440
Processing Unit, or (Logical) Processor.
Definition: hwloc.h:199
struct hwloc_distances_s ** distances
Distances between all objects at same depth below this object.
Definition: hwloc.h:453
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.
Definition: helper.h:117
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.
Definition: helper.h:681
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.
Definition: helper.h:913
unsigned depth
Vertical index in the hierarchy.
Definition: hwloc.h:341
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.
Definition: helper.h:563
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.
Definition: helper.h:452