Struct hwlocality::memory::attribute::MemoryAttributeBuilder
source · pub struct MemoryAttributeBuilder<'editor, 'topology> { /* private fields */ }
hwloc-2_3_0
only.Expand description
Mechanism to configure a memory attribute
Implementations§
source§impl MemoryAttributeBuilder<'_, '_>
impl MemoryAttributeBuilder<'_, '_>
sourcepub fn set_values(
&mut self,
find_values: impl FnOnce(&Topology) -> (Option<Vec<MemoryAttributeLocation<'_>>>, Vec<(&TopologyObject, u64)>),
) -> Result<(), HybridError<ValueInputError>>
pub fn set_values( &mut self, find_values: impl FnOnce(&Topology) -> (Option<Vec<MemoryAttributeLocation<'_>>>, Vec<(&TopologyObject, u64)>), ) -> Result<(), HybridError<ValueInputError>>
Set attribute values for (initiator, target node) pairs
Given a read-only view of the underlying Topology
, the provided
find_values
callback should conceptually extract a list of
(initiator, target, value)
tuples if this memory attribute has
initiators (flag MemoryAttributeFlags::NEED_INITIATOR
was set at
attribute registration time), and a list of (target, value)
tuples
if the attribute has no initiators.
However, for efficiency reasons, the callback does not literally return
a list of ternary tuples with an optional initiator member, as this
would require one initiator check per attribute value. Instead, the
callback returns a list of (target, value)
pairs along with an
optional list of initiators. If a list of initiators is provided, it
must be as long as the provided list of (target, value)
pairs.
Initiators should be specified as
CpuSet
when referring to accesses
performed by CPU cores. The Object
initiator type is currently unused internally by hwloc, but users may
for instance use it to provide custom information about host memory
accesses performed by GPUs.
§Errors
InconsistentData
if the number of provided initiators and attribute values does not matchForeignInitiator
if some of the provided initiators areTopologyObject
s that do not belong to thisTopology
ForeignTarget
if some of the provided targets areTopologyObject
s that do not belong to thisTopology
NeedInitiator
if initiators were not specified for an attribute that requires themUnwantedInitiator
if initiators were specified for an attribute that does not requires them