Skip to content
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

Resizable Datasets #829

Merged
merged 3 commits into from
Mar 23, 2021
Merged

Conversation

franzpoeschel
Copy link
Contributor

@franzpoeschel franzpoeschel commented Nov 26, 2020

Based on topic-available-chunks since that one will be merged soon anyway.
Based on #927 since this requires ADIOS 2.7.0, see here for the diff.

Motivation: For some simulations, it is impossible to know at the beginning of writing an iteration's data e.g. the number of particles to expect until the end of the iteration. Hence, an iteration's datasets need to be resized while writing the iteration.

Hence, allow calling RecordComponent::resetDataset multiple times with multiple dimensions.

  • This does not (yet) allow turning (1) empty (2) constant (3) array-form datasets into one another. This would be much trickier to implement and is not really necessary for the use cases above.
    EDIT: empty and constant record components can now be turned into one another and extending the extents of any of those two is fully supported.
  • →Throw exceptions if empty/constant datasets are turned into an array-formed one. Other directions are already tested.
  • The frontend does not compare the new extent to the old extent in any form whatsoever. Supporting (1) shrinking or (2) changing the dimensionality is the decision of the backend. Growing should generally be supported.

TODO:

  • Documentation
  • Implementation in the frontend.
  • ADIOS2: Apparently, the ADIOS2 semantics for resizing datasets are targeted for a different use case: Variable<T>::SetShape does nothing to a variable within the same ADIOS step. So, the ADIOS semantics for resizing datasets are for a use case that we have been supporting for a long time anyway (by creating new datasets for each iteration): Having different-sized datasets across steps/iterations. Unless I'm missing something, implementing this in ADIOS2 is currently not possible. Within the same step, ADIOS2 will currently fully ignore the resizing and any write operation to any of the extended places. Enable changing Variable shape (global dimensions) of global arrays w… ornladios/ADIOS2#2545 fixes this. This means, we'll need to wait for ADIOS 2.7.0 to merge this PR. This is also the reason for the failing tests.
  • JSON
  • HDF5. There is already an old implementation of resizing datasets in there, it's just never been used and I'll need to check whether it works. HDF5 only allows this when writing with chunked storage HDF5: Chunking #406. So I suppose that this one is postponed until we implement writing chunked storage in HDF5. HDF5IOHandlerImpl::extendDataset will now throw an exception that gives notice of this.

@franzpoeschel franzpoeschel force-pushed the topic-resizable-datasets branch 2 times, most recently from e5b23b0 to 68597c7 Compare November 26, 2020 11:05
@ax3l ax3l added the api: new additions to the API label Dec 4, 2020
@franzpoeschel franzpoeschel force-pushed the topic-resizable-datasets branch 2 times, most recently from d70565d to 94bcd79 Compare February 17, 2021 10:00
@franzpoeschel franzpoeschel force-pushed the topic-resizable-datasets branch 5 times, most recently from febca48 to 0031bc2 Compare February 24, 2021 16:57
@franzpoeschel
Copy link
Contributor Author

Note to self: Rebase this back onto #927 once that one is rebased on the current dev.

@franzpoeschel franzpoeschel force-pushed the topic-resizable-datasets branch 3 times, most recently from 54a8c42 to facaa3e Compare February 26, 2021 17:19
@franzpoeschel franzpoeschel changed the title [WIP] Resizable Datasets Resizable Datasets Mar 9, 2021
@ax3l ax3l self-requested a review March 9, 2021 18:21
@ax3l ax3l self-assigned this Mar 9, 2021
@ax3l ax3l enabled auto-merge (squash) March 23, 2021 17:58
@ax3l ax3l merged commit fa714a9 into openPMD:dev Mar 23, 2021
@ax3l ax3l mentioned this pull request Jun 11, 2021
5 tasks
@ax3l ax3l mentioned this pull request Jun 25, 2021
std::iota( data2.begin(), data2.end(), 25 );
{
Series write( filename, Access::CREATE, MPI_COMM_WORLD );
if( ext == "bp" && write.backend() != "ADIOS2" )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no, this does not execute. The backend name is MPI_ADIOS2.
Correct syntax: if( ext == "bp" && write.backend() == "MPI_ADIOS1" )

#1126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants