Power

class power.PowerAware

Bases: ABC

Abstract base class for entites whose power can be measured.

This may be parts of the infrastructure as well as applications.

abstract measure_power() PowerMeasurement

Returns the power that is currently used by the entity.

class power.PowerMeasurement(dynamic: float, static: float)

Bases: object

Power measurement of one or more entities at a certain point in time.

Parameters:
  • dynamic – Dynamic (load-dependent) power usage in Watt

  • static – Static (load-independent) power usage in Watt

multiply(factor: float)
classmethod sum(measurements: Iterable[PowerMeasurement])
total() float
class power.PowerMeter(entities: Union[PowerAware, Collection[PowerAware], Callable[[], Collection[PowerAware]]], name: Optional[str] = None, measurement_interval: Optional[float] = 1, callback: Optional[Callable[[PowerMeasurement], None]] = None)

Bases: object

Power meter that stores the power of one or more entites in regular intervals.

Parameters:
  • entities – Can be either (1) a single PowerAware entity (2) a list of PowerAware entities (3) a function which returns a list of PowerAware entities, if the number of these entities changes during the simulation.

  • name – Name of the power meter for logging and reporting

  • measurement_interval – The freequency in which measurement take place.

  • callback – A function which will be called with the PowerMeasurement result after each conducted measurement.

run(env: Environment, delay: Optional[float] = 0)

Starts the power meter process.

Parameters:
  • env – Simpy environment (for timing the measurements)

  • delay – The delay after which the measurements shall be conducted. For some scenarios it makes sense to e.g.

  • the (include a tiny delay to make sure that all events at a previous time step were processed before) –

  • conducted. (measurement is) –

Returns:

sim

class power.PowerModel

Bases: ABC

Abstract base class for power models.

abstract measure() PowerMeasurement

Return the current power usage.

abstract set_parent(parent)

Set the entity which the power model is responsible for.

Should be called in the parent’s __init__().

Bases: PowerModel

Power model for network links.

Parameters:

energy_per_bit – Incremental energy per bit in J/bit (or W/(bit/s))

measure() PowerMeasurement

Return the current power usage.

set_parent(parent)

Set the entity which the power model is responsible for.

Should be called in the parent’s __init__().

class power.PowerModelLinkWirelessTx(energy_per_bit: float, amplifier_dissipation: float)

Bases: PowerModel

Power model for transmitting on wireless network links.

TODO Explain

Note

If you don’t know the amplifier dissipation or distance of nodes or if you are concerned with performance, you can also just use the regular PowerModelLink

Parameters:
  • energy_per_bit – Incremental energy per bit in J/bit (or W/(bit/s))

  • amplifier_dissipation – Amplifier energy dissipation in free space channel in J/bit/m^2

measure() PowerMeasurement

Return the current power usage.

set_parent(parent)

Set the entity which the power model is responsible for.

Should be called in the parent’s __init__().

class power.PowerModelNode(max_power: Optional[float] = None, power_per_cu: Optional[float] = None, static_power: float = 0)

Bases: PowerModel

Power model for compute nodes with static and dynamic power usage.

Power usage is scaled linearly with resource usage.

Example

A computer which constantly uses 10 Watt even when being idle (static_power=10) but can consume up to 150 Watt when under full load (max_power=150).

Parameters:
  • max_power – Maximum power usage of the node under full load. Cannot be combined with power_per_cu.

  • power_per_cu – Incremental power usage for each used compute unit. Cannot be combined with max_power.

  • static_power – Idle power usage of the node without any load.

measure() PowerMeasurement

Return the current power usage.

set_parent(parent)

Set the entity which the power model is responsible for.

Should be called in the parent’s __init__().