ADIOS4DOLFINx
ADIOS4DOLFINx: A framework for checkpointing in FEniCS - Published in JOSS (2024)
Science Score: 100.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org -
✓Committers with academic emails
1 of 5 committers (20.0%) from academic institutions -
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Keywords from Contributors
Repository
Extending DOLFINx with checkpointing functionality
Basic Info
- Host: GitHub
- Owner: jorgensd
- License: mit
- Language: Python
- Default Branch: main
- Homepage: http://jsdokken.com/adios4dolfinx/
- Size: 453 KB
Statistics
- Stars: 26
- Watchers: 2
- Forks: 7
- Open Issues: 12
- Releases: 21
Topics
Metadata Files
README.md
ADIOS4DOLFINx - A framework for checkpointing in DOLFINx
ADIOS4DOLFINx is an extension for DOLFINx to checkpoint meshes, meshtags and functions using ADIOS 2.
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 or the examples in the Documentation for more information.
For scalability, the code uses MPI Neighbourhood collectives for communication across processes.
Statement of Need
As the usage of high performance computing clusters increases, more and more large-scale, long-running simulations are deployed.
The need for storing intermediate solutions from such simulations are crucial, as the HPC system might crash, or the simulation might crash or exceed the alloted computational budget.
Having a checkpoint of related variables, such as the solutions to partial differential equations (PDEs) is therefore essential.
The adios4dolfinx library extends the DOLFINx computational framework for solving PDEs with checkpointing functionality, such that immediate solutions and mesh information can be stored and re-used in another simulation.
Installation
Compatibility with DOLFINx:
- ADIOS4DOLFINx v0.9.4 is compatible with DOLFINx v0.9.x
- ADIOS4DOLFINx v0.8.1 is compatible with DOLFINx v0.8.x
- ADIOS4DOLFINx v0.7.3 is compatible with DOLFINx v0.7.x
Dependencies
The library depends on the Python-interface of DOLFINx and an MPI-build of ADIOS2.
Therefore ADIOS2 should not be install through PYPI/pip, but has to be installed through Conda, Spack or from source.
[!IMPORTANT]
ADIOS2<2.10.2 does not work properly with `numpy>=2.0.0. Everyone is adviced to use the newest version of ADIOS2. This is for instance available throughcondaor theghcr.io/fenics/dolfinx/dolfinx:nightly` Docker-image.
Spack
ADIOS4DOLFINx is a spack package which can be installed with
bash
spack add py-adios4dolfinx ^py-fenics-dolfinx+petsc4py+slepc4py
spack concretize
spack install
once you have downloaded spack and set up a new environment, as described in Spack: Installation notes. To ensure that the spack packages are up to date, please call
bash
spack repo update builtin
prior to concretizing.
Docker
An MPI build of ADIOS2 is installed in the official DOLFINx containers, and thus there are no additional dependencies required to install adios4dolfinx
on top of DOLFINx in these images.
Create a Docker container, named for instance dolfinx-checkpoint.
Use the nightly tag to get the main branch of DOLFINx, or stable to get the latest stable release
bash
docker run -ti -v $(pwd):/root/shared -w /root/shared --name=dolfinx-checkpoint ghcr.io/fenics/dolfinx/dolfinx:nightly
For the latest version compatible with nightly (with the ability to run the test suite), use
bash
python3 -m pip install adios4dolfinx[test]@git+https://github.com/jorgensd/adios4dolfinx@main
If you are using the stable image, you can install adios4dolfinx from PYPI with
bash
python3 -m pip install adios4dolfinx[test]
This docker container can be opened with
bash
docker container start -i dolfinx-checkpoint
at a later instance
Conda
[!NOTE]
Conda supports the stable release of DOLFINx, and thus the appropriate version should be installed, see the section above for more details.
Following is a minimal recipe of how to install adios4dolfinx, given that you have conda installed on your system.
bash
conda create -n dolfinx-checkpoint python=3.10
conda activate dolfinx-checkpoint
conda install -c conda-forge adios4dolfinx
[!NOTE] Remember to download the appropriate version of
adios4dolfinxfrom Github adios4dolfinx: Releases
To run the test suite, you should also install ipyparallel, pytest and coverage, which can all be installed with conda
bash
conda install -c conda-forge ipyparallel pytest coverage
Functionality
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, arbitrary number of functions and timesteps per file). Use
adios4dolfinx.read/write_function. - Writing standalone function checkpoints relating to "original meshes", i.e. meshes read from
XDMFFile. Useadios4dolfinx.write_function_on_input_meshfor this. - Store mesh partitioning and re-read the mesh with this information, avoiding calling SCOTCH, Kahip or Parmetis.
[!IMPORTANT]
For checkpoints written withwrite_functionto be valid, you first have to store the mesh withwrite_meshto the checkpoint file.[!IMPORTANT]
A checkpoint file supports multiple functions and multiple time steps, as long as the functions are associated with the same mesh[!IMPORTANT]
Only one mesh per file is allowed
Example Usage
The repository contains many documented examples of usage, in the docs-folder, including
- Reading and writing mesh checkpoints
- Storing mesh partitioning data
- Writing mesh-tags to a checkpoint
- Reading and writing function checkpoints
- Checkpoint on input mesh Further examples can be found at ADIOS4DOLFINx examples
Backwards compatibility
[!WARNING] If you are using v0.7.2, you are adviced to upgrade to v0.7.3, as it contains som crucial fixes for openmpi.
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
.h5file)
See the API for more information.
Testing
This library uses pytest for testing.
To execute the tests, one should first install the library and its dependencies, as listed above.
Then, can execute all tests by calling
bash
python3 -m pytest .
Testing against data from legacy dolfin
Some tests check the capability of reading data created with the legacy version of DOLFIN. To create this dataset, start a docker container with legacy DOLFIN, for instance:
bash
docker run -ti -v $(pwd):/root/shared -w /root/s
hared --rm ghcr.io/scientificcomputing/fenics:2024-02-19
Then, inside this container, call
bash
python3 ./tests/create_legacy_data.py --output-dir=legacy
Testing against data from older versions of ADIOS4DOLFINx
Some tests check the capability to read data generated by adios4dolfinx<0.7.2.
To generate data for these tests use the following commands:
bash
docker run -ti -v $(pwd):/root/shared -w /root/shared --rm ghcr.io/fenics/dolfinx/dolfinx:v0.7.3
Then, inside the container, call
bash
python3 -m pip install adios4dolfinx==0.7.1
python3 ./tests/create_legacy_checkpoint.py --output-dir=legacy_checkpoint
Long term plan
The long term plan is to get this library merged into DOLFINx (rewritten in C++ with appropriate Python-bindings).
Owner
- Name: Jørgen Schartum Dokken
- Login: jorgensd
- Kind: user
- Location: Oslo
- Company: Simula Research Laboratory
- Website: https://jsdokken.com/
- Repositories: 76
- Profile: https://github.com/jorgensd
Senior Research Engineer at Simula Research Laboratory, Oslo, Norway
JOSS Publication
ADIOS4DOLFINx: A framework for checkpointing in FEniCS
Tags
finite element simulations checkpointingCitation (CITATION.cff)
cff-version: "1.2.0"
authors:
- family-names: Dokken
given-names: Jørgen Schartum
orcid: "https://orcid.org/0000-0001-6489-8858"
contact:
- family-names: Dokken
given-names: Jørgen Schartum
orcid: "https://orcid.org/0000-0001-6489-8858"
doi: 10.5281/zenodo.11094985
message: If you use this software, please cite our article in the
Journal of Open Source Software.
preferred-citation:
authors:
- family-names: Dokken
given-names: Jørgen Schartum
orcid: "https://orcid.org/0000-0001-6489-8858"
date-published: 2024-04-30
doi: 10.21105/joss.06451
issn: 2475-9066
issue: 96
journal: Journal of Open Source Software
publisher:
name: Open Journals
start: 6451
title: "ADIOS4DOLFINx: A framework for checkpointing in FEniCS"
type: article
url: "https://joss.theoj.org/papers/10.21105/joss.06451"
volume: 9
title: "ADIOS4DOLFINx: A framework for checkpointing in FEniCS"
GitHub Events
Total
- Create event: 31
- Issues event: 7
- Release event: 10
- Watch event: 4
- Delete event: 9
- Issue comment event: 23
- Push event: 74
- Pull request review event: 12
- Pull request review comment event: 9
- Pull request event: 42
- Fork event: 2
Last Year
- Create event: 31
- Issues event: 7
- Release event: 10
- Watch event: 4
- Delete event: 9
- Issue comment event: 23
- Push event: 74
- Pull request review event: 12
- Pull request review comment event: 9
- Pull request event: 42
- Fork event: 2
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Jørgen Schartum Dokken | d****n@s****o | 164 |
| Henrik Finsberg | h****g@h****m | 22 |
| Francesco Ballarin | f****n@u****t | 5 |
| Nate | 3****e | 2 |
| Daniel S. Katz | d****z@i****g | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 21
- Total pull requests: 94
- Average time to close issues: 28 days
- Average time to close pull requests: 1 day
- Total issue authors: 10
- Total pull request authors: 8
- Average comments per issue: 2.29
- Average comments per pull request: 0.23
- Merged pull requests: 80
- Bot issues: 0
- Bot pull requests: 3
Past Year
- Issues: 6
- Pull requests: 36
- Average time to close issues: about 21 hours
- Average time to close pull requests: 3 days
- Issue authors: 5
- Pull request authors: 4
- Average comments per issue: 0.67
- Average comments per pull request: 0.22
- Merged pull requests: 25
- Bot issues: 0
- Bot pull requests: 3
Top Authors
Issue Authors
- jorgensd (14)
- francesco-ballarin (3)
- finsberg (2)
- drew-parsons (2)
- nate-sime (1)
- zsmb (1)
- gonsie (1)
- shaoyaoqian (1)
- hherlyng (1)
- henrykironde (1)
- Chilipp (1)
Pull Request Authors
- jorgensd (121)
- finsberg (36)
- dependabot[bot] (3)
- nate-sime (3)
- jhale (2)
- francesco-ballarin (2)
- minrk (2)
- danielskatz (2)
- cdaversin (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 3,012 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 16
- Total maintainers: 2
pypi.org: adios4dolfinx
Checkpointing functionality for DOLFINx meshes/functions with ADIOS2
- Documentation: https://adios4dolfinx.readthedocs.io/
- License: Copyright 2023 Jørgen S. Dokken Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 0.9.4
published 6 months ago
