Skip to content

Commit 1bde636

Browse files
committed
feat: fine tune task cores
1 parent 7b7c568 commit 1bde636

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

wfcommons/wfbench/bench.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def create_benchmark_from_synthetic_workflow(
135135
task_runtime_factor = task.runtime / task_max_runtimes[task.category]
136136
# scale argument parameters to achieve a runtime distribution
137137
task_percent_cpu = percent_cpu[task.category] * task_runtime_factor if isinstance(percent_cpu, dict) else percent_cpu * runtime_factor
138+
task_cores = int(10 * task_percent_cpu) # set number of cores to cpu threads in wfbench.py
138139
task_percent_cpu = max(0.1, task_percent_cpu) # set minimum to 0.1 which is equivalent to 1 thread in wfbench.py
139140
task_percent_cpu = round(task_percent_cpu, 2)
140141
if cpu_work is not None:
@@ -159,7 +160,7 @@ def create_benchmark_from_synthetic_workflow(
159160
cores,
160161
lock
161162
)
162-
task.cores = int(10 * task_percent_cpu) # set number of cores to cpu threads in wfbench.py
163+
task.cores = task_cores + 1
163164
if task_memory:
164165
task.memory = task_memory
165166

0 commit comments

Comments
 (0)