Enum hwlocality::object::types::ObjectType
source · #[non_exhaustive]#[repr(u32)]pub enum ObjectType {
Show 20 variants
Machine = 0,
Package = 1,
Core = 2,
PU = 3,
L1Cache = 4,
L2Cache = 5,
L3Cache = 6,
L4Cache = 7,
L5Cache = 8,
L1ICache = 9,
L2ICache = 10,
L3ICache = 11,
Group = 12,
NUMANode = 13,
Bridge = 14,
PCIDevice = 15,
OSDevice = 16,
Misc = 17,
MemCache = 18,
Die = 19,
}
Expand description
Represents the type of a TopologyObject
.
Note that (partial) ordering for object types is implemented as a call
into the hwloc
library which defines ordering as follows:
- A == B if
ObjectType::A
andObjectType::B
are the same. - A < B if
ObjectType::A
includes objects of typeObjectType::B
. - A > B if objects of
ObjectType::A
are included in typeObjectType::B
. ObjectType::Machine
is always the highest andObjectType::PU
is always the deepest.
It can also help to think of it as comparing the relative depths of each type, so
a ObjectType::Machine
will be smaller than a ObjectType::PU
since the machine
contains processing units.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Machine = 0
The root object, a set of processors and memory with cache coherency
This type is always used for the root object of a topology, and never used anywhere else. Hence it never has a parent.
Package = 1
Physical package, what goes into a physical motherboard socket
Usually contains multiple cores, and possibly some dies.
Core = 2
A computation unit (may be shared by several PUs aka logical processors).
PU = 3
Processing Unit, or (Logical) Processor
An execution unit (may share a core with some other logical processors, e.g. in the case of an SMT core).
This is the leaf of the CPU resource hierarchy, it can only have Misc children.
It is always reported even when other objects are not detected. However,
an incorrect number of PUs may be reported in the absence of
DiscoverySupport::pu_count()
.
L1Cache = 4
Level 1 Data (or Unified) Cache
L2Cache = 5
Level 2 Data (or Unified) Cache
L3Cache = 6
Level 3 Data (or Unified) Cache
L4Cache = 7
Level 4 Data (or Unified) Cache
L5Cache = 8
Level 5 Data (or Unified) Cache
L1ICache = 9
Level 1 Instruction cache (filtered out by default)
L2ICache = 10
Level 2 Instruction cache (filtered out by default)
L3ICache = 11
Level 3 Instruction cache (filtered out by default)
Group = 12
Group object
Objects which do not fit in the above but are detected by hwloc and are useful to take into account for affinity. For instance, some operating systems expose their arbitrary processors aggregation this way. And hwloc may insert such objects to group NUMA nodes according to their distances.
These objects are ignored when they do not bring any structure (see
TypeFilter::KeepStructure
)
NUMANode = 13
NUMA node
An object that contains memory that is directly and byte-accessible to the host processors. It is usually close to some cores (the corresponding objects are descendants of the NUMA node object in the hwloc tree).
This is the smallest object representing Memory resources, it cannot have any child except Misc objects. However it may have Memory-side cache parents.
There is always at least one such object in the topology even if the
machine is not NUMA. However, an incorrect number of NUMA nodes may be
reported in the absence of DiscoverySupport::numa_count()
.
Memory objects are not listed in the main children list, but rather in
the dedicated Memory children list. They also have a special depth
Depth::NUMANode
instead of a normal depth just like other objects
in the main tree.
Bridge = 14
Bridge (filtered out by default)
Any bridge that connects the host or an I/O bus, to another I/O bus.
Bridges are not added to the topology unless their filtering is changed
(see TopologyBuilder::with_type_filter()
and
TopologyBuilder::with_io_type_filter()
).
I/O objects are not listed in the main children list, but rather in the
dedicated Memory children list. They don’t have CPU and node sets. They
also have a special depth Depth::Bridge
instead of a normal depth
just like other objects in the main tree.
PCIDevice = 15
PCI device (filtered out by default)
PCI devices are not added to the topology unless their filtering is
changed (see TopologyBuilder::with_type_filter()
and
TopologyBuilder::with_io_type_filter()
).
I/O objects are not listed in the main children list, but rather in the
dedicated I/O children list. They don’t have CPU and node sets. They
also have a special depth Depth::PCIDevice
instead of a normal depth
just like other objects in the main tree.
OSDevice = 16
Operating system device (filtered out by default)
OS devices are not added to the topology unless their filtering is
changed (see TopologyBuilder::with_type_filter()
and
TopologyBuilder::with_io_type_filter()
).
I/O objects are not listed in the main children list, but rather in the
dedicated I/O children list. They don’t have CPU and node sets. They
also have a special depth Depth::OSDevice
instead of a normal depth
just like other objects in the main tree.
Misc = 17
Miscellaneous object (filtered out by default)
Objects without particular meaning, that can e.g. be added by the application for its own use, or by hwloc for miscellaneous objects such as MemoryModule (DIMMs).
They are not added to the topology unless their filtering is
changed (see TopologyBuilder::with_type_filter()
).
Misc objects have no CPU and node sets, and may only have other Misc
objects as children. They are not part of the main children list, but
rather reside in the dedicated Misc children list. They don’t have CPU
and node sets. They also have a special depth Depth::Misc
instead
of a normal depth just like other objects in the main tree.
MemCache = 18
hwloc-2_1_0
only.Memory-side cache (filtered out by default)
A cache in front of a specific NUMA node. This object always has at least one NUMA node as a memory child.
Memory objects are not listed in the main children list, but rather in
the dedicated Memory children list. They also have a special depth
Depth::MemCache
instead of a normal depth just like other objects
in the main tree.
Die = 19
hwloc-2_1_0
only.Die within a physical package
A subpart of the physical package, that contains multiple cores.
Implementations§
source§impl ObjectType
impl ObjectType
sourcepub fn is_normal(self) -> bool
pub fn is_normal(self) -> bool
Truth that this type is part of the normal hierarchy (not Memory, I/O or Misc)
sourcepub fn is_leaf(self) -> bool
pub fn is_leaf(self) -> bool
Truth that this object type is a leaf of the normal+memory hierarchy and cannot have non-Misc children
sourcepub fn is_cpu_cache(self) -> bool
pub fn is_cpu_cache(self) -> bool
Truth that this is a CPU-side cache type
(not MemCache
)
sourcepub fn is_cpu_data_cache(self) -> bool
pub fn is_cpu_data_cache(self) -> bool
Truth that this is a CPU-side data or unified cache type
(not MemCache
)
sourcepub fn is_cpu_instruction_cache(self) -> bool
pub fn is_cpu_instruction_cache(self) -> bool
Truth that this is a CPU-side instruction cache type
(not MemCache
)
sourcepub fn is_memory(self) -> bool
pub fn is_memory(self) -> bool
Truth that this is a memory object type (not Normal, I/O or Misc)
Memory objects are not listed in the main children list, but rather in the dedicated memory children list. They have special depth values instead of normal depths like other objects in the main tree.
sourcepub fn is_io(self) -> bool
pub fn is_io(self) -> bool
Truth that this is an I/O object type (not Normal, Memory or Misc)
I/O objects are not added to the topology unless I/O discovery is enabled through the custom flags. They have empty CPU and node sets. They are not part of the main children list, but rather reside in the dedicated I/O children list.
Trait Implementations§
source§impl Arbitrary for ObjectType
Available on crate feature proptest
only.
impl Arbitrary for ObjectType
proptest
only.§type Parameters = ()
type Parameters = ()
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<Range<usize>, fn(_: usize) -> ObjectType>
type Strategy = Map<Range<usize>, fn(_: usize) -> ObjectType>
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy
source§impl Clone for ObjectType
impl Clone for ObjectType
source§fn clone(&self) -> ObjectType
fn clone(&self) -> ObjectType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ObjectType
impl Debug for ObjectType
source§impl Display for ObjectType
impl Display for ObjectType
source§impl From<ObjectType> for TypeFilterError
impl From<ObjectType> for TypeFilterError
source§fn from(value: ObjectType) -> Self
fn from(value: ObjectType) -> Self
source§impl From<ObjectType> for u32
impl From<ObjectType> for u32
source§fn from(enum_value: ObjectType) -> Self
fn from(enum_value: ObjectType) -> Self
source§impl Hash for ObjectType
impl Hash for ObjectType
source§impl PartialEq for ObjectType
impl PartialEq for ObjectType
source§fn eq(&self, other: &ObjectType) -> bool
fn eq(&self, other: &ObjectType) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ObjectType
impl PartialOrd for ObjectType
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more