openPMD-api
openPMD-api copied to clipboard
New Access type READ_LINEAR
Situation:
Using ADIOS2 steps in openPMD was always a bit challenging due to slightly incompatible IO workflows.
Traditionally in openPMD, we parse a Series upon opening it and users expect to use random-access for navigating through the Series. Alternatively, in ADIOS2 one can parse each iteration only after opening its corresponding IO step. With an IO step opened, ADIOS2 will only show the data pertaining to exactly that step and no other data (except for attributes that are designed to be constant). With the novel BP5 engine, this distinction is now mandatory to make since it has two access modes: adios2::Mode::Read and adios2::Mode::ReadRandomAccess.
Also adds the missing Append mode to the Python bindings.
This PR adds a new read mode READ_LINEAR and slightly restricts the usage of READ_ONLY:
READ_ONLYcorresponds to our traditional workflow of parsing everything up-front and then not again. It is implemented in the backend viaadios2::Mode::ReadRandomAccess. New in this PR: If the engine supports it at all, the Series will be parsed before opening any IO step. In variable-based iteration encoding, this means that data from a later iteration might leak into the first. Iterations that were parsed up front will not be parsed again upon opening their corresponding IO step. Optionally: Stop using IO steps altogether in this access mode in front- and backend. That would be API breaking for streaming (all other API breakage of this PR only affects the experimental new ADIOS2 schema), but with streaming, the other read mode makes more sense anyway.READ_LINEAR: Don't parse anything upon opening the Series. To get any data,Series::readIterations()must be used.
TODO
- [ ] Don't use steps at all in READ_ONLY (-> breaking change since this makes READ_LINEAR required for streaming workflows) → Probably best for the next release: Give a runtime warning when using READ_ONLY in contexts that should require READ_LINEAR (such as streaming), and disable the functionality altogether in the release after that
- [ ] Memory optimization: Delete old iterations in READ_LINEAR mode (also ok for a future PR)
- [ ] Merge #1237 first
- [x] ADIOS 2.7 compatibility
- [x] Actually test BP5, especially with old iteration encoding
- [ ] Documentation
This pull request introduces 2 alerts when merging 77522f91bccd6ff79407eb32c72f2dfee819e1ab into 20e271b1353caba349a6c7081c0ba84d4723e2a2 - view on LGTM.com
new alerts:
- 2 for Missing return statement
This pull request introduces 2 alerts when merging 018608bd76c35bafaae29fe807eed8dd23b96552 into 20e271b1353caba349a6c7081c0ba84d4723e2a2 - view on LGTM.com
new alerts:
- 2 for Missing return statement
This pull request introduces 2 alerts when merging 5b63442bf58f946c6db8f69f7a02ed9c6bcce3e4 into 20e271b1353caba349a6c7081c0ba84d4723e2a2 - view on LGTM.com
new alerts:
- 2 for Missing return statement