summaryrefslogtreecommitdiff
path: root/simulator/opendc-compute
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-30 22:20:13 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-07 12:13:14 +0200
commite38e6b9341907e28d029054995cf43cbd5e8bb4d (patch)
treebf625c4e3d02dfb147924d3dff54e2794c8ba75b /simulator/opendc-compute
parentbef2b2fc9ab97941613ec4537ebca1eb3fccdee6 (diff)
simulator: Add initial design of CPUFreq model
This change adds a model implementing Dynamic Voltage Frequency Scaling (DVFS) to OpenDC.
Diffstat (limited to 'simulator/opendc-compute')
-rw-r--r--simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt8
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.