summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/swf/SwfTraceReader.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/swf/SwfTraceReader.kt b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/swf/SwfTraceReader.kt
index 7a2c704b..2f6ce238 100644
--- a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/swf/SwfTraceReader.kt
+++ b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/swf/SwfTraceReader.kt
@@ -43,7 +43,8 @@ import java.util.UUID
* @param file The trace file.
*/
class SwfTraceReader(
- file: File
+ file: File,
+ maxNumCores: Int = -1
) : TraceReader<VmWorkload> {
/**
* The internal iterator to use for this reader.
@@ -93,6 +94,11 @@ class SwfTraceReader(
cores = values[numAllocatedCoresCol].trim().toInt()
memory = values[requestedMemoryCol].trim().toLong()
+ if (maxNumCores != -1 && cores > maxNumCores) {
+ println("Skipped a task due to processor count ($cores > $maxNumCores).")
+ return@forEach
+ }
+
if (memory == -1L) {
memory = 1000L * cores // assume 1GB of memory per processor if not specified
} else {