From 4a010c6b9e033314a2624a0756dcdc7f17010d9d Mon Sep 17 00:00:00 2001 From: Dante Niewenhuis Date: Mon, 16 Sep 2024 11:29:26 +0200 Subject: All simulation are now run with a single CPU and single MemoryUnit. multi CPUs are combined into one. This is for performance and explainability. (#255) --- .../org/opendc/compute/topology/TopologyFactories.kt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'opendc-compute/opendc-compute-topology/src') 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 d4d4bfe3..e0fba34f 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 @@ -29,10 +29,9 @@ 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.model.ProcessingNode -import org.opendc.simulator.compute.model.ProcessingUnit import org.opendc.simulator.compute.power.getPowerModel import java.io.File import java.io.InputStream @@ -119,14 +118,20 @@ private fun HostJSONSpec.toHostSpecs( clusterId: Int, random: RandomGenerator, ): HostSpec { - val unknownProcessingNode = ProcessingNode("unknown", "unknown", "unknown", cpu.coreCount) - val units = List(cpu.count) { ProcessingUnit(unknownProcessingNode, globalCoreId++, cpu.coreSpeed.toMHz()) } + val units = + List(cpu.count) { + Cpu( + globalCoreId++, + cpu.coreCount, + cpu.coreSpeed.toMHz(), + ) + } val unknownMemoryUnit = MemoryUnit(memory.vendor, memory.modelName, memory.memorySpeed.toMHz(), memory.memorySize.toMiB().toLong()) val machineModel = MachineModel( units, - listOf(unknownMemoryUnit), + unknownMemoryUnit, ) val powerModel = -- cgit v1.2.3