summaryrefslogtreecommitdiff
path: root/opendc-serverless
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-06-03 14:03:12 +0200
committerGitHub <noreply@github.com>2021-06-03 14:03:12 +0200
commit1303fe97510fb7987746722b3261c696f523fbd5 (patch)
treed927dbd4c71a5ea6435f5994e8fa0bc90ef19b2c /opendc-serverless
parentae987fa84b2e061eb9fdfec5561e1c976aaa5a54 (diff)
parentcef12722f03a24a0e1e3b7502fb5e434d93f1664 (diff)
simulator: Improve simulator resource model (#142)
This pull request improves the existing simulator resource model that is at the core of all simulation models in OpenDC. Most importantly, we have changed the way of how metrics are reported by this layer. * Add `SimResourceInterpreter` which is responsible for efficiently scheduling communication between resources in OpenDC. The performance gain is in the 2x-5x range. * Add uniform interface for exposing resource metrics (using `SimResourceCounters`). * Split the CPUFreq subsystem in the compute simulator as it mixed responsibilities of different layers. **Breaking API Changes** * Resource providers now accept a `SimResourceInterpreter` which is responsible for coordinating the communication between resources. * `ScalingGovernor` is not part of the machine layer anymore. Instead, it should move in the OS/Hypervisor layer. * Workloads should now start CPU consumers using `cpu.startConsumer`.
Diffstat (limited to 'opendc-serverless')
-rw-r--r--opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt b/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt
index b5516b4d..32e5f75e 100644
--- a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt
+++ b/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt
@@ -34,9 +34,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 org.opendc.simulator.compute.power.SimplePowerDriver
+import org.opendc.simulator.resources.SimResourceInterpreter
import java.time.Clock
import java.util.ArrayDeque
import kotlin.coroutines.Continuation
@@ -72,7 +72,11 @@ public class SimFunctionDeployer(
/**
* The machine that will execute the workloads.
*/
- public val machine: SimMachine = SimBareMetalMachine(scope.coroutineContext, clock, model, PerformanceScalingGovernor(), SimpleScalingDriver(ConstantPowerModel(0.0)))
+ public val machine: SimMachine = SimBareMetalMachine(
+ SimResourceInterpreter(scope.coroutineContext, clock),
+ model,
+ SimplePowerDriver(ConstantPowerModel(0.0))
+ )
/**
* The job associated with the lifecycle of the instance.