Skip to content

Commit

Permalink
added workflow makespan
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff-yc-wong committed Feb 27, 2025
1 parent b360a5d commit a712069
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docker/start_docker.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
docker run --cpus=1 --name parsl-worker-1 -d -p 2222:22 -v $(pwd)/output:$(pwd)/output -v $(pwd)/data:$(pwd)/data -v $(pwd)/logs:/root/logs parsl-worker 2
docker run --cpus=1 --name parsl-worker-2 -d -p 2223:22 -v $(pwd)/output:$(pwd)/output -v $(pwd)/data:$(pwd)/data -v $(pwd)/logs:/root/logs parsl-worker 1
docker run --hostname worker1 --cpus=1 --name parsl-worker-1 -d -p 2222:22 -v $(pwd)/output:$(pwd)/output -v $(pwd)/data:$(pwd)/data -v $(pwd)/logs:/root/logs parsl-worker 2
docker run --hostname worker2 --cpus=1 --name parsl-worker-2 -d -p 2223:22 -v $(pwd)/output:$(pwd)/output -v $(pwd)/data:$(pwd)/data -v $(pwd)/logs:/root/logs parsl-worker 1
1 change: 1 addition & 0 deletions translator/templates/parsl_template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import parsl
import time
import multiprocessing
from pathlib import Path
import logging
Expand Down
5 changes: 4 additions & 1 deletion translator/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ def _parsl_wftasks_codelines(self) -> None:
codelines.extend(code)

cleanup_code = [
"print('Starting workflow...'",
"start_time = time.perf_counter()",
"barrier()",
"",
"try:",
Expand All @@ -183,6 +185,7 @@ def _parsl_wftasks_codelines(self) -> None:
" raise e",
"else:",
" print('Workflow completed successfully')",
" print('Time Taken: ', time.perf_counter() - start_time)",
"finally:",
" # Releasing all resources, and shutting down all executors and workers",
" parsl.dfk().cleanup()",
Expand All @@ -200,7 +203,7 @@ def get_parser() -> argparse.ArgumentParser:

parser.add_argument(
"wfformat_file", help="path to WfFormat JSON input file")
parser.add_argument("--outdir", default=pathlib.Path.cwd().joinpath("output"),
parser.add_argument("--outdir", default=pathlib.Path.cwd().joinpath("parsl_script"),
help="Output directory in which to store the translated files")

return parser
Expand Down
16 changes: 8 additions & 8 deletions translator/wf_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def main():
parser = argparse.ArgumentParser(description="Process a workflow JSON file.")
parser.add_argument("--workflow", type=str, required=True, help="Path to the workflow JSON file.")
parser.add_argument("--workflow", type=str, help="Path to the workflow JSON file.")
parser.add_argument("--test", action="store_true", help="Create a test benchmark")

args = parser.parse_args()
Expand All @@ -22,13 +22,13 @@ def main():
# create a workflow benchmark object to generate specifications based on a Montage recipe (small benchmark for testing)
benchmark = WorkflowBenchmark(recipe=MontageRecipe, num_tasks=60)
# generate a specification based on performance characteristics
path = benchmark.create_benchmark(pathlib.Path("./montage"), cpu_work=100, data=10, percent_cpu=0.6)

# create a workflow benchmark from a synthetic workflow (workflow used in the fgcs paper)
workflow_instance = Instance(args.workflow)
benchmark = WorkflowBenchmark(recipe=SoykbRecipe, num_tasks=156)
output_path = pathlib.Path(f"./benchmarks/{workflow_instance.name}")
path = benchmark.create_benchmark_from_synthetic_workflow(output_path, workflow_instance.workflow)
path = benchmark.create_benchmark(pathlib.Path("./benchmarks/montage"), cpu_work=100, data=10, percent_cpu=0.6)
if args.workflow:
# create a workflow benchmark from a synthetic workflow (workflow used in the fgcs paper)
workflow_instance = Instance(args.workflow)
benchmark = WorkflowBenchmark(recipe=SoykbRecipe, num_tasks=156)
output_path = pathlib.Path(f"./benchmarks/{workflow_instance.name}")
path = benchmark.create_benchmark_from_synthetic_workflow(output_path, workflow_instance.workflow)


if __name__ == "__main__":
Expand Down

0 comments on commit a712069

Please sign in to comment.