Skip to content

Commit

Permalink
🎨 add gpu option
Browse files Browse the repository at this point in the history
  • Loading branch information
Wytamma authored Aug 10, 2023
1 parent 79a721b commit 67e0170
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pybeast/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ def create_beast_run_command(
json_path: Path,
seed: int,
resume: bool,
gpu: bool,
):
"""Create the BEAST run command"""

cmd = Command("beast")

if resume:
cmd.add_arg("-resume")
cmd.add_arg("-beagle")
if gpu:
cmd.add_arg("-beagle_gpu")
else
cmd.add_arg("-beagle")
cmd.add_arg(f"-statefile {str(dynamic_xml_path).replace('.dynamic.', '.')}.state")
cmd.add_arg(f"-seed {seed}")
cmd.add_arg(f"-prefix {run_directory}/logs/")
Expand Down Expand Up @@ -144,6 +148,7 @@ def main(
beast_xml_path: Path,
run: str = typer.Option(None, help="Run the run.sh file using this command."),
resume: bool = typer.Option(False, help="Resume the specified run."),
gpu: bool = typer.Option(False, help="Use Beagle GPU."),
group: str = typer.Option(None, help="Group runs in this folder."),
description: str = typer.Option("", help="Text to prepend to output folder name."),
overwrite: bool = typer.Option(False, help="Overwrite run folder if exists."),
Expand Down Expand Up @@ -222,7 +227,7 @@ def main(
f.write(beast_seed)

cmd_list = create_beast_run_command(
dynamic_xml_path, run_directory, threads, json_path, beast_seed, resume
dynamic_xml_path, run_directory, threads, json_path, beast_seed, resume, gpu
)

run_file = f"{run_directory}/run.sh"
Expand Down

0 comments on commit 67e0170

Please sign in to comment.