Skip to content

Commit

Permalink
Remove printed messages, remove MPI when nprocs=1
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamPattinson committed Oct 17, 2023
1 parent 059efa5 commit 36d1f4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions run_epoch.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,8 @@ def singularity_cmd(
container: str, output: Path, dims: int, photons: bool, nprocs: int
) -> str:
"""Constructs the command to run Epoch via a Singularity container."""
return dedent(
cmd = dedent(
f"""\
mpirun -n {nprocs}
singularity exec
--bind {output.resolve()}:/output
{container}
Expand All @@ -116,6 +115,7 @@ def singularity_cmd(
{'--photons' if photons else ''}
"""
).replace("\n", " ")
return f"mpirun -n {nprocs} " + cmd if nprocs != 1 else cmd


def main() -> None:
Expand Down
6 changes: 1 addition & 5 deletions src/epoch_containers/run_epoch.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,8 @@ def run_epoch(

if not output.is_dir():
raise NotADirectoryError(str(output))
full_path = output.resolve()
print(f"Running on the directory {full_path}, containing:")
for f in full_path.iterdir():
print(f"- {f.name}")

subprocess.run([exe], input=str(full_path).encode("utf-8"))
subprocess.run([exe], input=str(output.resolve()).encode("utf-8"))


def main() -> None:
Expand Down

0 comments on commit 36d1f4b

Please sign in to comment.