-
Notifications
You must be signed in to change notification settings - Fork 32
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
Draft: Multiple types/packs for multiple types #742
Open
brryan
wants to merge
17
commits into
develop
Choose a base branch
from
brryan/sparse_pack_typing
base: develop
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brryan
commented
Oct 5, 2022
tst/unit/test_sparse_pack.cpp
Outdated
@@ -128,10 +128,10 @@ TEST_CASE("Test behavior of sparse packs", "[SparsePack]") { | |||
"blocks") { | |||
// Create a pack use type variables | |||
auto sparse_pack = | |||
parthenon::SparsePack<v5, v3>::Get(&mesh_data, {Metadata::WithFluxes}); | |||
parthenon::SparsePack<v5, v3>::Get<MeshData<Real>, Real>(&mesh_data, {Metadata::WithFluxes}); |
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.
It would be great to not have to be explicit about MeshData<Real>
in the template parameter list here but I couldn't immediately figure out how to do it.
… into brryan/sparse_pack_typing
brryan
changed the title
Multiple types/packs for multiple types
Draft: Multiple types/packs for multiple types
Oct 7, 2022
@brryan Can we close this one? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
We would like:
Real
andint
types)Support for arbitrary types for parthenon cell variables.This PR attempts to implement this by
SparsePack
s on a datatypeReplacingvarVector_
andvarMap_
ofCellVariable
inMesh*Data
with aParams
-like type-erased container that can return a vector of allCellVariables
of a particular typeReplaceAdd
forCellVariables
with a function templated on datatype (maybe defaulting toReal
)SparsePack
to also support packingParticleVariable
s of a particularSwarm
Resolve buffer packing of different-sized typesAllowing arbitrary types in
CellVariable
s has some potential complications that we may want to just deliberately avoid at least for now. For example how does one prolongate/restrict a cell-centeredenum
? If non-Real
CellVariable
s are enrolled do we just require for now that they not haveFillGhost
? It might also be possible to allow/require developers to enroll their own prolongation/restriction operators for non-Real
(or alsoReal
?) types.There also needs to be some rule for packing non-
Real
-sized data into buffers. The easiest thing (that particles already do in a similar context) is to assume other types are the same size as or smaller thanReal
and then just use casts going in and out of the buffer.If the custom types framework were sufficiently flexible one could use vector types to have a fastest moving index other than
i
as @forrestglines pointed out the other day.PR Checklist