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 and children 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 objects

  • name (str) – Optional human-readable name for this node. Leaf (CPU) nodes have a default name of “cpuN” where N is the cpu number.

Attributes

cpu

For convenience, this holds the single CPU contained by leaf nodes. None for non-leaf nodes.

cpus

CPUs contained in this node. Includes those of child nodes.

Properties

max_capacity

Compute capacity at highest frequency.

logger inherited

Convenience short-hand for self.get_logger().

Methods

idle_state_by_idx()

Return the idle state with index idx.

iter_leaves()

Iterate over leaves.

iter_nodes()

Iterate over nodes depth-first, post-order.

get_logger() inherited

Provides a logging.Logger named after cls.

log_locals() inherited

Debugging 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.max_capacity[source]#

Compute capacity at highest frequency

property EnergyModelNode.logger#

Inherited property, see lisa.utils.Loggable.logger

Convenience short-hand for self.get_logger().

Methods#

EnergyModelNode.idle_state_by_idx(idx)[source]#

Return the idle state with index idx

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 after cls.

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.