Skip to content

Commit 50e42f9

Browse files
committed
Updated the create_benchmark() method to allow specifying the number of
chunks for each task execution
1 parent 2feb997 commit 50e42f9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

wfcommons/wfbench/bench.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ def create_benchmark(self,
252252
percent_cpu: Union[float, Dict[str, float]] = 0.6,
253253
cpu_work: Union[int, Dict[str, int]] = None,
254254
gpu_work: Union[int, Dict[str, int]] = None,
255+
num_chunks: Optional[int] = 10,
255256
time: Optional[int] = None,
256257
data: Optional[int] = 0,
257258
mem: Optional[float] = None,
@@ -269,6 +270,8 @@ def create_benchmark(self,
269270
:type cpu_work: Union[int, Dict[str, int]]
270271
:param gpu_work: GPU work per workflow task.
271272
:type gpu_work: Union[int, Dict[str, int]]
273+
:param num_chunks: Number of chunks for pipelining I/O and computation for each task execution.
274+
:type num_chunks: Optional[int]
272275
:param time: Time limit for running each task (in seconds).
273276
:type time: Optional[int]
274277
:param data: Total workflow data footprint (in MB).
@@ -308,6 +311,7 @@ def create_benchmark(self,
308311
cpu_work,
309312
gpu_work,
310313
time,
314+
num_chunks,
311315
mem,
312316
lock_files_folder,
313317
cores,
@@ -367,6 +371,7 @@ def _set_argument_parameters(self,
367371
cpu_work: Union[int, Dict[str, int]],
368372
gpu_work: Union[int, Dict[str, int]],
369373
time: Optional[int],
374+
num_chunks: Optional[int],
370375
mem: Optional[float],
371376
lock_files_folder: Optional[pathlib.Path],
372377
cores: Optional[pathlib.Path],
@@ -381,6 +386,7 @@ def _set_argument_parameters(self,
381386
params.extend(cpu_params)
382387
gpu_params = self._generate_task_gpu_params(task, gpu_work)
383388
params.extend(gpu_params)
389+
params.extend([f"--num-chunks {num_chunks}"])
384390

385391
if mem:
386392
params.extend([f"--mem {mem}"])

0 commit comments

Comments
 (0)