From 25959186c73ec050c4316411b7c667f35f04c88a Mon Sep 17 00:00:00 2001 From: Steven Hahn Date: Fri, 8 May 2026 11:18:27 -0400 Subject: [PATCH 1/6] adjust num_chunks after fixing bug in PR #152. Signed-off-by: Steven Hahn --- bin/wfbench | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/wfbench b/bin/wfbench index 252b87b1..0bd3242d 100755 --- a/bin/wfbench +++ b/bin/wfbench @@ -387,8 +387,8 @@ def compute_num_chunks(time_limit, cpu_work, gpu_work, num_chunks): # Compute the (feasible number of chunks) min_chunk_size_time = 1 # At least 1 second per chunk, if we're doing time-based # TODO: Pick reasonable factors below so that a chunk takes about min_chunk_size_time sec on a reasonable machine - min_chunk_size_cpu_work = 3000000 * min_chunk_size_time # 1s on my MacBook Pro - min_chunk_size_gpu_work = 30000000 * min_chunk_size_time # unknown..... + min_chunk_size_cpu_work = 200 * min_chunk_size_time # 1s on my MacBook Pro + min_chunk_size_gpu_work = 2000 * min_chunk_size_time # unknown..... if time_limit: num_chunks = min(num_chunks, time_limit // min_chunk_size_time) From c1abaabaad52fd7f9ee19f48d985e5c85e8604cc Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Fri, 8 May 2026 11:13:21 -1000 Subject: [PATCH 2/6] Turned --silent into --verbose (since --silent mistakenly implemented a verbose behavior!) --- bin/wfbench | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/wfbench b/bin/wfbench index 0bd3242d..dbe579e4 100755 --- a/bin/wfbench +++ b/bin/wfbench @@ -358,7 +358,7 @@ def get_parser() -> argparse.ArgumentParser: "(e.g., --output-files {\\\"file1\\\": 1024, \\\"file2\\\": 2048}).") parser.add_argument("--input-files", help="Input files names as a JSON array " "(e.g., --input-files [\\\"file3\\\", \\\"file4\\\"]).") - parser.add_argument("--silent", action="store_true", help="Disable all log messages.") + parser.add_argument("--verbose", action="store_true", help="Enable all log messages.") parser.add_argument("--debug", action="store_true", help="Enable debug log messages.") parser.add_argument("--with-flowcept", action="store_true", default=False, help="Enable Flowcept monitoring.") parser.add_argument("--workflow_id", default=None, help="Id to group tasks in a workflow.") @@ -412,7 +412,7 @@ def kill_current_handles(handles: list[ProcessHandle]): handle.terminate_along_with_children() -def run(workflow_id, name, with_flowcept, silent, debug, rundir, path_lock, path_cores, +def run(workflow_id, name, with_flowcept, verbose, debug, rundir, path_lock, path_cores, time_limit, cpu_work, percent_cpu, mem, gpu_work, num_chunks, input_files, output_files): """Main function.""" @@ -423,7 +423,7 @@ def run(workflow_id, name, with_flowcept, silent, debug, rundir, path_lock, path flowcept = None flowcept_task = None - if silent: + if verbose: logging.getLogger().setLevel(logging.NOTSET) if debug: logging.getLogger().setLevel(logging.DEBUG) From d2cc8ec914712184ecfc0551eaa667feaafbf1ee Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Fri, 8 May 2026 14:21:36 -1000 Subject: [PATCH 3/6] swift/t silent->verbose fix --- wfcommons/wfbench/translator/templates/swift_t/workflow.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfcommons/wfbench/translator/templates/swift_t/workflow.swift b/wfcommons/wfbench/translator/templates/swift_t/workflow.swift index 3b5c4c81..7d700ddc 100644 --- a/wfcommons/wfbench/translator/templates/swift_t/workflow.swift +++ b/wfcommons/wfbench/translator/templates/swift_t/workflow.swift @@ -123,7 +123,7 @@ mod.run( output_files=f'{{"{output_file}": {output_file_size}}}', input_files=str(input_file).replace("'", '"'), with_flowcept=bool(workflow_id), - silent=False, + verbose=False, debug=False, rundir=None, path_lock=None, From b7c832edc31cca2fc8aad5d4d290fbfd31e5a8dc Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Fri, 8 May 2026 15:44:17 -1000 Subject: [PATCH 4/6] Chunk size computation bug fix --- bin/wfbench | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/wfbench b/bin/wfbench index dbe579e4..73c9537b 100755 --- a/bin/wfbench +++ b/bin/wfbench @@ -396,12 +396,18 @@ def compute_num_chunks(time_limit, cpu_work, gpu_work, num_chunks): if cpu_work: num_chunks_cpu = min(num_chunks, cpu_work // min_chunk_size_cpu_work) else: - num_chunks_cpu = 1 + num_chunks_cpu = None if gpu_work: num_chunks_gpu = min(num_chunks, gpu_work // min_chunk_size_gpu_work) else: - num_chunks_gpu = 1 - num_chunks = min(num_chunks_cpu, num_chunks_gpu) + num_chunks_gpu = None + + if num_chunks_cpu is None: + num_chunks = num_chunks_gpu + elif num_chunks_gpu is None: + num_chunks = num_chunks_cpu + else: + num_chunks = min(num_chunks_cpu, num_chunks_gpu) num_chunks = max(num_chunks, 1) # The above computations may say "zero" return num_chunks From 43a96137f430027f1d0fcf53d13226f8730abb4f Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Fri, 8 May 2026 16:02:11 -1000 Subject: [PATCH 5/6] Changed the min_chunk_size_cpu_work value to 2500 so that the benchmark runs in 1s on Henri's laptop (this matching the comment in the code) --- bin/wfbench | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/wfbench b/bin/wfbench index 73c9537b..4685f61d 100755 --- a/bin/wfbench +++ b/bin/wfbench @@ -387,7 +387,7 @@ def compute_num_chunks(time_limit, cpu_work, gpu_work, num_chunks): # Compute the (feasible number of chunks) min_chunk_size_time = 1 # At least 1 second per chunk, if we're doing time-based # TODO: Pick reasonable factors below so that a chunk takes about min_chunk_size_time sec on a reasonable machine - min_chunk_size_cpu_work = 200 * min_chunk_size_time # 1s on my MacBook Pro + min_chunk_size_cpu_work = 2500 * min_chunk_size_time # 1s on Henri's MacBook Pro min_chunk_size_gpu_work = 2000 * min_chunk_size_time # unknown..... if time_limit: From cec2f74a2704167fd6ca639a73b450acda0db2bf Mon Sep 17 00:00:00 2001 From: Henri Casanova Date: Fri, 8 May 2026 16:20:21 -1000 Subject: [PATCH 6/6] Better error catching for command-line arguments --- bin/wfbench | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/wfbench b/bin/wfbench index 4685f61d..90980e46 100755 --- a/bin/wfbench +++ b/bin/wfbench @@ -612,6 +612,9 @@ def main(): if not args.time_limit and (not args.cpu_work and not args.gpu_work): log_error("At least one of --time-limit, --cpu-work, or --gpu-work should be provided.") sys.exit(1) + if args.time_limit and (not args.cpu_work and not args.gpu_work): + log_error("In addition to --time-limit, at least one of --cpu-work or --gpu-work must be provided (to specify which kind of work should be done).") + sys.exit(1) run(**vars(args))