diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-08-24 11:33:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-24 11:33:47 +0200 |
| commit | 51515bb255b3b32ca3020419a0c84130a4d8d370 (patch) | |
| tree | 9c16c18af909b8e89ae6fd76cd7365eb46e0712c /opendc-format/src/main/kotlin/org | |
| parent | f03129779a1ec60e8689ad9c7fd5ad488c66f54c (diff) | |
| parent | c46ff4c5cc18ba8a82ee0135f087c4d7aed1e804 (diff) | |
merge: Execute trace fragments based on timestamps
This pull request updates the simulator to execute workload traces based on the fragment's timestamps.
This means that traces will execute their timestamps at the correct time.
* Execute traces based on timestamps
* Record overcommit only after deadline exceeded
* Support trace fragments with zero cores available
* Support unaligned trace fragments
**Breaking API Changes**
* `SimTraceWorkload.Fragment` now requires a `timestamp` parameter.
Diffstat (limited to 'opendc-format/src/main/kotlin/org')
| -rw-r--r-- | opendc-format/src/main/kotlin/org/opendc/format/trace/bitbrains/BitbrainsTraceReader.kt | 7 | ||||
| -rw-r--r-- | opendc-format/src/main/kotlin/org/opendc/format/trace/swf/SwfTraceReader.kt | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/opendc-format/src/main/kotlin/org/opendc/format/trace/bitbrains/BitbrainsTraceReader.kt b/opendc-format/src/main/kotlin/org/opendc/format/trace/bitbrains/BitbrainsTraceReader.kt index aaf8a240..cd8021fe 100644 --- a/opendc-format/src/main/kotlin/org/opendc/format/trace/bitbrains/BitbrainsTraceReader.kt +++ b/opendc-format/src/main/kotlin/org/opendc/format/trace/bitbrains/BitbrainsTraceReader.kt @@ -85,17 +85,19 @@ public class BitbrainsTraceReader(traceDirectory: File) : TraceReader<SimWorkloa } vmId = vmFile.nameWithoutExtension.trim().toLong() - startTime = min(startTime, values[timestampCol].trim().toLong() - 5 * 60) + val timestamp = values[timestampCol].trim().toLong() - 5 * 60 + startTime = min(startTime, timestamp) cores = values[coreCol].trim().toInt() val cpuUsage = values[cpuUsageCol].trim().toDouble() // MHz requiredMemory = (values[provisionedMemoryCol].trim().toDouble() / 1000).toLong() if (flopsHistory.isEmpty()) { - flopsHistory.add(SimTraceWorkload.Fragment(traceInterval, cpuUsage, cores)) + flopsHistory.add(SimTraceWorkload.Fragment(timestamp, traceInterval, cpuUsage, cores)) } else { if (flopsHistory.last().usage != cpuUsage) { flopsHistory.add( SimTraceWorkload.Fragment( + timestamp, traceInterval, cpuUsage, cores @@ -105,6 +107,7 @@ public class BitbrainsTraceReader(traceDirectory: File) : TraceReader<SimWorkloa val oldFragment = flopsHistory.removeAt(flopsHistory.size - 1) flopsHistory.add( SimTraceWorkload.Fragment( + oldFragment.timestamp, oldFragment.duration + traceInterval, cpuUsage, cores diff --git a/opendc-format/src/main/kotlin/org/opendc/format/trace/swf/SwfTraceReader.kt b/opendc-format/src/main/kotlin/org/opendc/format/trace/swf/SwfTraceReader.kt index 50ab652e..bda392a9 100644 --- a/opendc-format/src/main/kotlin/org/opendc/format/trace/swf/SwfTraceReader.kt +++ b/opendc-format/src/main/kotlin/org/opendc/format/trace/swf/SwfTraceReader.kt @@ -108,7 +108,8 @@ public class SwfTraceReader( for (tick in submitTime until (submitTime + waitTime - sliceDuration) step sliceDuration) { flopsHistory.add( SimTraceWorkload.Fragment( - sliceDuration * 1000L, + tick, + sliceDuration * 1000, 0.0, cores ) @@ -128,6 +129,7 @@ public class SwfTraceReader( ) { flopsHistory.add( SimTraceWorkload.Fragment( + tick, sliceDuration * 1000L, 1.0, cores @@ -138,6 +140,7 @@ public class SwfTraceReader( if (runtimePartialSliceRemainder > 0) { flopsHistory.add( SimTraceWorkload.Fragment( + submitTime + slicedWaitTime + runTime, sliceDuration, runtimePartialSliceRemainder / sliceDuration.toDouble(), cores |
