Skip to content

Commit

Permalink
begone option to specify a path for 'psiflow_internal'
Browse files Browse the repository at this point in the history
  • Loading branch information
pdobbelaere committed Dec 11, 2024
1 parent b6b63ac commit f3dd958
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions psiflow/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ def new_file(self, prefix: str, suffix: str) -> File:
@classmethod
def from_config(
cls,
path: Optional[Union[str, Path]] = None,
parsl_log_level: str = "WARNING",
usage_tracking: int = 3,
retries: int = 2,
Expand All @@ -457,12 +456,10 @@ def from_config(
container_engine: str = "apptainer",
container_addopts: str = " --no-eval -e --no-mount home -W /tmp --writable-tmpfs",
container_entrypoint: str = "/opt/entry.sh",
symlink_prefix: str = "psiflow",
make_symlinks: bool = True,
**kwargs,
) -> ExecutionContext:
if path is None:
path = Path.cwd().resolve() / "psiflow_internal"
# TODO: this throws when path is a str..
path = Path.cwd().resolve() / "psiflow_internal"
psiflow.resolve_and_check(path)
if path.exists():
shutil.rmtree(path)
Expand Down Expand Up @@ -552,13 +549,12 @@ def from_config(
)
context = ExecutionContext(config, definitions, path / "context_dir")

# TODO: how would you consistently delete old/invalid symlinks from previous runs?
if symlink_prefix:
src, dest = Path.cwd() / f'{symlink_prefix}_log', path / 'parsl.log'
if make_symlinks:
src, dest = Path.cwd() / f'psiflow_log', path / 'parsl.log'
_create_symlink(src, dest)
src, dest = Path.cwd() / f'{symlink_prefix}_submit_scripts', path / '000' / 'submit_scripts'
src, dest = Path.cwd() / f'psiflow_submit_scripts', path / '000' / 'submit_scripts'
_create_symlink(src, dest, is_dir=True)
src, dest = Path.cwd() / f'{symlink_prefix}_task_logs', path / '000' / 'task_logs'
src, dest = Path.cwd() / f'psiflow_task_logs', path / '000' / 'task_logs'
_create_symlink(src, dest, is_dir=True)

return context
Expand Down Expand Up @@ -586,12 +582,6 @@ def load(
"use_threadpool": True,
},
}
# TODO: what does this do?
# ExecutionContext.from_config also handles this logic (but differently)
path = Path.cwd() / ".psiflow_internal"
if path.exists():
shutil.rmtree(path)
psiflow_config["path"] = path
else:
assert len(sys.argv) == 2
path_config = psiflow.resolve_and_check(Path(sys.argv[1]))
Expand Down

0 comments on commit f3dd958

Please sign in to comment.