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

Bugfix to particle defragmentation #1185

Merged
merged 6 commits into from
Oct 6, 2024
Merged

Conversation

brryan
Copy link
Collaborator

@brryan brryan commented Oct 5, 2024

PR Summary

There was a bug in the defragmentation routine acting on particle lists. The issue was that empty indices weren't being updated after defragmentation. This PR fixes that.

As an aside: this produced the surprising effect that simulation correctness depended on frequency of simulation output, even when no particle fields were being output. This is because particle defragmentation is called during every output cycle. Not saying we can't do this, just mentioning it because it was unexpected. Shouldn't be a correctness issue if defragmentation actually works :)

PR Checklist

  • Code passes cpplint
  • New features are documented.
  • Adds a test for any bugs fixed. Adds tests for new features.
  • Code is formatted
  • Changes are summarized in CHANGELOG.md
  • Change is breaking (API, behavior, ...)
    • Change is additionally added to CHANGELOG.md in the breaking section
    • PR is marked as breaking
    • Short summary API changes at the top of the PR (plus optionally with an automated update/fix script)
  • CI has been triggered on Darwin for performance regression tests.
  • Docs build
  • (@lanl.gov employees) Update copyright on changed files

@brryan brryan requested review from pgrete, Yurlungur and pdmullen and removed request for pgrete October 5, 2024 20:04
Copy link
Collaborator

@pdmullen pdmullen left a comment

Choose a reason for hiding this comment

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

LGTM! The defrag in outputs happens even when particles aren't being dumped, which is also likely undesirable.

Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

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

Regarding defragging in output. We don't have to do this. I could make the output machinery not use it. But it was convenient.

example/particles/particles.cpp Show resolved Hide resolved
@brryan brryan enabled auto-merge (squash) October 6, 2024 19:37
@brryan brryan merged commit 5cddb6a into develop Oct 6, 2024
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants