Skip to content

Commit 1de770c

Browse files
Fixed a small bug in the reading of workflows (#382)
* Fixed a small bug in the reading of workflows * small update * Pushing workload files needed for ExperimentCliTest 3
1 parent 90d4369 commit 1de770c

File tree

6 files changed

+67
-1
lines changed

6 files changed

+67
-1
lines changed

opendc-compute/opendc-compute-workload/src/main/kotlin/org/opendc/compute/workload/ComputeWorkloadLoader.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,14 @@ public class ComputeWorkloadLoader(
175175

176176
if (parents?.isEmpty() == true) {
177177
parentsOutput = null
178-
children = null
179178
} else {
180179
parentsOutput = ArrayList(parents!!)
181180
}
182181

182+
if (children?.isEmpty() == true) {
183+
children = null
184+
}
185+
183186
var deferrable = reader.getBoolean(deferrableCol)
184187
var deadline = reader.getLong(deadlineCol)
185188
if (deferAll) {

opendc-experiments/opendc-experiments-base/src/test/kotlin/org/opendc/experiments/base/ExperimentCliTest.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,18 @@ class ExperimentCliTest {
5757
val someDir = File("output")
5858
someDir.deleteRecursively()
5959
}
60+
61+
/**
62+
* ExperimentCli test 3
63+
* This test runs the experiment defined in the experiment_3.json file.
64+
*
65+
* In this test, a small workflow is executed.
66+
*/
67+
@Test
68+
fun testExperimentCli3() {
69+
ExperimentCommand().main(arrayOf("--experiment-path", "src/test/resources/experiments/experiment_3.json"))
70+
71+
val someDir = File("output")
72+
someDir.deleteRecursively()
73+
}
6074
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "simple",
3+
"topologies": [
4+
{
5+
"pathToFile": "src/test/resources/topologies/workflow_topology.json"
6+
}
7+
],
8+
"workloads": [
9+
{
10+
"pathToFile": "src/test/resources/workloadTraces/workflow_example",
11+
"type": "ComputeWorkload"
12+
}
13+
],
14+
"exportModels": [
15+
{
16+
"exportInterval": 60,
17+
"printFrequency": 168,
18+
"filesToExport": [
19+
"host",
20+
"powerSource",
21+
"service",
22+
"task"
23+
]
24+
}
25+
]
26+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"clusters":
3+
[
4+
{
5+
"name": "C01",
6+
"hosts" :
7+
[
8+
{
9+
"name": "H01",
10+
"cpu":
11+
{
12+
"coreCount": 12,
13+
"coreSpeed": 3300
14+
},
15+
"memory": {
16+
"memorySize": 140457600000
17+
},
18+
"count": 3
19+
}
20+
]
21+
}
22+
]
23+
}

0 commit comments

Comments
 (0)