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

Fix particle patches flush api #1626

Merged
merged 4 commits into from
Jun 11, 2024

Conversation

franzpoeschel
Copy link
Contributor

I don't understand our current particle patches flushing logic and it has led to surprising situations in the past often enough. For some reason, we initialize "numParticles" and "numParticlesOffset" (but not "offset" and "extent"???) upon creation of ParticleSpecies, but then flush the patches only if there are 3 or more records in the patches (since with numParticles and numParticlesOffset there are 2 already).....

Since #1594, we have all regular storeChunk() API calls in PatchRecordComponent, including the Span API which breaks under this logic, since it requires flushing the structure to the backend immediately internally and cannot handle being skipped by this item count.

Additionally, as a further follow-up to #1594 this erases special patch handling from openpmd-pipe since we can now just use the regular API calls.

Maybe the old logic made sense at some point, I don't recognize any
sense in it now. Specifically, it now leads to trouble in span-based
write access, so remove it.
@franzpoeschel franzpoeschel force-pushed the fix-particle-patches-flush-api branch from eaae4b1 to 72d09b6 Compare June 7, 2024 12:43
@franzpoeschel franzpoeschel requested a review from ax3l June 10, 2024 09:12
@ax3l ax3l self-assigned this Jun 11, 2024
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.

LGTM

@ax3l ax3l merged commit 534706f into openPMD:dev Jun 11, 2024
31 checks passed
franzpoeschel added a commit to franzpoeschel/openPMD-api that referenced this pull request Jun 25, 2024
Accidentally deleted as part of openPMD#1626
franzpoeschel added a commit that referenced this pull request Jun 25, 2024
Accidentally deleted as part of #1626
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