diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-09-22 10:28:37 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-09-22 14:49:35 +0200 |
| commit | 6171ab09f1df2ab3475a7b28ece383a9f87a77c5 (patch) | |
| tree | 54a7ae4ef7c482dfdc04ba3eef37ab428bee3b33 /opendc-simulator/opendc-simulator-compute/src/jmh | |
| parent | 507ff6223d277ebc6744b92b4030d94f20a92a02 (diff) | |
refactor(sim/compute): Extract Random dependency from interference model
This change moves the Random dependency outside the interference model,
to allow the interference model to be completely immutable and passable
between different simulations.
Diffstat (limited to 'opendc-simulator/opendc-simulator-compute/src/jmh')
| -rw-r--r-- | opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt b/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt index 02b48fa7..c3332d66 100644 --- a/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt +++ b/opendc-simulator/opendc-simulator-compute/src/jmh/kotlin/org/opendc/simulator/compute/SimMachineBenchmarks.kt @@ -37,6 +37,7 @@ import org.opendc.simulator.compute.workload.SimTraceWorkload import org.opendc.simulator.core.runBlockingSimulation import org.opendc.simulator.flow.FlowEngine import org.openjdk.jmh.annotations.* +import java.util.SplittableRandom import java.util.concurrent.ThreadLocalRandom import java.util.concurrent.TimeUnit @@ -85,7 +86,8 @@ class SimMachineBenchmarks { val machine = SimBareMetalMachine( engine, machineModel, SimplePowerDriver(ConstantPowerModel(0.0)) ) - val hypervisor = SimSpaceSharedHypervisor(engine, null) + val random = SplittableRandom(1) + val hypervisor = SimSpaceSharedHypervisor(engine, null, random) launch { machine.runWorkload(hypervisor) } @@ -107,7 +109,8 @@ class SimMachineBenchmarks { val machine = SimBareMetalMachine( engine, machineModel, SimplePowerDriver(ConstantPowerModel(0.0)) ) - val hypervisor = SimFairShareHypervisor(engine, null) + val random = SplittableRandom(1) + val hypervisor = SimFairShareHypervisor(engine, null, random) launch { machine.runWorkload(hypervisor) } @@ -129,7 +132,8 @@ class SimMachineBenchmarks { val machine = SimBareMetalMachine( engine, machineModel, SimplePowerDriver(ConstantPowerModel(0.0)) ) - val hypervisor = SimFairShareHypervisor(engine, null) + val random = SplittableRandom(1) + val hypervisor = SimFairShareHypervisor(engine, null, random) launch { machine.runWorkload(hypervisor) } |
