-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Access type READ_LINEAR #1291
Conversation
This pull request introduces 2 alerts when merging 77522f9 into 20e271b - view on LGTM.com new alerts:
|
9b590a8
to
018608b
Compare
This pull request introduces 2 alerts when merging 018608b into 20e271b - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 5b63442 into 20e271b - view on LGTM.com new alerts:
|
d581733
to
43d1316
Compare
a62161d
to
ff8f8e8
Compare
35ae314
to
be43a49
Compare
df20208
to
148706d
Compare
Currently only available for BP5 engine, will be generalized into Linear read mode in openPMD#1291. If the backend does not support the snapshot attribute, then iterate in ascending order, skipping duplicate and non-linear iteration indices. Not possible if the Series is parsed ahead of time.
54aec65
to
5681b62
Compare
Currently only available for BP5 engine, will be generalized into Linear read mode in openPMD#1291. If the backend does not support the snapshot attribute, then iterate in ascending order, skipping duplicate and non-linear iteration indices. Not possible if the Series is parsed ahead of time.
31f8eb0
to
cc24363
Compare
Currently only available for BP5 engine, will be generalized into Linear read mode in openPMD#1291. If the backend does not support the snapshot attribute, then iterate in ascending order, skipping duplicate and non-linear iteration indices. Not possible if the Series is parsed ahead of time.
cc24363
to
68a209f
Compare
src/IO/ADIOS/ADIOS2IOHandler.cpp
Outdated
m_mode = adios2::Mode::ReadRandomAccess; | ||
// Overwrite the old IO object since it is stained with the | ||
// objects of the now closed engine | ||
create_IO(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem: This deletes all configuration
8f0ac22
to
1c9907c
Compare
Use access::readOnly for runtime checks in backends
Needed so backends can give feedback on their preferred parse mode.
Commit with proper tests will follow later, this is just to highlight the API changes brought forth by this PR (API changes only for things that were dev and/or experimental)
32f1e65
to
dd68119
Compare
dd68119
to
87d2004
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me 🚀 ✨
Thank you also for the clear structure for reviewing 🙏
@@ -4923,6 +4925,17 @@ TEST_CASE("bp4_steps", "[serial][adios2]") | |||
bp4_steps("../samples/nullcore.bp", nullcore, ""); | |||
bp4_steps("../samples/bp4steps_default.bp", "{}", "{}"); | |||
|
|||
// bp4_steps( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just flagging: these tests are still commented - intentional?
Remove dead code in favor of a comment?
ParseMode::WithSnapshot, | ||
jsonConfigOld); | ||
// This test config does not make sense | ||
// append_mode( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just flagging: this test is still commented - intentional?
Remove and just leave a comment?
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
andadios2::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 ofREAD_ONLY
:READ_ONLY
corresponds 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
→ 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
-> /data/snapshot gets properly ignored, bp4_steps tests this
Commits:
Basic implementation
9a7fab7 Prepare scaffolding for Access::ReadLinearly
6f0e74c Adapt frontend to linear read mode
ed40837 Make OPEN_FILE task parameters writable
73bae08 ADIOS2 implementation
Testing and bindings
0b64fa2 Necessary fixes for tests
8dad845 Add and adapt Python bindings
0ff801b Testing
Documentation
b06d257 Documentation: C++ and Python
fbca5e8 rst documentation
Allow parsing global attributes before opening first iteration¹
c841156 Make SeriesIterator into a handle
357e487 Reading attributes without needing to open the first step
Workaround for ADIOS2 aggregation issue
891cba0 Don't write attributes too early
Delete old iterations from data structures ²
dd4228a Delete old iterations in READ_LINEAR mode
87d2004 DEREGISTER task
¹) In READ_LINEAR, the
Series
object is completely empty after constructing it. This is weird when we want to read global attributes:Solution:
²) In READ_LINEAR mode, iterations can only be accessed via
series.readIterations()
. We should not store them intoseries.iterations
(except the currently active one), to avoid (1) users getting confused why old iterations are still there and (2) slowly rising memory usage in long-running simulation workflows.