summaryrefslogtreecommitdiff
path: root/simulator/opendc-compute
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-04-14 23:01:36 +0200
committerGitHub <noreply@github.com>2021-04-14 23:01:36 +0200
commit890dd87376f0d131292e3cdc685ab13192d11634 (patch)
tree4e27c85cf36609b2cf5881cfb696b05fbc65530a /simulator/opendc-compute
parentaf3546a9d658ccce0d59400a7218c8edf5a7ce5c (diff)
parent86b5df211938a8f9a391f143ccab5ccdf4a5d59e (diff)
harness: Fix issues with web runner (#117)
This pull request addresses several issues that were present in the web runner and the associated experiments: * Enable failures only when user requests it * Simplify power usage calculation (directly from J to Wh) * Fix issue with multiple socket machines. * Fix filter scheduler weights **Breaking API Changes** * `ScalingContext` now only exposes a `SimProcessingUnit` instead of a `ProcessingUnit` and `SimResourceSource`.
Diffstat (limited to 'simulator/opendc-compute')
-rw-r--r--simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt8
1 files changed, 2 insertions, 6 deletions
diff --git a/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
index ea775efc..6d87e444 100644
--- a/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
+++ b/simulator/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt
@@ -296,7 +296,6 @@ public class SimHost(
override fun close() {
scope.cancel()
machine.close()
- _state = HostState.DOWN
}
override fun toString(): String = "SimHost[uid=$uid,name=$name,model=$model]"
@@ -389,7 +388,7 @@ public class SimHost(
assert(job == null) { "Concurrent job running" }
val workload = mapper.createWorkload(server)
- val job = scope.launch {
+ job = scope.launch {
delay(1) // TODO Introduce boot time
init()
cont.resume(Unit)
@@ -400,12 +399,9 @@ public class SimHost(
exit(cause)
} finally {
machine.close()
+ job = null
}
}
- this.job = job
- job.invokeOnCompletion {
- this.job = null
- }
}
private fun init() {