summaryrefslogtreecommitdiff
path: root/simulator/opendc-experiments/opendc-experiments-energy21
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-21 17:00:09 +0200
committerGitHub <noreply@github.com>2021-04-21 17:00:09 +0200
commit10dfc257de65cbbd1e25d1d7f5833bfb687d85ed (patch)
tree48b102c4d45b366abd8d0d368c31d6c0596ac30f /simulator/opendc-experiments/opendc-experiments-energy21
parentb4d1289bbd9539c041e8aeb39bb8962628399809 (diff)
parent62678b2890a7f3640836b99ca2fec9efd7485929 (diff)
simulator: Introduce SimulationCoroutineDispatcher (#120)
This change introduces the SimulationCoroutineDispatcher implementation which replaces the TestCoroutineDispatcher for running single-threaded simulations.
Diffstat (limited to 'simulator/opendc-experiments/opendc-experiments-energy21')
-rw-r--r--simulator/opendc-experiments/opendc-experiments-energy21/src/main/kotlin/org/opendc/experiments/energy21/EnergyExperiment.kt6
1 files changed, 2 insertions, 4 deletions
diff --git a/simulator/opendc-experiments/opendc-experiments-energy21/src/main/kotlin/org/opendc/experiments/energy21/EnergyExperiment.kt b/simulator/opendc-experiments/opendc-experiments-energy21/src/main/kotlin/org/opendc/experiments/energy21/EnergyExperiment.kt
index fc03e1ef..e974428c 100644
--- a/simulator/opendc-experiments/opendc-experiments-energy21/src/main/kotlin/org/opendc/experiments/energy21/EnergyExperiment.kt
+++ b/simulator/opendc-experiments/opendc-experiments-energy21/src/main/kotlin/org/opendc/experiments/energy21/EnergyExperiment.kt
@@ -29,7 +29,6 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.coroutineScope
-import kotlinx.coroutines.test.runBlockingTest
import mu.KotlinLogging
import org.opendc.compute.service.ComputeService
import org.opendc.compute.service.scheduler.ComputeScheduler
@@ -50,7 +49,7 @@ 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.*
-import org.opendc.simulator.utils.DelayControllerClockAdapter
+import org.opendc.simulator.core.runBlockingSimulation
import org.opendc.telemetry.sdk.toOtelClock
import java.io.File
import java.time.Clock
@@ -87,8 +86,7 @@ public class EnergyExperiment : Experiment("Energy Modeling 2021") {
private val powerModel by anyOf(PowerModelType.LINEAR, PowerModelType.CUBIC, PowerModelType.INTERPOLATION)
@OptIn(ExperimentalCoroutinesApi::class)
- override fun doRun(repeat: Int): Unit = runBlockingTest {
- val clock = DelayControllerClockAdapter(this)
+ override fun doRun(repeat: Int): Unit = runBlockingSimulation {
val chan = Channel<Unit>(Channel.CONFLATED)
val allocationPolicy = FilterScheduler(