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-serverless/opendc-serverless-simulator | |
| 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-serverless/opendc-serverless-simulator')
| -rw-r--r-- | simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt b/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt index 7a48609c..f28a926b 100644 --- a/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt +++ b/simulator/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt @@ -32,6 +32,9 @@ import org.opendc.serverless.simulator.workload.SimServerlessWorkloadMapper import org.opendc.simulator.compute.SimBareMetalMachine import org.opendc.simulator.compute.SimMachine import org.opendc.simulator.compute.SimMachineModel +import org.opendc.simulator.compute.cpufreq.PerformanceScalingGovernor +import org.opendc.simulator.compute.cpufreq.SimpleScalingDriver +import org.opendc.simulator.compute.power.ConstantPowerModel import java.time.Clock import java.util.ArrayDeque import kotlin.coroutines.Continuation @@ -66,7 +69,7 @@ public class SimFunctionDeployer( /** * The machine that will execute the workloads. */ - public val machine: SimMachine = SimBareMetalMachine(scope.coroutineContext, clock, model) + public val machine: SimMachine = SimBareMetalMachine(scope.coroutineContext, clock, model, PerformanceScalingGovernor(), SimpleScalingDriver(ConstantPowerModel(0.0))) /** * The job associated with the lifecycle of the instance. |
