-
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
availableChunks open logic (HDF5: Early Chunk Read) #1035
Conversation
Add test.
for( auto & r_c : r.second ) | ||
{ | ||
std::cout << r_c.first << "\n"; | ||
if( !r_c.second.constant() ) |
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.
Memo to myself and unrelated to the issue: this if
can probably be removed now that #942 is implemented :)
Also: let's do something with the chunks
variable (e.g. print it).
Ref.: https://github.com/openPMD/openPMD-api/pull/862/files This test should fail for other backends, too. I claim "no bug". |
Thanks for the ideas! Why I tend to think that this is a usability bug and we should auto-open iterations in I mean also from the API contract it's logical that if a serial Series s = Series(...);
auto electrons = s.iterations[400].particles["electrons"];
auto chunks = electrons["position"]["x"].loadChunk(); works than a Series s = Series(...);
auto electrons = s.iterations[400].particles["electrons"];
auto chunks = electrons["position"]["x"].availableChunks(); should work the same way. Especially since the latter would be called before the former now with #802-guided processing.
Note that #862 is a MPI-parallel context where we want to trigger a MPI-collective open call with a collective guarantee because we use If course, if someone called in an MPI-parallel context
The problem became apparent to me in serial reads with |
src/backend/BaseRecordComponent.cpp
Outdated
this->dirty() = true; | ||
this->seriesFlush(); | ||
this->dirty() = false; | ||
|
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'm a bit doubtful about this..
- It makes the
availableChunks
call collective, we should at least document that availableChunks
will now silently flush the whole Series. This will break user code that peruses our new flushing logic and its guarantees of no writes occurring until flushing. If we really want to do this, this function must not do anything more than merely opening those files.
This code does not open the iteration,
This would make
We're making the problem parallel by implicit opening of files (and with the current implementation: implicit flushing).
It's weird that this would even work in ADIOS2, I'll need to have a look at what's going on there. Do you want |
After following the behavior of ADIOS2 in the debugger, this line implicitly opens an ADIOS2 engine if not yet happened. I would declare this a bug, such things should only happen if explicitly requested by the frontend. |
We will discuss this further on Wednesday. I think the cleanest way would be to:
I would thus also discuss if we want to apply #1045 really or if we instead rather implement a similar solution here. We currently don't need |
Memo to self: Try why |
try | ||
{ | ||
Series s = Series( | ||
"../samples/git-sample/data%T.h5", |
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.
Discussed: add (file based) adios2 test, too due to #1045
The changes in ax3l#1 make |
This reverts commit e2d54ba.
Fix conflicts: - docs/source/details/mpi.rst
@@ -4288,6 +4326,48 @@ void deferred_parsing( std::string const & extension ) | |||
std::numeric_limits< float >::epsilon() ); | |||
} | |||
} | |||
{ | |||
Series series( |
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.
Note: also fixes & tests read_write lazy parsing in this diff.
This adds a test for early reading of chunks (via
availableChunks
) with HDF5 that appears quite often with post-processing routines based on chunks.I have not yet found the reason for this fail, but it seems to be HDF5 specific (details documented in #961). Either the writable is a bit off or the file not yet open.
::open()
;expand that
Iteration::open()
is used only for (MPI || deferred iteration parsing), elaborate on open() relation to flushing logicavailableChunks
to table (behavior independent unless it's the first call to a freshly opened series)