lisa.energy_model.EnergyModelNode#
- class lisa.energy_model.EnergyModelNode(active_states, idle_states, cpu=None, children=None, name=None)[source]#
Bases:
Loggable
Describes topology and energy data for an EnergyModel.
Represents a CPU topology with energy data. The active and idle state data represents the power usage of just the hardware resources of this topology level, not its children. e.g. If the node represents a cluster, the power numbers should not include power used by the CPU - that power should be included the data of the child nodes.
Exactly one of
cpu
andchildren
must be given.- Parameters:
active_states – Dict mapping frequencies to
ActiveState
values. Compute capacity data is optional for non-leaf nodes.idle_states (dict) – Dict mapping idle state names to power usage values
cpu (tuple(int)) – The CPU this node represents. If provided, this is a leaf node.
children (list(EnergyModelNode)) – Non-empty list of child
EnergyModelNode
objectsname (str) – Optional human-readable name for this node. Leaf (CPU) nodes have a default name of “cpuN” where N is the cpu number.
Attributes
For convenience, this holds the single CPU contained by leaf nodes.
None
for non-leaf nodes.CPUs contained in this node. Includes those of child nodes.
Properties
Compute capacity at highest frequency.
logger
inheritedConvenience short-hand for
self.get_logger()
.Methods
Return the idle state with index
idx
.Iterate over leaves.
Iterate over nodes depth-first, post-order.
get_logger()
inheritedProvides a
logging.Logger
named aftercls
.log_locals()
inheritedDebugging aid: log the local variables of the calling function.
Attributes#
- EnergyModelNode.cpu#
For convenience, this holds the single CPU contained by leaf nodes.
None
for non-leaf nodes.
- EnergyModelNode.cpus#
CPUs contained in this node. Includes those of child nodes.
Properties#
- property EnergyModelNode.logger#
Inherited property, see
lisa.utils.Loggable.logger
Convenience short-hand for
self.get_logger()
.
Methods#
- EnergyModelNode.iter_leaves()#
Iterate over leaves
- EnergyModelNode.iter_nodes()#
Iterate over nodes depth-first, post-order
- classmethod EnergyModelNode.get_logger(suffix=None)#
Inherited method, see
lisa.utils.Loggable.get_logger()
Provides a
logging.Logger
named aftercls
.
- classmethod EnergyModelNode.log_locals(var_names=None, level='debug')#
Inherited method, see
lisa.utils.Loggable.log_locals()
Debugging aid: log the local variables of the calling function.