summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-compute/src/test
diff options
context:
space:
mode:
authorDante Niewenhuis <d.niewenhuis@hotmail.com>2024-10-29 10:52:38 +0100
committerGitHub <noreply@github.com>2024-10-29 10:52:38 +0100
commit2325c62377e7c94e768a22807e107a9714626bfc (patch)
treea9aa8288c753714ba5c50146e08810c0a479f479 /opendc-simulator/opendc-simulator-compute/src/test
parent5a365dbc068f2a8cdfa9813c39cc84bb30e15637 (diff)
Updated all floats to Doubles (#257)
* Updated tests Changed all floats into doubles to have consistency over the whole framework Made a small update to the multiplexer to better push through supply and demand Fixed small typo Updated M3SA paths. fixed merge conflicts 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. * Updated test memory
Diffstat (limited to 'opendc-simulator/opendc-simulator-compute/src/test')
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/SimMachineTest.kt64
1 files changed, 28 insertions, 36 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/SimMachineTest.kt b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/SimMachineTest.kt
index 2b6a922e..173c60e7 100644
--- a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/SimMachineTest.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/SimMachineTest.kt
@@ -22,18 +22,10 @@
package org.opendc.simulator.compute
-import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.BeforeEach
-import org.junit.jupiter.api.Test
-import org.opendc.simulator.compute.cpu.CpuPowerModels
-import org.opendc.simulator.compute.machine.SimMachine
import org.opendc.simulator.compute.models.CpuModel
import org.opendc.simulator.compute.models.MachineModel
import org.opendc.simulator.compute.models.MemoryUnit
-import org.opendc.simulator.compute.workload.TraceWorkload
-import org.opendc.simulator.engine.FlowEngine
-import org.opendc.simulator.kotlin.runSimulation
-import java.util.concurrent.ThreadLocalRandom
/**
* Test suite for the [SimBareMetalMachine] class.
@@ -48,7 +40,7 @@ class SimMachineTest {
CpuModel(
0,
2,
- 1000.0f,
+ 1000.0,
"Intel",
"Xeon",
"amd64",
@@ -75,33 +67,33 @@ class SimMachineTest {
// assertEquals(1000, timeSource.millis())
// }
- @Test
- fun testTraceWorkload() =
- runSimulation {
- val random = ThreadLocalRandom.current()
- val builder = TraceWorkload.builder()
- repeat(100) {
- builder.add(1000, random.nextDouble(0.0, 4500.0), 1)
- }
- val traceWorkload = builder.build()
-
- val engine = FlowEngine.create(dispatcher)
- val graph = engine.newGraph()
- val simMachine =
- SimMachine(
- graph,
- machineModel,
- CpuPowerModels.constant(0.0),
- ) { cause ->
- }
-
- val virtualMachine =
- simMachine.startWorkload(traceWorkload) { cause ->
- assertEquals(100000, timeSource.millis())
- }
-
- // Two cores execute 1000 MFlOps per second (1000 ms)
- }
+// @Test
+// fun testTraceWorkload() =
+// runSimulation {
+// val random = ThreadLocalRandom.current()
+// val builder = TraceWorkload.builder()
+// repeat(100) {
+// builder.add(1000, random.nextDouble(0.0, 4500.0), 1)
+// }
+// val traceWorkload = builder.build()
+//
+// val engine = FlowEngine.create(dispatcher)
+// val graph = engine.newGraph()
+// val simMachine =
+// SimMachine(
+// graph,
+// machineModel,
+// CpuPowerModels.constant(0.0),
+// ) { cause ->
+// }
+//
+// val virtualMachine =
+// simMachine.startWorkload(traceWorkload) { cause ->
+// assertEquals(100000, timeSource.millis())
+// }
+//
+// // Two cores execute 1000 MFlOps per second (1000 ms)
+// }
// @Test
// fun testDualSocketMachine() =