Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
cd docs
cp build/latex/checkpoint_schedules.pdf build/html/_static/manual.pdf
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: /__w/checkpoint_schedules/checkpoint_schedules/docs/build/html
Expand All @@ -78,4 +78,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.9

- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
Expand Down
15 changes: 11 additions & 4 deletions checkpoint_schedules/basic_schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,30 @@ class SingleDiskStorageSchedule(CheckpointSchedule):
"""A checkpointing schedule where all adjoint dependencies are stored on
disk.

Notes
-----
Online, unlimited adjoint calculations permitted.

Parameters
----------
move_data : bool
Indicate whether the execution should move the data from
`StorageType.DISK` to `StorageType.WORK`, rather than copy the data.
store_only_adj_deps : bool
Indicate whether only adjoint dependencies should be stored on disk.

Notes
-----
Online, unlimited adjoint calculations permitted if `move_data` is `False`,
one adjoint calculation permitted if `move_data` is `True`.

``store_only_adj_deps`` set as False will store both all forward data on
disk.
"""

def __init__(self, move_data=False):
def __init__(self, move_data=False, store_only_adj_deps=True):
super().__init__()
self._move_data = move_data
self._storage = StorageType.DISK
self._store_only_adj_deps = store_only_adj_deps

def _iterator(self):
"""Schedule iterator.
Expand All @@ -125,7 +129,10 @@ def _iterator(self):
n0 = self._n
n1 = n0 + 1
self._n = n1
yield Forward(n0, n1, False, True, StorageType.DISK)
if self._store_only_adj_deps:
yield Forward(n0, n1, False, True, StorageType.DISK)
else:
yield Forward(n0, n1, True, True, StorageType.DISK)

yield EndForward()

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ authors = [
description = "Schedules for incremental checkpointing of adjoint simulations."
readme = "README.md"
license = {text = "LGPL-3.0"}
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
]
Expand Down