diff options
| author | Dante Niewenhuis <d.niewenhuis@hotmail.com> | 2024-10-25 13:32:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-25 13:32:41 +0200 |
| commit | 5a365dbc068f2a8cdfa9813c39cc84bb30e15637 (patch) | |
| tree | 72716d562787b85e03cdc7fe1d30c827054d25a0 /opendc-compute/opendc-compute-topology | |
| parent | 27f5b7dcb05aefdab9b762175d538931face0aba (diff) | |
Rewrote the FlowEngine (#256)
* Removed unused components. Updated tests.
Improved checkpointing model
Improved model, started with SimPowerSource
implemented FailureModels and Checkpointing
First working version
midway commit
first update
All simulation are now run with a single CPU and single MemoryUnit. multi CPUs are combined into one. This is for performance and explainability.
* fixed merge conflicts
* Updated M3SA paths.
* Fixed small typo
Diffstat (limited to 'opendc-compute/opendc-compute-topology')
2 files changed, 11 insertions, 15 deletions
diff --git a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt index e0fba34f..9e637b1b 100644 --- a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt +++ b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/TopologyFactories.kt @@ -28,11 +28,10 @@ import org.opendc.compute.topology.specs.ClusterSpec import org.opendc.compute.topology.specs.HostJSONSpec import org.opendc.compute.topology.specs.HostSpec import org.opendc.compute.topology.specs.TopologySpec -import org.opendc.simulator.compute.SimPsuFactories -import org.opendc.simulator.compute.model.Cpu -import org.opendc.simulator.compute.model.MachineModel -import org.opendc.simulator.compute.model.MemoryUnit -import org.opendc.simulator.compute.power.getPowerModel +import org.opendc.simulator.compute.cpu.getPowerModel +import org.opendc.simulator.compute.models.CpuModel +import org.opendc.simulator.compute.models.MachineModel +import org.opendc.simulator.compute.models.MemoryUnit import java.io.File import java.io.InputStream import java.util.SplittableRandom @@ -120,10 +119,10 @@ private fun HostJSONSpec.toHostSpecs( ): HostSpec { val units = List(cpu.count) { - Cpu( + CpuModel( globalCoreId++, cpu.coreCount, - cpu.coreSpeed.toMHz(), + cpu.coreSpeed.toMHz().toFloat(), ) } @@ -150,7 +149,7 @@ private fun HostJSONSpec.toHostSpecs( hostName, mapOf("cluster" to clusterId), machineModel, - SimPsuFactories.simple(powerModel), + powerModel, ) hostId++ diff --git a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/HostSpec.kt b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/HostSpec.kt index 9857f70a..1956ffde 100644 --- a/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/HostSpec.kt +++ b/opendc-compute/opendc-compute-topology/src/main/kotlin/org/opendc/compute/topology/specs/HostSpec.kt @@ -22,10 +22,8 @@ package org.opendc.compute.topology.specs -import org.opendc.simulator.compute.SimPsuFactories -import org.opendc.simulator.compute.SimPsuFactory -import org.opendc.simulator.compute.model.MachineModel -import org.opendc.simulator.flow2.mux.FlowMultiplexerFactory +import org.opendc.simulator.compute.cpu.CpuPowerModel +import org.opendc.simulator.compute.models.MachineModel import java.util.UUID /** @@ -35,7 +33,7 @@ import java.util.UUID * @param name The name of the host. * @param meta The metadata of the host. * @param model The physical model of the machine. - * @param psuFactory The [SimPsuFactory] to construct the PSU that models the power consumption of the machine. + * @param cpuPowerModel The [SimPsuFactory] to construct the PSU that models the power consumption of the machine. * @param multiplexerFactory The [FlowMultiplexerFactory] that is used to multiplex the virtual machines over the host. */ public data class HostSpec( @@ -43,6 +41,5 @@ public data class HostSpec( val name: String, val meta: Map<String, Any>, val model: MachineModel, - val psuFactory: SimPsuFactory = SimPsuFactories.noop(), - val multiplexerFactory: FlowMultiplexerFactory = FlowMultiplexerFactory.maxMinMultiplexer(), + val cpuPowerModel: CpuPowerModel, ) |
