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) --- .../main/kotlin/org/opendc/web/runner/OpenDCRunner.kt | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'opendc-web/opendc-web-runner/src') 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 18af0d1a..af9d5529 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 @@ -37,10 +37,9 @@ import org.opendc.compute.workload.sampleByLoad import org.opendc.compute.workload.trace import org.opendc.experiments.base.runner.replay 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.CpuPowerModels import org.opendc.simulator.kotlin.runSimulation import org.opendc.web.proto.runner.Job @@ -325,15 +324,10 @@ public class OpenDCRunner( val position = machine.position val processors = - machine.cpus.flatMap { cpu -> - val cores = cpu.numberOfCores - val speed = cpu.clockRateMhz - // TODO: Remove hard coding of vendor - val node = ProcessingNode("Intel", "amd64", cpu.name, cores) - List(cores) { coreId -> - ProcessingUnit(node, coreId, speed) - } + machine.cpus.map { cpu -> + Cpu(0, cpu.numberOfCores, cpu.clockRateMhz, "Intel", "amd64", cpu.name) } + val memoryUnits = machine.memory.map { memory -> MemoryUnit( @@ -352,7 +346,7 @@ public class OpenDCRunner( UUID(random.nextLong(), random.nextLong()), "node-$clusterId-$position", mapOf("cluster" to clusterId), - MachineModel(processors, memoryUnits), + MachineModel(processors, memoryUnits[0]), SimPsuFactories.simple(powerModel), ) -- cgit v1.2.3