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

Store block gid and neighbor refinement levels in sparse packs #1167

Merged
merged 4 commits into from
Sep 13, 2024

Conversation

brryan
Copy link
Collaborator

@brryan brryan commented Sep 6, 2024

PR Summary

For certain discrete methods we need to know the refinement level of each cell across a face. This information is not currently available inside compute kernels. This PR add this data to sparse packs, along with the gid of each current block in the pack, which is also needed for certain algorithms.

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
Copy link
Collaborator Author

brryan commented Sep 6, 2024

There's currently no testing for this, I wasn't sure where the best place for unit tests might be. The sparse pack unit test doesn't initialize the necessary data in MeshBlocks, and I wasn't sure how to get MeshBlocks out of the forest machinery in test_forest.cpp

@brryan
Copy link
Collaborator Author

brryan commented Sep 6, 2024

This would obviate #1010

Copy link
Collaborator

@lroberts36 lroberts36 left a comment

Choose a reason for hiding this comment

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

This LGTM, but a few comments below about how we might save some space or remove the extra deep copy.

src/interface/sparse_pack_base.cpp Outdated Show resolved Hide resolved
src/interface/sparse_pack_base.cpp Outdated Show resolved Hide resolved
src/interface/sparse_pack_base.cpp Outdated Show resolved Hide resolved
src/outputs/parthenon_xdmf.cpp Show resolved Hide resolved
src/interface/sparse_pack_base.cpp Outdated Show resolved Hide resolved
@brryan
Copy link
Collaborator Author

brryan commented Sep 6, 2024

There's currently no testing for this, I wasn't sure where the best place for unit tests might be. The sparse pack unit test doesn't initialize the necessary data in MeshBlocks, and I wasn't sure how to get MeshBlocks out of the forest machinery in test_forest.cpp

Still untested but I did experiment in the fine_advection example that the GID and Level functions I added both don't segfault and return not-obviously-wrong data on both host and device.

@brryan brryan changed the title WIP: Store block gid and neighbor refinement levels in sparse packs Store block gid and neighbor refinement levels in sparse packs Sep 13, 2024
@brryan brryan enabled auto-merge (squash) September 13, 2024 01:57
@brryan brryan merged commit 4545780 into develop Sep 13, 2024
53 checks passed
@brryan brryan mentioned this pull request Oct 2, 2024
12 tasks
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