-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add sparse communication buffers #663
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Overall I like this design. A plethora of comments below. Take them with a grain of salt, I didn't read too carefully.
One thing for consideration: Do we want to just have the sparse bvals be the bvals implementation? Rather than having duplicate code for sparse/non-sparse?
@Yurlungur: I think the idea would be to eventually have something like this be the bvals implementation (and it seems like it would be fairly straightforward to include face centered, etc. variables in the framework). That being said, my plan was to do this in parallel for now and remove |
Thanks for the quick update. My code parsing brain fully approves the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think you merged in the changes to the prolongation stuff correctly. Pleasantly easy thanks to your changes to the code. 😁
A few comments below. I might pick your brain down the line about the best way to make changes to the comms stuff going forward.
With the non-sparse versions of bvals_cc_in_one
and flux_correction_in_one
now deleted, should we not just remove the word sparse
from the names of the new files? Or does that pollute the diff too much? We could always clean things up later.
@Yurlungur: I agree the files should be renamed since they are not unique to sparse, but let's leave that for #704. |
PR Summary
This PR includes a new set of in-one boundary communication routines that are built to work with sparse variables and avoid the
CellCenteredBoundaryVariable
machinery. The boundary buffers, which inherit fromBufArray1D
, are reference counted and associated with a shared memory pool from which they are pulled and to which they are released when they are destroyed to minimize the number of allocations on device (seeutils/memory_pool.hpp
). Buffers are only allocated on sending blocks where sparse variables are allocated. TheCommBuffer
class wraps the memory pool buffers and provides a mechanism for signaling whether or not non-zero data is being sent from the sending block (both for same and differing rank communications).PR Checklist
sparse_advection
regression test