Skip to content

Commit f3d5cc0

Browse files
committed
feat: default cpu_work uses runtime values
1 parent c2f8312 commit f3d5cc0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

wfcommons/wfbench/bench.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ def create_benchmark_from_synthetic_workflow(
115115
json_path = save_dir.joinpath(
116116
f"{self.workflow.name.lower()}-{self.num_tasks}").with_suffix(".json")
117117

118+
# if no cpu_work is provided, use the maximum runtime of each task as a reference
119+
if cpu_work is None:
120+
cpu_work = {}
121+
for task in self.workflow.tasks.values():
122+
if task.category not in cpu_work or task.runtime > cpu_work[task.category]:
123+
cpu_work[task.category] = task.runtime
124+
for key in cpu_work.keys():
125+
cpu_work[key] *= 1000
126+
118127
cores, lock = self._creating_lock_files(lock_files_folder)
119128

120129
max_runtime = max(task.runtime for task in self.workflow.tasks.values())

0 commit comments

Comments
 (0)