summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-runner/src
diff options
context:
space:
mode:
authorDante Niewenhuis <d.niewenhuis@hotmail.com>2024-09-16 11:29:26 +0200
committerGitHub <noreply@github.com>2024-09-16 11:29:26 +0200
commit4a010c6b9e033314a2624a0756dcdc7f17010d9d (patch)
tree70dc26e98cf8421eb5db7f62cf63d4ea2399c505 /opendc-web/opendc-web-runner/src
parent5047e4a25a0814f96852882f02c4017e1d5f81e7 (diff)
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)
Diffstat (limited to 'opendc-web/opendc-web-runner/src')
-rw-r--r--opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt16
1 files changed, 5 insertions, 11 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 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),
)