Skip to content

Commit 61fe80c

Browse files
committed
bug-- in bin/wfbench
1 parent 85079cb commit 61fe80c

3 files changed

Lines changed: 23 additions & 21 deletions

File tree

bin/wfbench

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ def get_parser() -> argparse.ArgumentParser:
543543
"if amounts of work and or input/output file sizes are too small).")
544544
parser.add_argument("--gpu-work", default=None, help="Amount of GPU work.")
545545
parser.add_argument("--time", default=None, help="Time limit (in seconds) to complete "
546-
"the computational portion of the benchmark (overrides CPU and GPU works).")
546+
"the computational portion of the benchmark (overrides CPU and GPU works). "
547+
"Is only approximate since I/O time may make the overall time longer.")
547548
parser.add_argument("--mem", type=float, default=None, help="Maximum memory consumption (in MB).")
548549
parser.add_argument("--output-files", help="Output file names with sizes in bytes as a JSON dictionary "
549550
"(e.g., --output-files {\\\"file1\\\": 1024, \\\"file2\\\": 2048}).")
@@ -591,7 +592,7 @@ def compute_num_chunks(args):
591592
num_chunks_gpu = min(int(args.num_chunks), int(float(args.gpu_work) / min_chunk_size_gpu_work))
592593
else:
593594
num_chunks_gpu = 1
594-
num_chunks = min(num_chunks_cpu, num_chunks_cpu)
595+
num_chunks = min(num_chunks_cpu, num_chunks_gpu)
595596

596597
num_chunks = max(num_chunks, 1) # The above computations may say "zero"
597598
return num_chunks
@@ -624,9 +625,9 @@ def main():
624625
path_cores = pathlib.Path(args.path_cores)
625626
core = lock_core(path_locked, path_cores)
626627

627-
if args.time and (not args.cpu_work and not args.gpu_work):
628-
log_error("If --time is provided, at least one of --cpu-work and --gpu-work must also be provided.")
629-
sys.exit(1)
628+
# if args.time and (not args.cpu_work and not args.gpu_work):
629+
# log_error("If --time is provided, at least one of --cpu-work and --gpu-work must also be provided.")
630+
# sys.exit(1)
630631

631632
# Compute the (feasible) number of chunks based on the arguments
632633
num_chunks = compute_num_chunks(args)
@@ -741,11 +742,12 @@ def main():
741742

742743
# If time based, sleep the required amount of time and kill the process
743744
if args.time:
744-
time.sleep(float(args.time) / num_chunks)
745-
if cpu_benchmark_process is not None:
746-
cpu_benchmark_process.terminate_along_with_children()
747-
if gpu_benchmark_process is not None:
748-
gpu_benchmark_process.terminate()
745+
if cpu_benchmark_process is not None or gpu_benchmark_process is not None:
746+
time.sleep(float(args.time) / num_chunks)
747+
if cpu_benchmark_process is not None:
748+
cpu_benchmark_process.terminate_along_with_children()
749+
if gpu_benchmark_process is not None:
750+
gpu_benchmark_process.terminate()
749751

750752
# Wait for the I/O processes to be done
751753
if io_read_process is not None:

tests/translators_loggers/test_translators_loggers.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,17 +241,17 @@ class TestTranslators:
241241
@pytest.mark.parametrize(
242242
"backend",
243243
[
244-
"swiftt",
245-
"dask",
246-
"parsl",
247-
"nextflow",
248-
"nextflow_subworkflow",
249-
"airflow",
244+
# "swiftt",
245+
# "dask",
246+
# "parsl",
247+
# "nextflow",
248+
# "nextflow_subworkflow",
249+
# "airflow",
250250
"bash",
251-
"taskvine",
252-
"makeflow",
253-
"cwl",
254-
"pegasus",
251+
# "taskvine",
252+
# "makeflow",
253+
# "cwl",
254+
# "pegasus",
255255
])
256256
@pytest.mark.unit
257257
# @pytest.mark.skip(reason="tmp")
@@ -318,5 +318,6 @@ def test_translator(self, backend) -> None:
318318
_compare_workflows(original_workflow, reconstructed_workflow)
319319

320320
# Shutdown the container (weirdly, container is already shutdown by now... not sure how)
321+
time.sleep(100000)
321322
_shutdown_docker_container_and_remove_image(container)
322323

tests/wfbench/test_wfbench.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def _workflow_as_expected(dirpath: pathlib.Path,
5353
with json_path.open("r") as f:
5454
generated_json = json.load(f)
5555

56-
5756
# Check the number of tasks
5857
assert(len(workflow.tasks) == len(generated_json['workflow']['specification']['tasks']))
5958

0 commit comments

Comments
 (0)