Skip to content

Commit e95e9b1

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 51762f6 commit e95e9b1

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
@@ -264,8 +264,7 @@ of the ``slow_double`` app.
264264
# Wait for the results
265265
[i.result() for i in d]
266266
267-
cpt_dir = dfk.checkpoint()
268-
print(cpt_dir) # Prints the checkpoint dir
267+
dfk.checkpoint()
269268
270269
271270
Resuming from a checkpoint

parsl/dataflow/dflow.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ def cleanup(self) -> None:
12471247

12481248
logger.info("DFK cleanup complete")
12491249

1250-
def checkpoint(self, tasks: Optional[Sequence[TaskRecord]] = None) -> str:
1250+
def checkpoint(self, tasks: Optional[Sequence[TaskRecord]] = None) -> None:
12511251
"""Checkpoint the dfk incrementally to a checkpoint file.
12521252
12531253
When called, every task that has been completed yet not
@@ -1308,8 +1308,6 @@ def checkpoint(self, tasks: Optional[Sequence[TaskRecord]] = None) -> str:
13081308
else:
13091309
logger.info("Done checkpointing {} tasks".format(count))
13101310

1311-
return checkpoint_dir
1312-
13131311
@staticmethod
13141312
def _log_std_streams(task_record: TaskRecord) -> None:
13151313
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)