Skip to content

Deprecate Iteration.closed attribute#1088

Merged
ax3l merged 2 commits intoopenPMD:devfrom
franzpoeschel:remove-iteration-closedbywriter
Oct 19, 2021
Merged

Deprecate Iteration.closed attribute#1088
ax3l merged 2 commits intoopenPMD:devfrom
franzpoeschel:remove-iteration-closedbywriter

Conversation

@franzpoeschel
Copy link
Contributor

@franzpoeschel franzpoeschel commented Aug 16, 2021

  1. Don't write "closed" attribute in iterations any more
  2. Don't read it inside openPMD-api any more
  3. Deprecate Iteration::closedByWriter

This attribute was introduced during the work on our streaming API when openPMD iterations and ADIOS steps were not yet coupled as concepts. As a result, readers needed a way to know when an iteration was fully defined, for this, we introduced this attribute.
Nowadays, iterations are fully defined as soon as the reader sees them.

TODO:

  • Check that replacing iteration.closedByWriter() with iteration.written() is fine in our reading routines. (Should be fine, I want to carefully go through it in the debugger to be sure anyway).
  • Check that old versions of openPMD can successfully read datasets written without that attribute. Otherwise, we'll need to keep setting it for a while at least.
    EDIT: Yes, it's possible, but it turns out that the streaming read API is implemented inefficiently for groupbased series that don't use steps, because all iterations will be parsed anew in every step. This PR fixes that.
  • split PR into a backportable bugfix and a deprecation PR

@franzpoeschel franzpoeschel added api: breaking breaking API changes discussion labels Aug 16, 2021
// maybe re-read
auto & i = series.iterations.at( index );
if( guardClosed && i.closedByWriter() )
if( guardAgainstRereading && i.written() )
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that this logic (already before this PR) breaks deferred parsing in the following situation:

  • group-based interation encoding
  • no steps enabled in the backend
  • streaming-based API used for reading

I have a feeling that Series::readGorVBased will read all iterations upon the second time being called.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, all is fine. I've added a test for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@franzpoeschel comment for the bug

@franzpoeschel franzpoeschel changed the title [WIP] Deprecate Iteration.closed attribute Deprecate Iteration.closed attribute Aug 17, 2021
@ax3l ax3l self-requested a review September 7, 2021 17:58
@ax3l ax3l self-assigned this Sep 7, 2021
@franzpoeschel franzpoeschel force-pushed the remove-iteration-closedbywriter branch from 5339797 to e802dd7 Compare September 15, 2021 10:16
@franzpoeschel franzpoeschel added this to the 0.14.3 milestone Sep 22, 2021
@ax3l
Copy link
Member

ax3l commented Sep 22, 2021

Discussed today: let's split PR into a backportable bugfix and a deprecation PR so we can backport the bugfix to 0.14.3

@franzpoeschel
Copy link
Contributor Author

It seems that this already happened #1089 @ax3l

@franzpoeschel franzpoeschel removed this from the 0.14.3 milestone Sep 23, 2021
Don't write it no more, don't use it no more, mark
Iteration::closedByWriter() deprecated.
@franzpoeschel franzpoeschel force-pushed the remove-iteration-closedbywriter branch from e802dd7 to 5181315 Compare September 23, 2021 09:36
@ax3l ax3l merged commit c685528 into openPMD:dev Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: breaking breaking API changes discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants