-
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
ADIOS2 Append Mode #1007
ADIOS2 Append Mode #1007
Conversation
92526a7
to
966b1b2
Compare
I think useful would be a mode that overwrites a step exactly when it is re-opened again, but leaves older (and even newer) steps as they are. That's what people most expect and know from file-based output: files stay around until you overwrite one by one. Since output from checkpoint-restart should give again the same result as the prior run, this is also ok (no "invalid" older files, so to say). Alternatively, one could at a certain point (e.g. once during re-open/append) delete all steps after the restart step. |
That is possible to implement with file-based iteration encoding and APPEND mode, but it won't be possible with either group- or variable-based encoding. Adding steps to an existing file in ADIOS2 allows no reading or modifying of old steps, you're just appending to a BP file without caring what had previously been written to it. The problem is not file-based encoding, but variable-/step-based encodings with steps enabled for output data after loading a checkpoint. |
m_backendAccess == Access::APPEND ) | ||
{ | ||
// do we really want to have those as const members..? | ||
*const_cast< Access * >( &m_backendAccess ) = Access::CREATE; |
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.
I have now added some handling in the backend so that this isn't necessary any more. Could remove it.
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.
Update: Eh, let' keep it. Clean overwriting is better and in file-based encoding it's easy to achieve.
Uff, right. I put this on the ADIOS2 agenda. I think we could try to gracefully warn and skip such outputs in user-code if they exist, but definitely have to think about a workflow. |
|
Discussion update:
|
13e5a66
to
4537dff
Compare
58e137a
to
3dfc917
Compare
I think this is ready for review @ax3l |
5094fe1
to
0e60346
Compare
9a1a175
to
009e69a
Compare
009e69a
to
078f5c7
Compare
a65de2e
to
443e1a9
Compare
I've done further cleanup now. If it runs green, ready for review @ax3l |
d11a331
to
76b6f05
Compare
@franzpoeschel please needs a rebase. Collided with #1264 |
Also use switch statement in many frontend places for the Access enum. With 4 variants, if statements become increasingly unreadable and it's good to have compiler warnings if a case is forgotten. Try to avoid default branches. Also refactor `autoDetectPadding()` into a separate function since it is now needed in two places.
1) Make backends aware of Append mode 2) In ADIOS1, fix use of namespaces, only use #include statements outside of namespaces
Co-authored-by: Axel Huebl <[email protected]>
Co-authored-by: Axel Huebl <[email protected]>
36a6d2c
to
7afb99d
Compare
Our
READ_WRITE
mode is not quite adequate for use in ADIOS2, since ADIOS2 only allows either reading or writing, but ourREAD_WRITE
mode's workflow needs that both are working (#996). However, Append mode exposes an interface equivalent to that of the Write mode, but steps already on disk are not deleted, new ones are just appended. Hence, add a newAccess::APPEND
that unlikeREAD_WRITE
does not allow any reading, but does not overwrite anything either.The
READ_WRITE
mode currently does this. I would suggest to use new Append mode to support this more properly. Will need some tweaks in the frontend though where APPEND mode is currently treated as equivalent to WRITE mode.Idea: In filebased iteration encoding, coerce the backendAccess to CREATE. Any written iteration will then be overwritten in doubt.
READ_WRITE
mode light, unless you really need to read data.Update: See Truncate option for Engine Open mode Append ornladios/ADIOS2#2775
Will still not be trivial to implement, since a preceding read access might be necessary to figure out how many steps should be dropped. Would also require to specify from which iteration to restart writing.
Update: Given the proposed workflow with Truncate option for Engine Open mode Append ornladios/ADIOS2#2775, it would be most consistent to just overwrite iterations. Maybe use
Access::CREATE
again for the backendAccess.createFile
taskAlso, this introduces a new
Error.hpp
, so I don't need to again throwstd::runtime_errors
around.