diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-03-30 22:20:13 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-04-07 12:13:14 +0200 |
| commit | e38e6b9341907e28d029054995cf43cbd5e8bb4d (patch) | |
| tree | bf625c4e3d02dfb147924d3dff54e2794c8ba75b /simulator/opendc-simulator/opendc-simulator-compute/src/jmh | |
| parent | bef2b2fc9ab97941613ec4537ebca1eb3fccdee6 (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-simulator/opendc-simulator-compute/src/jmh')
| -rw-r--r-- | simulator/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/simulator/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt b/simulator/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt index eb22c855..c2a29f5b 100644 --- a/simulator/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt +++ b/simulator/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt @@ -27,9 +27,12 @@ import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.launch import kotlinx.coroutines.test.TestCoroutineScope import kotlinx.coroutines.test.runBlockingTest +import org.opendc.simulator.compute.cpufreq.PerformanceScalingGovernor +import org.opendc.simulator.compute.cpufreq.SimpleScalingDriver import org.opendc.simulator.compute.model.MemoryUnit import org.opendc.simulator.compute.model.ProcessingNode import org.opendc.simulator.compute.model.ProcessingUnit +import org.opendc.simulator.compute.power.ConstantPowerModel import org.opendc.simulator.compute.workload.SimWorkload import org.opendc.simulator.utils.DelayControllerClockAdapter import org.opendc.utils.TimerScheduler @@ -75,7 +78,10 @@ class SimMachineBenchmarks { @Benchmark fun benchmarkBareMetal(state: Workload) { return scope.runBlockingTest { - val machine = SimBareMetalMachine(scope.coroutineContext, clock, machineModel) + val machine = SimBareMetalMachine( + coroutineContext, clock, machineModel, PerformanceScalingGovernor(), + SimpleScalingDriver(ConstantPowerModel(0.0)) + ) return@runBlockingTest machine.run(state.workloads[0]) } } @@ -83,7 +89,10 @@ class SimMachineBenchmarks { @Benchmark fun benchmarkSpaceSharedHypervisor(state: Workload) { return scope.runBlockingTest { - val machine = SimBareMetalMachine(coroutineContext, clock, machineModel) + val machine = SimBareMetalMachine( + coroutineContext, clock, machineModel, PerformanceScalingGovernor(), + SimpleScalingDriver(ConstantPowerModel(0.0)) + ) val hypervisor = SimSpaceSharedHypervisor() launch { machine.run(hypervisor) } @@ -102,7 +111,10 @@ class SimMachineBenchmarks { @Benchmark fun benchmarkFairShareHypervisorSingle(state: Workload) { return scope.runBlockingTest { - val machine = SimBareMetalMachine(coroutineContext, clock, machineModel) + val machine = SimBareMetalMachine( + coroutineContext, clock, machineModel, PerformanceScalingGovernor(), + SimpleScalingDriver(ConstantPowerModel(0.0)) + ) val hypervisor = SimFairShareHypervisor() launch { machine.run(hypervisor) } @@ -121,7 +133,10 @@ class SimMachineBenchmarks { @Benchmark fun benchmarkFairShareHypervisorDouble(state: Workload) { return scope.runBlockingTest { - val machine = SimBareMetalMachine(coroutineContext, clock, machineModel) + val machine = SimBareMetalMachine( + coroutineContext, clock, machineModel, PerformanceScalingGovernor(), + SimpleScalingDriver(ConstantPowerModel(0.0)) + ) val hypervisor = SimFairShareHypervisor() launch { machine.run(hypervisor) } |
