Several functions can optionally be called between hwloc_topology_init()
and hwloc_topology_load() to configure how the detection should be
performed, e.g. to ignore some objects types, define a synthetic topology,
etc.

Flags to be set onto a topology context before load. Flags should be given to
hwloc_topology_set_flags(). They may also be returned by
hwloc_topology_get_flags().

Enumerator

HWLOC_TOPOLOGY_FLAG_INCLUDE_DISALLOWED

Detect the whole system, ignore reservations, include disallowed objects.
Gather all resources, even if some were disabled by the administrator. For
instance, ignore Linux Cgroup/Cpusets and gather all processors and memory
nodes.

When this flag is not set, PUs and NUMA nodes that are disallowed
are not added to the topology. Parent objects (package, core, cache, etc.)
are added only if some of their children are allowed. All existing PUs and
NUMA nodes in the topology are allowed.
hwloc_topology_get_allowed_cpuset() and
hwloc_topology_get_allowed_nodeset() are equal to the root object
cpuset and nodeset.

When this flag is set, the actual sets of allowed PUs and NUMA
nodes are given by hwloc_topology_get_allowed_cpuset() and
hwloc_topology_get_allowed_nodeset(). They may be smaller than the
root object cpuset and nodeset.

If the current topology is exported to XML and reimported later,
this flag should be set again in the reimported topology so that disallowed
resources are reimported as well.

HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM

Assume that the selected backend provides the topology for the system on
which we are running. This forces hwloc_topology_is_thissystem() to
return 1, i.e. makes hwloc assume that the selected backend provides the
topology for the system on which we are running, even if it is not the
OS-specific backend but the XML backend for instance. This means making
the binding functions actually call the OS-specific system calls and
really do binding, while the XML backend would otherwise provide empty
hooks just returning success.

Setting the environment variable HWLOC_THISSYSTEM may also result
in the same behavior.

This can be used for efficiency reasons to first detect the
topology once, save it to an XML file, and quickly reload it later through
the XML backend, but still having binding functions actually do bind.

HWLOC_TOPOLOGY_FLAG_THISSYSTEM_ALLOWED_RESOURCES

Get the set of allowed resources from the local operating system even if
the topology was loaded from XML or synthetic description. If the topology
was loaded from XML or from a synthetic string, restrict it by applying
the current process restrictions such as Linux Cgroup/Cpuset.

This is useful when the topology is not loaded directly from the
local machine (e.g. for performance reason) and it comes with all resources,
while the running process is restricted to only parts of the machine.

This flag is ignored unless
HWLOC_TOPOLOGY_FLAG_IS_THISSYSTEM is also set since the loaded
topology must match the underlying machine where restrictions will be
gathered from.

Setting the environment variable
HWLOC_THISSYSTEM_ALLOWED_RESOURCES would result in the same behavior.

Type filtering flags. By default, most objects are kept
(HWLOC_TYPE_FILTER_KEEP_ALL). Instruction caches, I/O and Misc objects
are ignored by default (HWLOC_TYPE_FILTER_KEEP_NONE). Die and Group
levels are ignored unless they bring structure
(HWLOC_TYPE_FILTER_KEEP_STRUCTURE).

Note that group objects are also ignored individually (without the
entire level) when they do not bring structure.

Enumerator

HWLOC_TYPE_FILTER_KEEP_ALL

Keep all objects of this type. Cannot be set for HWLOC_OBJ_GROUP
(groups are designed only to add more structure to the topology).

HWLOC_TYPE_FILTER_KEEP_NONE

Ignore all objects of this type. The bottom-level type
HWLOC_OBJ_PU, the HWLOC_OBJ_NUMANODE type, and the top-level
type HWLOC_OBJ_MACHINE may not be ignored.

HWLOC_TYPE_FILTER_KEEP_STRUCTURE

Only ignore objects if their entire level does not bring any structure.
Keep the entire level of objects if at least one of these objects adds
structure to the topology. An object brings structure when it has multiple
children and it is not the only child of its parent.

If all objects in the level are the only child of their parent,
and if none of them has multiple children, the entire level is removed.

Cannot be set for I/O and Misc objects since the topology
structure does not matter there.

HWLOC_TYPE_FILTER_KEEP_IMPORTANT

Only keep likely-important objects of the given type. It is only useful
for I/O object types. For HWLOC_OBJ_PCI_DEVICE and
HWLOC_OBJ_OS_DEVICE, it means that only objects of major/common
kinds are kept (storage, network, OpenFabrics, Intel MICs, CUDA, OpenCL,
NVML, and displays). Also, only OS devices directly attached on PCI (e.g.
no USB) are reported. For HWLOC_OBJ_BRIDGE, it means that bridges
are kept only if they have children.

This flag equivalent to HWLOC_TYPE_FILTER_KEEP_ALL for
Normal, Memory and Misc types since they are likely important.

Retrieve the topology support. Each flag indicates whether a feature is
supported. If set to 0, the feature is not supported. If set to 1, the feature
is supported, but the corresponding call may still fail in some corner cases.