diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-06-20 22:21:39 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-06-21 12:19:42 +0200 |
| commit | df3c9dc3fcd2f89910575bfdc24a3db3af9eba0f (patch) | |
| tree | 136246812bbf7b6063aa7b324397d580a1669dff /opendc-experiments/opendc-experiments-capelin/src/main | |
| parent | b8b0f39028af90fa54b42a00214b2ea9a5e48e2e (diff) | |
exp: Enable interpreter sharing across hosts
This change enables the experiments to share the SimResourceInterpreter
across multiple hosts, which allows updates to be scheduled efficiently
for all machines at the same time. This is especially beneficial if the
machines operate on the same time slices.
Diffstat (limited to 'opendc-experiments/opendc-experiments-capelin/src/main')
| -rw-r--r-- | opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/ExperimentHelpers.kt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/ExperimentHelpers.kt b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/ExperimentHelpers.kt index 0fbb7280..0485415c 100644 --- a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/ExperimentHelpers.kt +++ b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/ExperimentHelpers.kt @@ -50,6 +50,7 @@ import org.opendc.simulator.compute.workload.SimTraceWorkload import org.opendc.simulator.compute.workload.SimWorkload import org.opendc.simulator.failures.CorrelatedFaultInjector import org.opendc.simulator.failures.FaultInjector +import org.opendc.simulator.resources.SimResourceInterpreter import org.opendc.telemetry.sdk.metrics.export.CoroutineMetricReader import org.opendc.telemetry.sdk.toOtelClock import java.io.File @@ -144,6 +145,7 @@ public suspend fun withComputeService( scheduler: ComputeScheduler, block: suspend CoroutineScope.(ComputeService) -> Unit ): Unit = coroutineScope { + val interpreter = SimResourceInterpreter(coroutineContext, clock) val hosts = environmentReader .use { it.read() } .map { def -> @@ -153,7 +155,7 @@ public suspend fun withComputeService( def.model, def.meta, coroutineContext, - clock, + interpreter, meterProvider.get("opendc-compute-simulator"), SimFairShareHypervisorProvider(), def.powerModel |
