summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-05-13 17:08:07 +0200
committerGeorgios Andreadis <info@gandreadis.com>2020-05-13 17:08:07 +0200
commit3536386080db1794b8e74c79a221e7b6e214b37c (patch)
treebfbfbfb183e88d6a3f9009c95e37391af5d5627a
parentbf98c6fcdd59787d196619febd0d99ce2dccda33 (diff)
Add filtering option
-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 {