Skip to content

Commit

Permalink
small fixes in execution setup
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenhaute committed Oct 29, 2023
1 parent 749bd66 commit 042a01b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions psiflow/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import atexit
import copy
import logging
import shutil
import sys
from dataclasses import dataclass
from pathlib import Path
Expand Down Expand Up @@ -291,6 +292,10 @@ def load(
...
"""
yaml_dict = yaml.safe_load(yaml_dict_str)
path_internal = Path.cwd() / ".psiflow_internal"
if path_internal.exists():
shutil.rmtree(path_internal)
yaml_dict["psiflow_internal"] = path_internal
else:
assert len(sys.argv) == 2
path_config = resolve_and_check(Path(sys.argv[1]))
Expand All @@ -301,12 +306,14 @@ def load(
)
with open(path_config, "r") as f:
yaml_dict = yaml.safe_load(f)
psiflow_config, definitions = cls.parse_yaml(yaml_dict)
psiflow_config, definitions = cls.parse_config(yaml_dict)
psiflow_config = copy.deepcopy(psiflow_config) # modified in place
path = resolve_and_check(Path(psiflow_config.pop("psiflow_internal")))
assert not any(path.iterdir()), "internal directory {} should be empty".format(
path
)
if path.exists():
assert not any(
path.iterdir()
), "internal directory {} should be empty".format(path)
path.mkdir(parents=True, exist_ok=True)
set_logger(psiflow_config.pop("psiflow_log_level"))
parsl.set_file_logger(
str(path / "parsl.log"),
Expand Down

0 comments on commit 042a01b

Please sign in to comment.