From c9750e52a10157f3838b934fed4f04fae69c539a Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 31 Oct 2022 15:02:37 +0100 Subject: feat(sim/compute): Add support for snapshotting workloads This change updates the interface of `SimWorkload` to support snapshotting workloads. We introduce a new method `snapshot()` to this interface which returns a new `SimWorkload` that can be started at a later point in time and on another `SimMachine`, which continues progress from the moment the workload was snapshotted. --- .../src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'opendc-experiments/opendc-experiments-tf20') diff --git a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt index a7fc102a..eb308970 100644 --- a/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt +++ b/opendc-experiments/opendc-experiments-tf20/src/main/kotlin/org/opendc/experiments/tf20/core/SimTFDevice.kt @@ -127,6 +127,8 @@ public class SimTFDevice( output = null } + override fun snapshot(): SimWorkload = throw UnsupportedOperationException() + override fun onUpdate(ctx: FlowStage, now: Long): Long { val output = output ?: return Long.MAX_VALUE val lastPull = lastPull -- cgit v1.2.3