Skip to content

Conversation

franzpoeschel
Copy link
Contributor

@franzpoeschel franzpoeschel commented Aug 9, 2021

Noticed while working on #949, our refactored flush logic will sometimes forget to close a file

TODO

@franzpoeschel franzpoeschel force-pushed the fix-dont-forget-closing-files branch 2 times, most recently from e0def7e to d2435db Compare August 10, 2021 09:44
@franzpoeschel franzpoeschel force-pushed the fix-dont-forget-closing-files branch from d2435db to 3378311 Compare August 10, 2021 11:39
@franzpoeschel
Copy link
Contributor Author

I've added a failing test now and will push the fix again after the CI has run

@franzpoeschel
Copy link
Contributor Author

This fails less tests than I had hoped for, but it does fail some. (Also, it fails for me locally)
I'll push the fix to see that things go green.

@ax3l ax3l self-assigned this Aug 11, 2021
@ax3l ax3l self-requested a review August 11, 2021 05:48
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

Thank you, great catch! 👍

if( IOHandler()->m_frontendAccess == Access::READ_ONLY )
for( auto it = begin; it != end; ++it )
{
// Phase 1
Copy link
Member

Choose a reason for hiding this comment

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

What does Phase mean in this context? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just the 3 discrete steps that each iteration of the loop consists of: Flushing the frontend, closing the file, flushing the backend. I just added those comments as an optical guideline to find things faster.

Copy link
Member

Choose a reason for hiding this comment

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

Cool, thanks! Do we maybe want to add this to the comment, e.g. "Phase 1: flush frontend" etc.? Good to keep the context in such long logic chains :)

@ax3l ax3l merged commit f91c29b into openPMD:dev Aug 11, 2021
@ax3l ax3l added this to the 0.14.2 milestone Aug 11, 2021
ax3l pushed a commit to ax3l/openPMD-api that referenced this pull request Aug 18, 2021
* Failing test
* Bug fix: Don't forget closing files
ax3l added a commit that referenced this pull request Aug 18, 2021
* Bug fix: Don't forget closing files (#1083)

* Failing test
* Bug fix: Don't forget closing files

* HDF5: Fix String Vlen Attribute Reads (#1084)

We inofficially try to also support HDF5 variable lengths strings in
reading, just to increase compatibility.

This was never working it seems.

* Fix reading of vector attributes with only one contained value (#1085)

* Failing test

* Conversions in Attribute.hpp

1) single values to 1-value vectors
2) vectors to arrays
3) arrays to vectors

* Some cleanup in Attribute.hpp

1) Simplify types in DoConvert, remove unnecessary template parameter
2) Replace a long if-then-else chain by variantSrc::visit

* CoreTest: Fix std::array constructors

Make more widely compile-able.

* Explicit casting in some places

This avoids some warnings

* Intel compilers: Don't use variantSrc::visit

They don't like it

* Remove scattered checks for vector attributes

* Generalize icpc guard

As defined in CMake for compiler identification.

* Doc ICC version (2021.3.0)

* setAttribute: Reject Empty Strings (#1087)

* setAttribute: Reject Empty Strings

Some backends, especially HDF5, do not allow us to define zero-sized
strings. We thus need to catch this in the frontend and forward the
restriction to the user.

* Test: setAttribute("key", "") throws

* setAttribute Check: C++14 compatible

* Don't read iterations if they have already been parsed (#1089)

* Release: 0.14.2

Co-authored-by: Franz Pöschel <[email protected]>
@franzpoeschel franzpoeschel modified the milestones: 0.14.2, 0.14.3 Sep 24, 2021
@ax3l
Copy link
Member

ax3l commented Nov 3, 2021

I already applied this to 0.14.2 :)

@ax3l ax3l modified the milestones: 0.14.3, 0.14.2 Nov 3, 2021
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