Hardware Locality (hwloc) 2.16.0
CPU and node sets of entire topologies

Functions

hwloc_const_cpuset_t hwloc_topology_get_topology_cpuset (hwloc_topology_t topology)
hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset (hwloc_topology_t topology)
hwloc_const_cpuset_t hwloc_topology_get_allowed_cpuset (hwloc_topology_t topology)
hwloc_const_nodeset_t hwloc_topology_get_topology_nodeset (hwloc_topology_t topology)
hwloc_const_nodeset_t hwloc_topology_get_complete_nodeset (hwloc_topology_t topology)
hwloc_const_nodeset_t hwloc_topology_get_allowed_nodeset (hwloc_topology_t topology)

Detailed Description

There are three different kinds of CPU sets and node sets. "topology" sets correspond exactly to PU and NUMANode objects in the topology. "complete" sets may be larger if some resources are missing in the topology because they are offline, disallowed, etc. "allowed" sets are equal to "topology" sets by default, but they may be smaller if some disallowed resources are exposed in the topology (if the topology flag HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED is set).

Function Documentation

◆ hwloc_topology_get_topology_cpuset()

hwloc_const_cpuset_t hwloc_topology_get_topology_cpuset ( hwloc_topology_t topology)

Get the topology CPU set.

Returns
the CPU set of processors of the system for which hwloc provides topology information.
Note
Only CPUs that have a corresponding PU object in the topology are listed in this set. As explained in hwloc_obj::cpuset, it may be smaller than the complete cpuset returned by hwloc_topology_get_complete_cpuset() since it does not include offline CPUs, etc. It may also be larger than the set returned by hwloc_topology_get_allowed_cpuset() if disallowed resources are enabled in the topology.
This is equivalent to retrieving the machine root object CPU-set.
This function cannot return NULL.
The returned cpuset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.

◆ hwloc_topology_get_complete_cpuset()

hwloc_const_cpuset_t hwloc_topology_get_complete_cpuset ( hwloc_topology_t topology)

Get the complete CPU set.

Returns
the complete CPU set of processors of the system.
Note
As explained in hwloc_obj::complete_cpuset, this set may be larger than the main cpuset returned by hwloc_topology_get_topology_cpuset() since it may also contain additional CPUs not exposed as PU objects in the topology (offline CPUs, etc).
This is equivalent to retrieving the machine root object complete CPU-set.
This function cannot return NULL.
The returned cpuset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.

◆ hwloc_topology_get_allowed_cpuset()

hwloc_const_cpuset_t hwloc_topology_get_allowed_cpuset ( hwloc_topology_t topology)

Get the allowed CPU set.

Returns
the CPU set of allowed processors of the system.
Note
If the topology flag HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was not set, this is identical to hwloc_topology_get_topology_cpuset() since disallowed CPUs are not listed in the topology by default.
If HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was set, this allowed set may be smaller than hwloc_topology_get_topology_cpuset() since disallowed CPU are present in the topology and filtered out of this allowed cpuset.
Applying hwloc_bitmap_intersects() on the result of this function and on an object cpuset checks whether there are allowed PUs inside that object. Applying hwloc_bitmap_and() returns the list of these allowed PUs.
This function cannot return NULL.
The returned cpuset is not newly allocated and should thus not be changed or freed, hwloc_bitmap_dup() must be used to obtain a local copy.

◆ hwloc_topology_get_topology_nodeset()

hwloc_const_nodeset_t hwloc_topology_get_topology_nodeset ( hwloc_topology_t topology)

Get the topology memory node set.

Returns
the node set of memory in the system for which hwloc provides topology information.
Note
Only memory nodes that have a corresponding NUMA node object in the topology are listed in this set. As explained in hwloc_obj::nodeset, it may be smaller than the complete nodeset returned by hwloc_topology_get_complete_nodeset() since it does not include offline or empty memory nodes, etc. It may also be larger than the set returned by hwloc_topology_get_allowed_nodeset() if disallowed resources are enabled in the topology.
This is equivalent to retrieving the machine root object nodeset.
This function cannot return NULL.
The returned nodeset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.

◆ hwloc_topology_get_complete_nodeset()

hwloc_const_nodeset_t hwloc_topology_get_complete_nodeset ( hwloc_topology_t topology)

Get the complete node set.

Returns
the complete node set of memory in the system.
Note
As explained in hwloc_obj::complete_nodeset, this set may be larger than the main nodeset returned by hwloc_topology_get_topology_nodeset() since it may also contain additional nodes not exposed as NUMA node objects in the topology (empty or offline NUMA nodes, etc).
This is equivalent to retrieving the machine root object complete node set.
This function cannot return NULL.
The returned nodeset is not newly allocated and should thus not be changed or freed; hwloc_bitmap_dup() must be used to obtain a local copy.

◆ hwloc_topology_get_allowed_nodeset()

hwloc_const_nodeset_t hwloc_topology_get_allowed_nodeset ( hwloc_topology_t topology)

Get the allowed node set.

Returns
the nodeset set of allowed memory of the system.
Note
If the topology flag HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was not set, this is identical to hwloc_topology_get_topology_nodeset() since disallowed NUMA nodes are not listed in the topology by default.
If HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED was set, this allowed set may be smaller than hwloc_topology_get_topology_nodeset() since disallowed NUMA nodes are present in the topology and filtered out of this allowed nodeset.
Applying hwloc_bitmap_intersects() on the result of this function and on an object nodeset checks whether there are allowed NUMA nodes near that object. Applying hwloc_bitmap_and() returns the list of these allowed NUMA nodes.
This function cannot return NULL.
The returned nodeset is not newly allocated and should thus not be changed or freed, hwloc_bitmap_dup() must be used to obtain a local copy.
This function cannot return NULL.