#[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 and ObjectType::B are the same.
  • A < B if ObjectType::A includes objects of type ObjectType::B.
  • A > B if objects of ObjectType::A are included in type ObjectType::B.
  • ObjectType::Machine is always the highest and ObjectType::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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Available on crate feature 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

Available on crate feature hwloc-2_1_0 only.

Die within a physical package

A subpart of the physical package, that contains multiple cores.

Implementations§

source§

impl ObjectType

source

pub fn is_normal(self) -> bool

Truth that this type is part of the normal hierarchy (not Memory, I/O or Misc)

source

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

source

pub fn is_cpu_cache(self) -> bool

Truth that this is a CPU-side cache type (not MemCache)

source

pub fn is_cpu_data_cache(self) -> bool

Truth that this is a CPU-side data or unified cache type (not MemCache)

source

pub fn is_cpu_instruction_cache(self) -> bool

Truth that this is a CPU-side instruction cache type (not MemCache)

source

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.

source

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.

source

pub fn has_sets(self) -> bool

Truth that objects of this type have a CpuSet and a NodeSet

Bear in mind that even though memory objects have a cpuset, that cpuset can be empty for CPU-less NUMA nodes. This is why memory objects should be referred to by nodeset rather than by cpuset whenever possible.

Trait Implementations§

source§

impl Arbitrary for ObjectType

Available on crate feature proptest only.
§

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
§

type Strategy = Map<Range<usize>, fn(_: usize) -> ObjectType>

The type of Strategy used to generate values of type Self.
source§

fn arbitrary_with(_args: Self::Parameters) -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). The strategy is passed the arguments given in args. Read more
source§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
source§

impl Clone for ObjectType

source§

fn clone(&self) -> ObjectType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ObjectType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ObjectType

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<ObjectType> for TypeFilterError

source§

fn from(value: ObjectType) -> Self

Converts to this type from the input type.
source§

impl From<ObjectType> for u32

source§

fn from(enum_value: ObjectType) -> Self

Converts to this type from the input type.
source§

impl Hash for ObjectType

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ObjectType

source§

fn eq(&self, other: &ObjectType) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for ObjectType

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Sequence for ObjectType

source§

const CARDINALITY: usize = 20usize

Number of values of type Self. Read more
source§

fn next(&self) -> Option<Self>

Returns value following *self or None if this was the end. Read more
source§

fn previous(&self) -> Option<Self>

Returns value preceding *self or None if this was the beginning. Read more
source§

fn first() -> Option<Self>

Returns the first value of type Self. Read more
source§

fn last() -> Option<Self>

Returns the last value of type Self. Read more
source§

impl TryFrom<u32> for ObjectType

§

type Error = TryFromPrimitiveError<ObjectType>

The type returned in the event of a conversion error.
source§

fn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
source§

impl TryFromPrimitive for ObjectType

§

type Primitive = u32

§

type Error = TryFromPrimitiveError<ObjectType>

source§

const NAME: &'static str = "ObjectType"

source§

fn try_from_primitive( number: Self::Primitive ) -> Result<Self, TryFromPrimitiveError<Self>>

source§

impl Copy for ObjectType

source§

impl Eq for ObjectType

source§

impl StructuralPartialEq for ObjectType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V