openpmd-api
:floppy_disk: C++ & Python API for Scientific I/O
Science Score: 77.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 3 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org -
✓Committers with academic emails
6 of 31 committers (19.4%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.1%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
:floppy_disk: C++ & Python API for Scientific I/O
Basic Info
- Host: GitHub
- Owner: openPMD
- License: lgpl-3.0
- Language: C++
- Default Branch: dev
- Homepage: https://openpmd-api.readthedocs.io
- Size: 22.3 MB
Statistics
- Stars: 149
- Watchers: 10
- Forks: 51
- Open Issues: 235
- Releases: 38
Topics
Metadata Files
README.md
C++ & Python API for Scientific I/O with openPMD
openPMD is an open meta-data schema that provides meaning and self-description for data sets in science and engineering. See the openPMD standard for details of this schema.
This library provides a reference API for openPMD data handling. Since openPMD is a schema (or markup) on top of portable, hierarchical file formats, this library implements various backends such as HDF5, ADIOS2 and JSON. Writing & reading through those backends and their associated files are supported for serial and MPI-parallel workflows.
Usage
C++
```cpp
include
include
// ...
auto s = openPMD::Series("samples/git-sample/data%T.h5", openPMD::Access::READ_ONLY);
for( auto const & [step, it] : s.iterations ) { std::cout << "Iteration: " << step << "\n";
for( auto const & [name, mesh] : it.meshes ) {
std::cout << " Mesh '" << name << "' attributes:\n";
for( auto const& val : mesh.attributes() )
std::cout << " " << val << '\n';
}
for( auto const & [name, species] : it.particles ) {
std::cout << " Particle species '" << name << "' attributes:\n";
for( auto const& val : species.attributes() )
std::cout << " " << val << '\n';
}
} ```
Python
```py import openpmd_api as io
...
series = io.Series("samples/git-sample/data%T.h5", io.Access.read_only)
for ki, i in series.iterations.items(): print("Iteration: {0}".format(ki))
for k_m, m in i.meshes.items():
print(" Mesh '{0}' attributes:".format(k_m))
for a in m.attributes:
print(" {0}".format(a))
for k_p, p in i.particles.items():
print(" Particle species '{0}' attributes:".format(k_p))
for a in p.attributes:
print(" {0}".format(a))
```
More!
Curious? Our manual shows full read & write examples, both serial and MPI-parallel!
Dependencies
Required: * CMake 3.22.0+ * C++17 capable compiler, e.g., g++ 7+, clang 7+, MSVC 19.15+, icpc 19+, icpx
Shipped internally (downloaded by CMake unless openPMD_SUPERBUILD=OFF is set):
* Catch2 2.13.10+ (BSL-1.0)
* pybind11 2.13.0+ (new BSD)
* NLohmann-JSON 3.9.1+ (MIT)
* toml11 3.7.1+ (MIT)
I/O backends: * JSON * HDF5 1.8.13+ (optional) * ADIOS2 2.9.0+ (optional)
while those can be built either with or without: * MPI 2.1+, e.g. OpenMPI 1.6.5+ or MPICH2
Optional language bindings: * Python: * Python 3.8 - 3.13 * pybind11 2.13.0+ * numpy 1.15+ * mpi4py 2.1+ (optional, for MPI) * pandas 1.0+ (optional, for dataframes) * dask 2021+ (optional, for dask dataframes) * CUDA C++ (optional, currently used only in tests)
Installation
Our community loves to help each other. Please report installation problems in case you should get stuck.
Choose one of the install methods below to get started:
Spack
```bash
optional: +python -adios2 -hdf5 -mpi
spack install openpmd-api spack load openpmd-api ```
Conda
```bash
optional: OpenMPI support ==mpi_openmpi
optional: MPICH support ==mpi_mpich
conda create -n openpmd -c conda-forge openpmd-api conda activate openpmd ```
Brew
bash
brew tap openpmd/openpmd
brew install openpmd-api
PyPI
On very old macOS versions (<10.9) or on exotic processor architectures, this install method compiles from source against the found installations of HDF5, ADIOS2, and/or MPI (in system paths, from other package managers, or loaded via a module system, ...).
```bash
we need pip 19 or newer
optional: --user
python3 -m pip install -U pip
optional: --user
python3 -m pip install openpmd-api ```
If MPI-support shall be enabled, we always have to recompile: ```bash
optional: --user
python3 -m pip install -U pip packaging setuptools wheel python3 -m pip install -U cmake
optional: --user
openPMDUSEMPI=ON python3 -m pip install openpmd-api --no-binary openpmd-api ```
For some exotic architectures and compilers, you might need to disable a compiler feature called link-time/interprocedural optimization if you encounter linking problems: ```bash export CMAKEINTERPROCEDURALOPTIMIZATION=OFF
optional: --user
python3 -m pip install openpmd-api --no-binary openpmd-api ```
Additional CMake options can be passed via individual environment variables, which need to be prefixed with openPMD_CMAKE_.
From Source
openPMD-api can also be built and installed from source using CMake:
```bash git clone https://github.com/openPMD/openPMD-api.git
mkdir openPMD-api-build cd openPMD-api-build
optional: for full tests, with unzip
../openPMD-api/share/openPMD/download_samples.sh
for own install prefix append:
-DCMAKEINSTALLPREFIX=$HOME/somepath
for options append:
-DopenPMDUSE...=...
e.g. for python support add:
-DopenPMDUSEPYTHON=ON -DPython_EXECUTABLE=$(which python3)
cmake ../openPMD-api
cmake --build .
optional
ctest
sudo might be required for system paths
cmake --build . --target install ```
The following options can be added to the cmake call to control features.
CMake controls options with prefixed -D, e.g. -DopenPMD_USE_MPI=OFF:
| CMake Option | Values | Description |
|------------------------------|------------------|------------------------------------------------------------------------------|
| openPMD_USE_MPI | AUTO/ON/OFF | Parallel, Multi-Node I/O for clusters |
| openPMD_USE_HDF5 | AUTO/ON/OFF | HDF5 backend (.h5 files) |
| openPMD_USE_ADIOS2 | AUTO/ON/OFF | ADIOS2 backend (.bp files in BP3, BP4 or higher) |
| openPMD_USE_PYTHON | AUTO/ON/OFF | Enable Python bindings |
| openPMD_USE_INVASIVE_TESTS | ON/OFF | Enable unit tests that modify source code 1 |
| openPMD_USE_VERIFY | ON/OFF | Enable internal VERIFY (assert) macro independent of build type 2 |
| openPMD_INSTALL | ON/OFF | Add installation targets |
| openPMD_INSTALL_RPATH | ON/OFF | Add RPATHs to installed binaries |
| Python_EXECUTABLE | (newest found) | Path to Python executable |
1 e.g. changes C++ visibility keywords, breaks MSVC 2 this includes most pre-/post-condition checks, disabling without specific cause is highly discouraged
Additionally, the following libraries are downloaded via FetchContent
during the configuration of the project or, if the corresponding <PACKAGENAME>_ROOT variable is provided, can be provided externally:
* Catch2 (2.13.10+)
* PyBind11 (2.13.0+)
* NLohmann-JSON (3.9.1+)
* toml11 (3.7.1+)
By default, this will build as a shared library (libopenPMD.[so|dylib|dll]) and installs also its headers.
In order to build a static library, append -DBUILD_SHARED_LIBS=OFF to the cmake command.
You can only build a static or a shared library at a time.
By default, the Release version is built.
In order to build with debug symbols, pass -DCMAKE_BUILD_TYPE=Debug to your cmake command.
By default, tests, examples and command line tools are built.
In order to skip building those, pass OFF to these cmake options:
| CMake Option | Values | Description |
|-------------------------------|------------|--------------------------|
| openPMD_BUILD_TESTING | ON/OFF | Build tests |
| openPMD_BUILD_EXAMPLES | ON/OFF | Build examples |
| openPMD_BUILD_CLI_TOOLS | ON/OFF | Build command-line tools |
| openPMD_USE_CUDA_EXAMPLES | ON/OFF | Use CUDA in examples |
Linking to your project
The install will contain header files and libraries in the path set with -DCMAKE_INSTALL_PREFIX.
CMake
If your project is using CMake for its build, one can conveniently use our provided openPMDConfig.cmake package, which is installed alongside the library.
First set the following environment hint if openPMD-api was not installed in a system path:
```bash
optional: only needed if installed outside of system paths
export CMAKEPREFIXPATH=$HOME/somepath:$CMAKEPREFIXPATH ```
Use the following lines in your project's CMakeLists.txt:
```cmake
supports: COMPONENTS MPI NOMPI HDF5 ADIOS2
find_package(openPMD 0.17.0 CONFIG)
if(openPMDFOUND) targetlink_libraries(YourTarget PRIVATE openPMD::openPMD) endif() ```
Alternatively, add the openPMD-api repository source directly to your project and use it via: ```cmake add_subdirectory("path/to/source/of/openPMD-api")
targetlinklibraries(YourTarget PRIVATE openPMD::openPMD) ```
For development workflows, you can even automatically download and build openPMD-api from within a depending CMake project.
Just replace the add_subdirectory call with:
```cmake
include(FetchContent)
set(CMAKEPOLICYDEFAULTCMP0077 NEW)
set(openPMDBUILDCLITOOLS OFF)
set(openPMDBUILDEXAMPLES OFF)
set(openPMDBUILDTESTING OFF)
set(openPMDBUILDSHAREDLIBS OFF) # precedence over BUILDSHAREDLIBS if needed
set(openPMDINSTALL OFF) # or instead use:
set(openPMDINSTALL ${BUILDSHARED_LIBS}) # only install if used as a shared library
set(openPMDUSEPYTHON OFF) FetchContentDeclare(openPMD GITREPOSITORY "https://github.com/openPMD/openPMD-api.git" GITTAG "0.17.0") FetchContentMakeAvailable(openPMD) ```
Manually
If your (Linux/OSX) project is build by calling the compiler directly or uses a manually written Makefile, consider using our openPMD.pc helper file for pkg-config, which are installed alongside the library.
First set the following environment hint if openPMD-api was not installed in a system path:
```bash
optional: only needed if installed outside of system paths
export PKGCONFIGPATH=$HOME/somepath/lib/pkgconfig:$PKGCONFIGPATH ```
Additional linker and compiler flags for your project are available via: ```bash
switch to check if openPMD-api was build as static library
(via BUILDSHAREDLIBS=OFF) or as shared library (default)
if [ "$(pkg-config --variable=static openPMD)" == "true" ] then pkg-config --libs --static openPMD # -L/usr/local/lib -L/usr/lib/x8664-linux-gnu/openmpi/lib -lopenPMD -pthread /usr/lib/libmpi.so -pthread /usr/lib/x8664-linux-gnu/openmpi/lib/libmpicxx.so /usr/lib/libmpi.so /usr/lib/x8664-linux-gnu/hdf5/openmpi/libhdf5.so /usr/lib/x8664-linux-gnu/libsz.so /usr/lib/x8664-linux-gnu/libz.so /usr/lib/x8664-linux-gnu/libdl.so /usr/lib/x8664-linux-gnu/libm.so -pthread /usr/lib/libmpi.so -pthread /usr/lib/x8664-linux-gnu/openmpi/lib/libmpicxx.so /usr/lib/libmpi.so else pkg-config --libs openPMD # -L${HOME}/somepath/lib -lopenPMD fi
pkg-config --cflags openPMD
-I${HOME}/somepath/include
```
Author Contributions
openPMD-api is developed by many people. It was initially started by the Computational Radiation Physics Group at HZDR as successor to libSplash, generalizing the successful HDF5 & ADIOS1 implementations in PIConGPU. The following people and institutions contributed to openPMD-api:
- Axel Huebl (LBNL, previously HZDR): project lead, releases, documentation, automated CI/CD, Python bindings, Dask, installation & packaging, prior reference implementations
- Franz Poeschel (CASUS): JSON & ADIOS2 backend, data staging/streaming, reworked class design
- Fabian Koller (HZDR): initial library design and implementation with HDF5 & ADIOS1 backend
- Junmin Gu (LBNL): non-collective parallel I/O fixes, ADIOS improvements, benchmarks
Maintained by the following research groups:
- Computational Radiation Physics (CRD) at CASUS/HZDR, led by Michael Bussmann
- Accelerator Modeling Program (AMP) at LBNL, led by Jean-Luc Vay
- Scientific Data Management (SDM) at LBNL, led by Kesheng (John) Wu
Further thanks go to improvements and contributions from:
- Carsten Fortmann-Grote (EU XFEL GmbH, now MPI-EvolBio): draft of our Python unit tests
- Dominik Stańczak (Warsaw University of Technology): documentation improvements
- Ray Donnelly (Anaconda, Inc.): support on conda packaging and libc++ quirks
- James Amundson (FNAL): compile fix for newer compilers
- René Widera (HZDR): design improvements for initial API design
- Erik Zenker (HZDR): design improvements for initial API design
- Sergei Bastrakov (HZDR): documentation improvements (windows)
- Rémi Lehe (LBNL): package integration testing on macOS and Linux
- Lígia Diana Amorim (LBNL): package integration testing on macOS
- Kseniia Bastrakova (HZDR): compatibility testing
- Richard Pausch (HZDR): compatibility testing, documentation improvements
- Paweł Ordyna (HZDR): report on NVCC warnings
- Dmitry Ganyushin (ORNL): Dask prototyping & ADIOS2 benchmarking
- John Kirkham (NVIDIA): Dask guidance & reviews
- Erik Schnetter (PITP): C++ API bug fixes
- Jean Luca Bez (LBNL): HDF5 performance tuning
- Bernhard Manfred Gruber (CERN): CMake fix for parallel HDF5
- Nils Schild (IPP): CMake improvements for subprojects
Grants
The openPMD-api authors acknowledge support via the following programs. Supported by the CAMPA collaboration, a project of the U.S. Department of Energy, Office of Science, Office of Advanced Scientific Computing Research and Office of High Energy Physics, Scientific Discovery through Advanced Computing (SciDAC) program. Previously supported by the Consortium for Advanced Modeling of Particles Accelerators (CAMPA), funded by the U.S. DOE Office of Science under Contract No. DE-AC02-05CH11231. Supported by the Exascale Computing Project (17-SC-20-SC), a collaborative effort of two U.S. Department of Energy organizations (Office of Science and the National Nuclear Security Administration). This project has received funding from the European Unions Horizon 2020 research and innovation programme under grant agreement No 654220. This work was partially funded by the Center of Advanced Systems Understanding (CASUS), which is financed by Germany's Federal Ministry of Education and Research (BMBF) and by the Saxon Ministry for Science, Culture and Tourism (SMWK) with tax funds on the basis of the budget approved by the Saxon State Parliament. Supported by the HElmholtz Laser Plasma Metadata Initiative (HELPMI) project (ZT-I-PF-3-066), funded by the "Initiative and Networking Fund" of the Helmholtz Association in the framework of the "Helmholtz Metadata Collaboration" project call 2022.
Transitive Contributions
openPMD-api stands on the shoulders of giants and we are grateful for the following projects included as direct dependencies:
- ADIOS2 by S. Klasky, N. Podhorszki, W.F. Godoy (ORNL), team, collaborators and contributors
- Catch2 by Phil Nash, Martin Hořeňovský and contributors
- HDF5 by the HDF group and community
- json by Niels Lohmann and contributors
- toml11 by Toru Niina and contributors
- pybind11 by Wenzel Jakob (EPFL) and contributors
- all contributors to the evolution of modern C++ and early library preview developers, e.g. Michael Park (Facebook)
- the CMake build system and contributors
- packaging support by the conda-forge, PyPI and Spack communities, among others
- the openPMD-standard by Axel Huebl (HZDR, now LBNL) and contributors
Owner
- Name: openPMD
- Login: openPMD
- Kind: organization
- Email: axelhuebl@lbl.gov
- Website: https://www.openPMD.org
- Repositories: 16
- Profile: https://github.com/openPMD
Open Standard for Particle-Mesh Data
Citation (CITATION.cff)
cff-version: 1.1.0 message: "If you use this software, please cite it as below." authors: - family-names: Huebl given-names: Axel affiliation: Lawrence Berkeley National Laboratory (LBNL) orcid: https://orcid.org/0000-0003-1943-7141 email: axelhuebl@lbl.gov - family-names: Poeschel affiliation: Center for Advanced Systems Understanding (CASUS) given-names: Franz orcid: https://orcid.org/0000-0001-7042-5088 - family-names: Koller given-names: Fabian affiliation: Helmholtz-Zentrum Dresden-Rossendorf (HZDR) orcid: https://orcid.org/0000-0001-8704-1769 - family-names: Gu given-names: Junmin affiliation: Lawrence Berkeley National Laboratory (LBNL) orcid: https://orcid.org/0000-0002-1521-8534 - family-names: Bussmann given-names: Michael affiliation: Center for Advanced Systems Understanding (CASUS) and Helmholtz-Zentrum Dresden-Rossendorf (HZDR) orcid: https://orcid.org/0000-0002-8258-3881 - family-names: Vay given-names: Jean-Luc affiliation: Lawrence Berkeley National Laboratory (LBNL) orcid: https://orcid.org/0000-0002-0040-799X - family-names: Wu given-names: Kesheng (John) affiliation: Lawrence Berkeley National Laboratory (LBNL) orcid: https://orcid.org/0000-0002-6907-3393 contact: - family-names: Huebl given-names: Axel affiliation: Lawrence Berkeley National Laboratory (LBNL) orcid: https://orcid.org/0000-0003-1943-7141 email: axelhuebl@lbl.gov title: "openPMD-api: C++ & Python API for Scientific I/O with openPMD" version: 0.17.0-dev repository-code: https://github.com/openPMD/openPMD-api doi: 10.14278/rodare.27 license: LGPL-3.0-or-later date-released: 2018-06-07 keywords: - research - hpc - opendata - cpp14 - mpi - python3 - hdf5 - file-handling - openscience - meta-data - adios - openpmd
GitHub Events
Total
- Issues event: 15
- Watch event: 10
- Delete event: 5
- Issue comment event: 89
- Push event: 84
- Pull request review event: 95
- Pull request review comment event: 99
- Pull request event: 141
- Fork event: 4
- Create event: 7
Last Year
- Issues event: 15
- Watch event: 10
- Delete event: 5
- Issue comment event: 89
- Push event: 84
- Pull request review event: 95
- Pull request review comment event: 99
- Pull request event: 141
- Fork event: 4
- Create event: 7
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Axel Huebl | a****l@p****a | 1,060 |
| Franz Pöschel | f****l@g****m | 311 |
| C0nsultant | a****l@p****e | 217 |
| pre-commit-ci[bot] | 6****] | 56 |
| guj | g****j | 17 |
| dependabot[bot] | 4****] | 10 |
| Carsten Fortmann-Grote | c****e@x****u | 9 |
| L. Diana Amorim | L****m@l****v | 6 |
| Jean Luca Bez | j****z@l****v | 5 |
| Michael Park | m****k@g****m | 4 |
| Niels Lohmann | m****l@n****e | 3 |
| Phil Nash | g****b@p****e | 3 |
| Wenzel Jakob | w****b@e****h | 3 |
| Dominik Stańczak | s****k@g****m | 2 |
| Erik Schnetter | s****r@g****m | 2 |
| Nils Schild | 6****t | 2 |
| Richard Pausch | r****h@h****e | 2 |
| Sergei Bastrakov | s****v@g****m | 2 |
| Toru Niina | n****u@g****m | 2 |
| lgtm-com[bot] | 4****] | 1 |
| Ulrik Günther | u****k@4****m | 1 |
| René Widera | r****a@h****e | 1 |
| Paweł Ordyna | p****a@h****e | 1 |
| Luca Fedeli | l****8@g****m | 1 |
| James Amundson | a****n@f****v | 1 |
| Ilian Kara-Mostefa | 9****S | 1 |
| Glenn Richardson | g****n@b****u | 1 |
| Gavin Ridley | g****y@g****m | 1 |
| Davide Terzani | 2****e | 1 |
| David Grote | d****e@l****v | 1 |
| and 1 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 99
- Total pull requests: 461
- Average time to close issues: 3 months
- Average time to close pull requests: about 2 months
- Total issue authors: 32
- Total pull request authors: 15
- Average comments per issue: 3.18
- Average comments per pull request: 1.13
- Merged pull requests: 353
- Bot issues: 0
- Bot pull requests: 40
Past Year
- Issues: 13
- Pull requests: 165
- Average time to close issues: 12 days
- Average time to close pull requests: 8 days
- Issue authors: 10
- Pull request authors: 5
- Average comments per issue: 0.46
- Average comments per pull request: 0.78
- Merged pull requests: 122
- Bot issues: 0
- Bot pull requests: 16
Top Authors
Issue Authors
- ax3l (32)
- BenWibking (9)
- franzpoeschel (8)
- pgrete (5)
- guj (5)
- eschnett (4)
- s-sajid-ali (3)
- pordyna (3)
- rl3418 (2)
- DerNils-git (2)
- cbontoiu (2)
- stefurnic (2)
- titoiride (2)
- PrometheusPi (2)
- psychocoderHPC (1)
Pull Request Authors
- franzpoeschel (255)
- ax3l (147)
- pre-commit-ci[bot] (33)
- dependabot[bot] (7)
- guj (6)
- eschnett (3)
- lucafedeli88 (2)
- skalarproduktraum (1)
- ChristopherMayes (1)
- IlianCS (1)
- titoiride (1)
- C0nsultant (1)
- pordyna (1)
- dpgrote (1)
- DerNils-git (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- pypi 22,285 last-month
-
Total dependent packages: 6
(may contain duplicates) -
Total dependent repositories: 22
(may contain duplicates) - Total versions: 71
- Total maintainers: 1
pypi.org: openpmd-api
C++ & Python API for Scientific I/O with openPMD
- Homepage: https://www.openPMD.org
- Documentation: https://openpmd-api.readthedocs.io
- License: GNU Lesser General Public License v3 or later (LGPLv3+)
-
Latest release: 0.16.1
published 12 months ago
Rankings
Maintainers (1)
conda-forge.org: openpmd-api
This library provides a common high-level API for openPMD writing and reading. It provides a common interface to I/O libraries and file formats such as HDF5, ADIOS2, and JSON. Language bindings are provided for C++17 (or newer) and Python 3. This conda-forge package provides serial and MPI-parallel I/O. Windows support is limited to serial versions of HDF5, ADIOS2 and JSON.
- Homepage: https://www.openpmd.org/
- License: LGPL-3.0-or-later
-
Latest release: 0.14.5
published over 3 years ago
Rankings
Dependencies
- actions/checkout v3 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/autobuild v2 composite
- github/codeql-action/init v2 composite
- actions/checkout v3 composite
- actions/cache v3 composite
- actions/checkout v3 composite
- conda-incubator/setup-miniconda v2 composite
- actions/checkout v3 composite
- actions/checkout v3 composite
- actions/checkout v3 composite
- s-weigand/setup-conda v1.1.1 composite
- urlstechie/urlchecker-action master composite
- actions/cache v3 composite
- actions/checkout v3 composite
- actions/checkout v3 composite
- seanmiddleditch/gha-setup-ninja master composite
- debian sid build
- debian buster build
- debian bullseye build
- quay.io/pypa/manylinux2010_x86_64 latest build
- breathe *
- docutils >=0.17.1
- matplotlib *
- numpy >=1.15
- pygments *
- recommonmark *
- scipy *
- sphinx >=5.3
- sphinx_rtd_theme >=1.1.1
- sphinxcontrib-svg2pdfconverter *
- sphinxcontrib.programoutput *
- cibuildwheel ==1.3.0
- numpy >=1.15.0,<2.0.0
- line.strip *