From 44215bd668c5fa3efe2f57fc577824478b00af57 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 1 Sep 2022 14:38:34 +0200 Subject: refactor(sim/compute): Re-implement using flow2 This change re-implements the OpenDC compute simulator framework using the new flow2 framework for modelling multi-edge flow networks. The re-implementation is written in Java and focusses on performance and clean API surface. --- .../src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'opendc-web') 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 1bc4e938..3aac2630 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 @@ -35,12 +35,12 @@ import org.opendc.experiments.compute.setupHosts import org.opendc.experiments.compute.topology.HostSpec import org.opendc.experiments.compute.trace import org.opendc.experiments.provisioner.Provisioner +import org.opendc.simulator.compute.SimPsuFactories 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.LinearPowerModel -import org.opendc.simulator.compute.power.SimplePowerDriver +import org.opendc.simulator.compute.power.CpuPowerModels import org.opendc.simulator.kotlin.runSimulation import org.opendc.web.proto.runner.Job import org.opendc.web.proto.runner.Scenario @@ -338,15 +338,14 @@ public class OpenDCRunner( } val energyConsumptionW = machine.cpus.sumOf { it.energyConsumptionW } - val powerModel = LinearPowerModel(2 * energyConsumptionW, energyConsumptionW * 0.5) - val powerDriver = SimplePowerDriver(powerModel) + val powerModel = CpuPowerModels.linear(2 * energyConsumptionW, energyConsumptionW * 0.5) val spec = HostSpec( UUID(random.nextLong(), random.nextLong()), "node-$clusterId-$position", mapOf("cluster" to clusterId), MachineModel(processors, memoryUnits), - powerDriver + SimPsuFactories.simple(powerModel) ) res += spec -- cgit v1.2.3 From 290e1fe14460d91e4703e55ac5f05dbe7b4505f7 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 12 Oct 2022 21:53:53 +0200 Subject: fix: Add log4j-core dependency This change adds the log4j-core dependency to various modules of OpenDC using log4j2, to ensure logging keeps working. The upgrade to SLF4J 2.0 broke the Log4j2 functionality, since the log4j-core artifact is not automatically shipped with the SLF4J implementation. --- opendc-web/opendc-web-runner/build.gradle.kts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'opendc-web') diff --git a/opendc-web/opendc-web-runner/build.gradle.kts b/opendc-web/opendc-web-runner/build.gradle.kts index 2679a97f..531a9631 100644 --- a/opendc-web/opendc-web-runner/build.gradle.kts +++ b/opendc-web/opendc-web-runner/build.gradle.kts @@ -58,10 +58,11 @@ dependencies { runtimeOnly(projects.opendcTrace.opendcTraceBitbrains) cliImplementation(libs.clikt) - cliImplementation(libs.sentry.log4j2) cliRuntimeOnly(projects.opendcTrace.opendcTraceOpendc) + cliRuntimeOnly(libs.log4j.core) cliRuntimeOnly(libs.log4j.slf4j) + cliRuntimeOnly(libs.sentry.log4j2) } val createCli by tasks.creating(CreateStartScripts::class) { -- cgit v1.2.3