Skip to content

Commit 490e94e

Browse files
committed
Remove manual checkpoint() directory return value
Prior to this PR, a manual checkpoint() call returned the directory that the checkpoint was written to. This isn't really needed, so this PR removes it as part of removing cruft around the checkpoint API, as part of refactoring towards pluggable checkpointing. The only use is in a test case, which this PR rewrites.
1 parent a084103 commit 490e94e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

docs/userguide/workflows/checkpoints.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,7 @@ of the ``slow_double`` app.
265265
# Wait for the results
266266
[i.result() for i in d]
267267
268-
cpt_dir = dfk.checkpoint()
269-
print(cpt_dir) # Prints the checkpoint dir
268+
dfk.checkpoint()
270269
271270
272271
Resuming from a checkpoint

parsl/dataflow/dflow.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ def cleanup(self) -> None:
12671267
# should still see it.
12681268
logger.info("DFK cleanup complete")
12691269

1270-
def checkpoint(self, tasks: Optional[Sequence[TaskRecord]] = None) -> str:
1270+
def checkpoint(self, tasks: Optional[Sequence[TaskRecord]] = None) -> None:
12711271
"""Checkpoint the dfk incrementally to a checkpoint file.
12721272
12731273
When called, every task that has been completed yet not
@@ -1328,8 +1328,6 @@ def checkpoint(self, tasks: Optional[Sequence[TaskRecord]] = None) -> str:
13281328
else:
13291329
logger.info("Done checkpointing {} tasks".format(count))
13301330

1331-
return checkpoint_dir
1332-
13331331
@staticmethod
13341332
def _log_std_streams(task_record: TaskRecord) -> None:
13351333
tid = task_record['id']

parsl/tests/test_checkpointing/test_python_checkpoint_1.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
from pathlib import Path
23

34
import pytest
45

@@ -20,12 +21,14 @@ def uuid_app():
2021

2122

2223
@pytest.mark.local
23-
def test_initial_checkpoint_write():
24+
def test_initial_checkpoint_write() -> None:
2425
"""1. Launch a few apps and write the checkpoint once a few have completed
2526
"""
2627
uuid_app().result()
2728

28-
cpt_dir = parsl.dfk().checkpoint()
29+
parsl.dfk().checkpoint()
2930

30-
cptpath = cpt_dir + '/tasks.pkl'
31+
cpt_dir = Path(parsl.dfk().run_dir) / 'checkpoint'
32+
33+
cptpath = cpt_dir / 'tasks.pkl'
3134
assert os.path.exists(cptpath), f"Tasks checkpoint missing: {cptpath}"

0 commit comments

Comments
 (0)