-
Notifications
You must be signed in to change notification settings - Fork 35
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
VL+CT QoL Improvements #94
Merged
Merged
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
00214d0
First step in shifting the Riemann Solver to compute the fluxes from …
mabruzzo 41070ad
Refactored the internal energy source term to make use of pressure (i…
mabruzzo 4b23eca
Started updating EnzoMethodMHDVlct and EnzoEquationOfState to replace…
mabruzzo 63ad9b7
Refactored EnzoMethodMHDVlct so that the integration map holds the pa…
mabruzzo a8fa814
Renamed EnzoIntegrableUpdate as EnzoIntegrationQuanUpdate and changed…
mabruzzo 9f3ab8c
Tweaked EnzoBfieldMethod to reflect the change in the variable names
mabruzzo 270d9e9
Updated the website documentation for the hydro/mhd toolkit (except t…
mabruzzo de32f09
Updates to EnzoRiemann related to the shift to using primitives to co…
mabruzzo 9ffe97d
Merge branch 'master' into vlct-varnames
mabruzzo ee5ee15
Tweaked the tolerance on the VL+CT dual-energy cloud test for the HLL…
mabruzzo e0c43df
Apply most suggestions from code review
mabruzzo cba3d9d
Fixed compilation bug introduced in prior commit.
mabruzzo ba45e50
Fixed a minor bug in EnzoLazyPassiveScalarFieldList
mabruzzo 860d2a6
tweaked description of EnzoCenteredFieldRegistry in website docs (pos…
mabruzzo 722f041
Fixing typos in documentation (to address @gregbryan's PR Review comm…
mabruzzo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
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.
I've thought about this exact sort of change a lot, and I'm not sure whether this is an improvement or not.
The thing is that EFlt3DArray can be thought of as a shared pointer. By making a copy of it (what we have now), we pay the overhead of incrementing/decrementing the reference count (although the current case probably uses move semantics). By storing a reference to it, we avoid increments/decrements, but now we effectively have a reference to a pointer (which is similar to a pointer to a pointer). I'm not sure what's better
An alternative idea is just to mark
velocity_j
,velocity_k
,bfield_j
, andbfield_k
asconst
.The same sort of semantics apply to
Kokkos::Views
, so I'm willing to go with your instinct here. But before I change it, do you have anything else to add?.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.
We've been using essentially
const Kokkos:View&
recently, I appreciate that we keep the same object. Sometimes it can make debugging easier since the address of the container doesn't change between contexts.The other confusing piece to me is that all of our arrays can probably be made
const &
, since we even though we're changing data in the array we're not changing the data itself.I'm not planning on adding any more suggestions. I would suggest to try batching all of my suggestions together into one commit via
github
, then see if it compiles and runs. I've probably missed a few things that would also need to be constant but that should be straightfoward to find via the compiler. Worst case you could undo the commit entirely.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.
That's part of the reason why I've largely avoided referring to
EFlt3DArray
as aconst
in most places yet.When I originally developed
CelloArray
, a lot of it's design was strongly motivated by my familiarity with NumPy. I wasn't fond of the way that traditional "container-semantics" will produce a deepcopy when you perform an assignment (it also makes subarray creation more confusing). It was originally my intention to prevent modification of the contents forconst CelloArray
, but that led to some strange quirks in the Copy-Constructor and Copy-Assignment operation. (Some stuff with temporaries break. It's confusing to new users why certain things break, but I don't think it actually limits what we want to do in the main codebase)At around the time that I was struggling with this, I started reading about
Kokkos
and I realized thatCelloArray
has pointer-semantics just likeKokkos::View
(a better name forCelloArray
is probablyCelloView
), so I decided to lean into it.I'm working on something that might help the situation. I think I mentioned this before, but I've slowly been working on a new PR, in which I introduce support for
CelloArray<const T, D>
which prevents the contents of the array from being mutated (I needed to make sure that this case element access works right support and add code to facilitate casts fromCelloArray<T, D>
andCelloArray<const T, D>
). I got a little side-tracked over the past 2 weeks, but I hope to get back to it soon-ish. Once I'm done, it's my intention to aliasCelloArray<const enzo_float, D>
as something likeRdOnlyEFlt3DArray
(I'm definitely open to better names) and start introducing that throughout the VL+CT integrator.But, It might be worthwhile to discuss changing the
CelloArray
semantics:const CelloArray
totally immutable. I'm not convinced that it's completely impossible. It might be easier now that I have a working test suite and I'm planning to remove the bulk assignment stuff from theCelloArray
API (which will drastically simplify the implementation).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.
Just as an aside, the aforementioned support for
CelloArray<const T, D>
is being implemented as part of PR #113There 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.
For the
EFlt3DArray
arrays that are currently used, I do think usingconst EFlt3DArray&
is preferable toEFlt3DArray
since the array shouldn't be changed even if the data is changed, and using the compiler to enforce that is preferable.This would be the preferable syntax so that it's clear the array points to
const
data.I'd lean against aliasing the type. The code would be more explicit using
CelloArray<const enzo_float, D>
andCelloArray<enzo_float, D>
everywhere so that it's clear that it's aCelloArray
and references const or non-const data.Make it so
const CelloArray
means the data it points to can't be modified? I'm against that approach, I think it makes sense to preserveCelloArray<const T, D>
vs.const CelloArray<T, D>
type.