summaryrefslogtreecommitdiff
path: root/simulator/opendc-format/src
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-25 10:16:49 +0100
committerGitHub <noreply@github.com>2021-03-25 10:16:49 +0100
commit074dee1cbca7b3a024d45a3b9dd7d8b51acdd4ee (patch)
tree62e154b6cc5b22f79f3aa67cf245c40c1332f7b4 /simulator/opendc-format/src
parent6de1ef7424e058603be9ae5a86f0568b40579e5f (diff)
parent69598598be2c248acc49e40607b3dd0998ec1ca5 (diff)
Add advanced energy model to OpenDC (v1)
This pull request is a preparation for the adding an advanced energy model to OpenDC (#90): * Add benchmarks for the `opendc-simulator-compute` module, which enables us to quantify the effect on future changes w.r.t. to the energy model on the performance. * Add `SimResourceTransformer` which can transform resource consumptions. This is useful when transforming from CPU frequency to energy usage for instance. * Move power models to `opendc-simulator-compute` to be able to be used more generically. **Breaking API Changes** * Power models have moved to `opendc-simulator-compute` and now implement the `MachinePowerModel` interface.
Diffstat (limited to 'simulator/opendc-format/src')
-rw-r--r--simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/MachineDef.kt4
-rw-r--r--simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc18/Sc18EnvironmentReader.kt2
-rw-r--r--simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt2
-rw-r--r--simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt2
4 files changed, 5 insertions, 5 deletions
diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/MachineDef.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/MachineDef.kt
index b5b3b84b..c7f7c4dc 100644
--- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/MachineDef.kt
+++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/MachineDef.kt
@@ -22,8 +22,8 @@
package org.opendc.format.environment
-import org.opendc.compute.simulator.power.api.CpuPowerModel
import org.opendc.simulator.compute.SimMachineModel
+import org.opendc.simulator.compute.power.MachinePowerModel
import java.util.*
public data class MachineDef(
@@ -31,5 +31,5 @@ public data class MachineDef(
val name: String,
val meta: Map<String, Any>,
val model: SimMachineModel,
- val powerModel: CpuPowerModel
+ val powerModel: MachinePowerModel
)
diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc18/Sc18EnvironmentReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc18/Sc18EnvironmentReader.kt
index 3da8d0b3..1f080c2d 100644
--- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc18/Sc18EnvironmentReader.kt
+++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc18/Sc18EnvironmentReader.kt
@@ -25,13 +25,13 @@ package org.opendc.format.environment.sc18
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
-import org.opendc.compute.simulator.power.models.ConstantPowerModel
import org.opendc.format.environment.EnvironmentReader
import org.opendc.format.environment.MachineDef
import org.opendc.simulator.compute.SimMachineModel
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.ConstantPowerModel
import java.io.InputStream
import java.util.*
diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt
index 9a06a40f..cf90da68 100644
--- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt
+++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt
@@ -22,13 +22,13 @@
package org.opendc.format.environment.sc20
-import org.opendc.compute.simulator.power.models.LinearPowerModel
import org.opendc.format.environment.EnvironmentReader
import org.opendc.format.environment.MachineDef
import org.opendc.simulator.compute.SimMachineModel
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.LinearPowerModel
import java.io.File
import java.io.FileInputStream
import java.io.InputStream
diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt
index effd0286..c6a19430 100644
--- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt
+++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt
@@ -25,13 +25,13 @@ package org.opendc.format.environment.sc20
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
-import org.opendc.compute.simulator.power.models.LinearPowerModel
import org.opendc.format.environment.EnvironmentReader
import org.opendc.format.environment.MachineDef
import org.opendc.simulator.compute.SimMachineModel
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.LinearPowerModel
import java.io.InputStream
import java.util.*