Skip to content

Commit

Permalink
Add new legacy bound (#53)
Browse files Browse the repository at this point in the history
* Add new legacy bound

* More updates to readme

* Bump citation file
  • Loading branch information
jorgensd authored Feb 7, 2024
1 parent 3775416 commit 6087d50
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ authors:
given-names: "Jørgen S."
orcid: "0000-0001-6489-8858"
title: "ADIOS2Wrappers"
version: "0.7.1"
date-released: 2023-10-15
version: "0.7.2"
date-released: "2023-02-07"
40 changes: 22 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,36 @@

This is an extension for [DOLFINx](https://github.com/FEniCS/dolfinx/) to checkpoint meshes, meshtags and functions using [ADIOS2](https://adios2.readthedocs.io/en/latest/).

## Docker
The code uses the adios2 Python-wrappers to write DOLFINx objects to file, supporting N-to-M (*recoverable*) and N-to-N (*snapshot*) checkpointing.
See: [Checkpointing in DOLFINx - FEniCS 23](https://jsdokken.com/checkpointing-presentation/#/) for more information.

For scalability, the code uses [MPI Neighbourhood collectives](https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report/node200.htm) for communication across processes.

## Installation

### Docker
ADIOS2 is installed in the official DOLFINx containers.
```bash
docker run -ti -v $(pwd):/root/shared -w /root/shared --name=dolfinx-checkpoint ghcr.io/fenics/dolfinx/dolfinx:nightly
```

## Conda
To use with conda (DOLFINx release v0.7.0 works with v0.7.1 of ADIOS4DOLFINx)
### Conda
To use with conda (DOLFINx release v0.7.0 works with v0.7.2 of ADIOS4DOLFINx)
```bash
conda create -n dolfinx-checkpoint python=3.10
conda activate dolfinx-checkpoint
conda install -c conda-forge fenics-dolfinx pip adios2
python3 -m pip install git+https://github.com/jorgensd/[email protected].1
python3 -m pip install git+https://github.com/jorgensd/[email protected].2
```

# Long term plan
The long term plan is to get this library merged into DOLFINx (rewritten in C++ with appropriate Python-bindings).
_________________

# Functionality
## Functionality

## Implementation details
The code uses the adios2 Python-wrappers to write DOLFINx objects to file, supporting N-to-M (*recoverable*) and N-to-N (*snapshot*) checkpointing.
See: [Checkpointing in DOLFINx - FEniCS 23](https://jsdokken.com/checkpointing-presentation/#/) for more information.

For scalability, the code uses [MPI Neighbourhood collectives](https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report/node200.htm) for communication across processes.

## DOLFINx
### DOLFINx
- Reading and writing meshes, using `adios4dolfinx.read/write_mesh`
- Reading and writing meshtags associated to meshes `adios4dolfinx.read/write_meshtags`
- Reading checkpoints for any element (serial and parallel, one checkpoint per file). Use `adios4dolfinx.read/write_function`.
- Reading checkpoints for any element (serial and parallel, arbitrary number of functions and timesteps per file). Use `adios4dolfinx.read/write_function`.

> [!IMPORTANT]
> For a checkpoint to be valid, you first have to store the mesh with `write_mesh`, then use `write_function` to append to the checkpoint file.
Expand All @@ -46,15 +45,20 @@ For scalability, the code uses [MPI Neighbourhood collectives](https://www.mpi-f
> [!IMPORTANT]
> Only one mesh per file is allowed

### Backwards compatibility
> [!WARNING]
> If you are using checkpoints written with `adios4dolfinx` prior to time-dependent/multi-function support, please use the `legacy=True` flag for reading in the checkpoint
> If you are using checkpoints written with `adios4dolfinx<0.7.2` please use the `legacy=True` flag for reading in the checkpoint with
> with any newer version

## Legacy DOLFIN
### Legacy DOLFIN
Only checkpoints for `Lagrange` or `DG` functions are supported from legacy DOLFIN
- Reading meshes from the DOLFIN HDF5File-format
- Reading checkpoints from the DOLFIN HDF5File-format (one checkpoint per file only)
- Reading checkpoints from the DOLFIN XDMFFile-format (one checkpoint per file only, and only uses the `.h5` file)

See the [API](./docs/api) for more information.
_________________

## Long term plan
The long term plan is to get this library merged into DOLFINx (rewritten in C++ with appropriate Python-bindings).
2 changes: 1 addition & 1 deletion tests/create_legacy_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from importlib.metadata import version

a4d_version = version("adios4dolfinx")
assert a4d_version < "0.8.0", f"Creating a legacy checkpoint requires adios4dolfinx < 0.8.0, you have {a4d_version}."
assert a4d_version < "0.7.2", f"Creating a legacy checkpoint requires adios4dolfinx < 0.7.2, you have {a4d_version}."


def f(x):
Expand Down

0 comments on commit 6087d50

Please sign in to comment.