summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-compute
diff options
context:
space:
mode:
authorDante Niewenhuis <d.niewenhuis@hotmail.com>2025-01-10 14:34:50 +0100
committerGitHub <noreply@github.com>2025-01-10 14:34:50 +0100
commit192ca10f332c58d38d129709c64dd69c284683f5 (patch)
tree489d182bdc114631e37a5bb8306fceb529f374c2 /opendc-simulator/opendc-simulator-compute
parentf71e07f55a5176c5bd5447cdb3bcfebf2f5f47ee (diff)
Restructured Testing files (#287)
Diffstat (limited to 'opendc-simulator/opendc-simulator-compute')
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/workload/CheckpointModel.java2
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/workload/SimTraceWorkload.java5
2 files changed, 6 insertions, 1 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/workload/CheckpointModel.java b/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/workload/CheckpointModel.java
index f4f7cdd6..6cc67e3f 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/workload/CheckpointModel.java
+++ b/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/workload/CheckpointModel.java
@@ -73,7 +73,7 @@ public class CheckpointModel extends FlowNode {
simWorkload.makeSnapshot(now);
// start new fragment
- this.startOfInterval = now - passedTime;
+ this.startOfInterval = now;
// Scale the interval time between checkpoints based on the provided scaling
this.checkpointInterval = (long) (this.checkpointInterval * this.checkpointIntervalScaling);
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/workload/SimTraceWorkload.java b/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/workload/SimTraceWorkload.java
index 0735d8ae..9b12b1e3 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/workload/SimTraceWorkload.java
+++ b/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/workload/SimTraceWorkload.java
@@ -173,6 +173,11 @@ public class SimTraceWorkload extends SimWorkload implements FlowConsumer {
long passedTime = getPassedTime(now);
long remainingTime = currentFragment.duration() - passedTime;
+ // If this is the end of the Task, don't make a snapshot
+ if (remainingTime <= 0 && remainingFragments.isEmpty()) {
+ return;
+ }
+
// Create a new fragment based on the current fragment and remaining duration
TraceFragment newFragment =
new TraceFragment(remainingTime, currentFragment.cpuUsage(), currentFragment.coreCount());