Skip to content

Commit fcea531

Browse files
committed
this framework is a bit over-generic and doesn't catch type errors.
(in upcoming PR, for exmaple) fresh_config style templatisation works just fine here IMO
1 parent 174bafa commit fcea531

File tree

2 files changed

+15
-30
lines changed

2 files changed

+15
-30
lines changed

parsl/tests/configs/local_threads_checkpoint.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

parsl/tests/test_checkpointing/test_python_checkpoint_2.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55

66
import parsl
77
from parsl import python_app
8-
from parsl.tests.configs.local_threads_checkpoint import fresh_config
8+
from parsl.config import Config
9+
from parsl.dataflow.memoization import BasicMemoizer
10+
from parsl.executors.threads import ThreadPoolExecutor
911

1012

11-
@contextlib.contextmanager
12-
def parsl_configured(run_dir, **kw):
13-
c = fresh_config()
14-
c.run_dir = run_dir
15-
for config_attr, config_val in kw.items():
16-
setattr(c, config_attr, config_val)
17-
dfk = parsl.load(c)
18-
for ex in dfk.executors.values():
19-
ex.working_dir = run_dir
20-
yield dfk
21-
22-
parsl.dfk().cleanup()
13+
def parsl_configured(run_dir, memoizer):
14+
return parsl.load(Config(
15+
run_dir=str(run_dir),
16+
executors=[
17+
ThreadPoolExecutor(
18+
label='local_threads_checkpoint',
19+
)
20+
],
21+
memoizer=memoizer
22+
))
2323

2424

2525
@python_app(cache=True)
@@ -32,11 +32,11 @@ def uuid_app():
3232
def test_loading_checkpoint(tmpd_cwd):
3333
"""Load memoization table from previous checkpoint
3434
"""
35-
with parsl_configured(tmpd_cwd, checkpoint_mode="task_exit"):
35+
with parsl_configured(tmpd_cwd, BasicMemoizer(checkpoint_mode="task_exit")):
3636
checkpoint_files = [os.path.join(parsl.dfk().run_dir, "checkpoint")]
3737
result = uuid_app().result()
3838

39-
with parsl_configured(tmpd_cwd, checkpoint_files=checkpoint_files):
39+
with parsl_configured(tmpd_cwd, BasicMemoizer(checkpoint_files=checkpoint_files)):
4040
relaunched = uuid_app().result()
4141

4242
assert result == relaunched, "Expected following call to uuid_app to return cached uuid"

0 commit comments

Comments
 (0)