diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-04-07 13:07:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-07 13:07:28 +0200 |
| commit | 519141f9af525a853b40eb821e70ca209bc104bf (patch) | |
| tree | 3c8a4a3db41ac5be3a67f6427289a858805f98dc /simulator/opendc-compute | |
| parent | 8f2855b9b9d81b15ff431775ba584c1e3f4add2c (diff) | |
| parent | 3860d9e1c042eefacd5accb771cf47990090f649 (diff) | |
simulator: Add CPUFreq subsystem
This pull request adds a CPUFreq subsystem to the simulator module. This subsystem allows a simulated machine to perform frequency scaling, which in turn should reduce energy consumption.
Diffstat (limited to 'simulator/opendc-compute')
| -rw-r--r-- | simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt index 6d81aa7d..8e1aab44 100644 --- a/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt +++ b/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt @@ -31,11 +31,13 @@ import org.opendc.compute.api.Server import org.opendc.compute.api.ServerState import org.opendc.compute.service.driver.* import org.opendc.simulator.compute.* +import org.opendc.simulator.compute.cpufreq.PerformanceScalingGovernor +import org.opendc.simulator.compute.cpufreq.SimpleScalingDriver import org.opendc.simulator.compute.interference.IMAGE_PERF_INTERFERENCE_MODEL import org.opendc.simulator.compute.interference.PerformanceInterferenceModel import org.opendc.simulator.compute.model.MemoryUnit import org.opendc.simulator.compute.power.ConstantPowerModel -import org.opendc.simulator.compute.power.MachinePowerModel +import org.opendc.simulator.compute.power.PowerModel import org.opendc.simulator.failures.FailureDomain import java.time.Clock import java.util.* @@ -54,7 +56,7 @@ public class SimHost( clock: Clock, meter: Meter, hypervisor: SimHypervisorProvider, - powerModel: MachinePowerModel = ConstantPowerModel(0.0), + powerModel: PowerModel = ConstantPowerModel(0.0), private val mapper: SimWorkloadMapper = SimMetaWorkloadMapper(), ) : Host, FailureDomain, AutoCloseable { /** @@ -80,7 +82,7 @@ public class SimHost( /** * The machine to run on. */ - public val machine: SimBareMetalMachine = SimBareMetalMachine(context, clock, model, powerModel) + public val machine: SimBareMetalMachine = SimBareMetalMachine(context, clock, model, PerformanceScalingGovernor(), SimpleScalingDriver(powerModel)) /** * The hypervisor to run multiple workloads. |
