diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-09-01 14:38:34 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-21 22:13:04 +0200 |
| commit | 44215bd668c5fa3efe2f57fc577824478b00af57 (patch) | |
| tree | b933228e5e5748716351dc9ce031b4840f254428 /opendc-web/opendc-web-runner/src/main | |
| parent | c1f67a872e2d7ce63ac96f8ca80cbe8b25c62e3b (diff) | |
refactor(sim/compute): Re-implement using flow2
This change re-implements the OpenDC compute simulator framework using
the new flow2 framework for modelling multi-edge flow networks. The
re-implementation is written in Java and focusses on performance and
clean API surface.
Diffstat (limited to 'opendc-web/opendc-web-runner/src/main')
| -rw-r--r-- | opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt index 1bc4e938..3aac2630 100644 --- a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt +++ b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt @@ -35,12 +35,12 @@ import org.opendc.experiments.compute.setupHosts import org.opendc.experiments.compute.topology.HostSpec import org.opendc.experiments.compute.trace import org.opendc.experiments.provisioner.Provisioner +import org.opendc.simulator.compute.SimPsuFactories import org.opendc.simulator.compute.model.MachineModel 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.LinearPowerModel -import org.opendc.simulator.compute.power.SimplePowerDriver +import org.opendc.simulator.compute.power.CpuPowerModels import org.opendc.simulator.kotlin.runSimulation import org.opendc.web.proto.runner.Job import org.opendc.web.proto.runner.Scenario @@ -338,15 +338,14 @@ public class OpenDCRunner( } val energyConsumptionW = machine.cpus.sumOf { it.energyConsumptionW } - val powerModel = LinearPowerModel(2 * energyConsumptionW, energyConsumptionW * 0.5) - val powerDriver = SimplePowerDriver(powerModel) + val powerModel = CpuPowerModels.linear(2 * energyConsumptionW, energyConsumptionW * 0.5) val spec = HostSpec( UUID(random.nextLong(), random.nextLong()), "node-$clusterId-$position", mapOf("cluster" to clusterId), MachineModel(processors, memoryUnits), - powerDriver + SimPsuFactories.simple(powerModel) ) res += spec |
