From 4cc1d40d421c8736f8b21b360b61d6b065158b7a Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 29 Sep 2021 23:56:16 +0200 Subject: refactor(simulator): Migrate to flow-based simulation This change renames the `opendc-simulator-resources` module into the `opendc-simulator-flow` module to indicate that the core simulation model of OpenDC is based around modelling and simulating flows. Previously, the distinction between resource consumer and provider, and input and output caused some confusion. By switching to a flow-based model, this distinction is now clear (as in, the water flows from source to consumer/sink). --- .../org/opendc/compute/workload/ComputeWorkloadRunner.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'opendc-compute/opendc-compute-workload/src') diff --git a/opendc-compute/opendc-compute-workload/src/main/kotlin/org/opendc/compute/workload/ComputeWorkloadRunner.kt b/opendc-compute/opendc-compute-workload/src/main/kotlin/org/opendc/compute/workload/ComputeWorkloadRunner.kt index ed45bd8a..283f82fe 100644 --- a/opendc-compute/opendc-compute-workload/src/main/kotlin/org/opendc/compute/workload/ComputeWorkloadRunner.kt +++ b/opendc-compute/opendc-compute-workload/src/main/kotlin/org/opendc/compute/workload/ComputeWorkloadRunner.kt @@ -36,7 +36,7 @@ import org.opendc.compute.simulator.SimHost import org.opendc.compute.workload.topology.HostSpec import org.opendc.simulator.compute.kernel.interference.VmInterferenceModel import org.opendc.simulator.compute.workload.SimTraceWorkload -import org.opendc.simulator.resources.SimResourceInterpreter +import org.opendc.simulator.flow.FlowEngine import org.opendc.telemetry.compute.* import org.opendc.telemetry.sdk.toOtelClock import java.time.Clock @@ -73,9 +73,9 @@ public class ComputeWorkloadRunner( private val _metricProducers = mutableListOf() /** - * The [SimResourceInterpreter] to simulate the hosts. + * The [FlowEngine] to simulate the hosts. */ - private val interpreter = SimResourceInterpreter(context, clock) + private val engine = FlowEngine(context, clock) /** * The hosts that belong to this class. @@ -89,7 +89,7 @@ public class ComputeWorkloadRunner( } /** - * Run a simulation of the [ComputeService] by replaying the workload trace given by [trace]. + * Converge a simulation of the [ComputeService] by replaying the workload trace given by [trace]. */ public suspend fun run(trace: List, seed: Long) { val random = Random(seed) @@ -178,7 +178,7 @@ public class ComputeWorkloadRunner( spec.model, spec.meta, context, - interpreter, + engine, meterProvider, spec.hypervisor, powerDriver = spec.powerDriver, -- cgit v1.2.3