diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-04-23 17:15:25 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-05-03 22:23:33 +0200 |
| commit | 80335a49513f3e74228aa1bfb998dd54855f68e2 (patch) | |
| tree | 3bfdc735ef39353c6c715399c2d9890ff423d4c4 /opendc-simulator/opendc-simulator-compute/src/test | |
| parent | b5d6aa7f384ea9d6a1a40965e883ac6403c302fd (diff) | |
simulator: Introduce SimResourceScheduler
This change introduces the SimResourceScheduler interface, which is a
generic interface for scheduling the coordination and synchronization
between resource providers and resource consumers.
This interface replaces the need for users to manually specify the clock
and coroutine context per resource provider.
Diffstat (limited to 'opendc-simulator/opendc-simulator-compute/src/test')
| -rw-r--r-- | opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/SimHypervisorTest.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/SimHypervisorTest.kt b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/SimHypervisorTest.kt index a067dd2e..8886caa7 100644 --- a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/SimHypervisorTest.kt +++ b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/SimHypervisorTest.kt @@ -39,6 +39,7 @@ import org.opendc.simulator.compute.model.ProcessingUnit import org.opendc.simulator.compute.power.ConstantPowerModel import org.opendc.simulator.compute.workload.SimTraceWorkload import org.opendc.simulator.core.runBlockingSimulation +import org.opendc.simulator.resources.SimResourceSchedulerTrampoline /** * Test suite for the [SimHypervisor] class. @@ -93,7 +94,7 @@ internal class SimHypervisorTest { ) val machine = SimBareMetalMachine(coroutineContext, clock, model, PerformanceScalingGovernor(), SimpleScalingDriver(ConstantPowerModel(0.0))) - val hypervisor = SimFairShareHypervisor(listener) + val hypervisor = SimFairShareHypervisor(SimResourceSchedulerTrampoline(coroutineContext, clock), listener) launch { machine.run(hypervisor) @@ -167,7 +168,7 @@ internal class SimHypervisorTest { coroutineContext, clock, model, PerformanceScalingGovernor(), SimpleScalingDriver(ConstantPowerModel(0.0)) ) - val hypervisor = SimFairShareHypervisor(listener) + val hypervisor = SimFairShareHypervisor(SimResourceSchedulerTrampoline(coroutineContext, clock), listener) launch { machine.run(hypervisor) |
