11#!/usr/bin/env python3
22# -*- coding: utf-8 -*-
33#
4- # Copyright (c) 2021-2022 The WfCommons Team.
4+ # Copyright (c) 2021-2023 The WfCommons Team.
55#
66# This program is free software: you can redistribute it and/or modify
77# it under the terms of the GNU General Public License as published by
@@ -79,7 +79,9 @@ def create_benchmark(self,
7979 percent_cpu : Union [float , Dict [str , float ]] = 0.6 ,
8080 cpu_work : Union [int , Dict [str , int ]] = None ,
8181 gpu_work : Union [int , Dict [str , int ]] = None ,
82+ time : Optional [int ] = None ,
8283 data : Optional [Union [int , Dict [str , str ]]] = None ,
84+ mem : Optional [float ] = None ,
8385 lock_files_folder : Optional [pathlib .Path ] = None ,
8486 regenerate : Optional [bool ] = True ) -> pathlib .Path :
8587 """Create a workflow benchmark.
@@ -90,8 +92,12 @@ def create_benchmark(self,
9092 :type percent_cpu: Union[float, Dict[str, float]]
9193 :param cpu_work: CPU work per workflow task.
9294 :type cpu_work: Union[int, Dict[str, int]]
95+ :param time: Time limit for running each task (in seconds).
96+ :type time: Optional[int]
9397 :param data: Dictionary of input size files per workflow task type or total workflow data footprint (in MB).
9498 :type data: Optional[Union[int, Dict[str, str]]]
99+ :param mem: Maximum amount of memory consumption per task (in MB).
100+ :type mem: Optional[float]
95101 :param lock_files_folder:
96102 :type lock_files_folder: Optional[pathlib.Path]
97103 :param regenerate: Whether to regenerate the workflow tasks
@@ -150,9 +156,15 @@ def create_benchmark(self,
150156
151157 params .extend ([f"--gpu-work { _gpu_work } " ])
152158
159+ if mem :
160+ params .extend ([f"--mem { mem } " ])
161+
162+ if time :
163+ params .extend ([f"--time { time } " ])
164+
153165 task .runtime = 0
154166 task .files = []
155- task .program = f" { this_dir . joinpath ( ' wfbench.py' ) } "
167+ task .program = " wfbench.py"
156168 task .args = [task .name ]
157169 task .args .extend (params )
158170
0 commit comments