-
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
Reconstruction Kernel Fusion 2: New Loading and Conversion Utility Functions #375
Merged
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
bcaddy
force-pushed
the
dev-pcmFusion-2
branch
from
February 26, 2024 16:47
5bac24f
to
009313c
Compare
Some variables were accidentally misnamed and there was a typo in part of VL_3D related to the exact solver. Both issues have been fixed
Added functions for cyclically permutting a hydro_utililties::Vector. One function permutes it once, the second permutes it twice
hydro_utilities::Load_Cell_Conserved loads all the data from a cell, uses cell centered magnetic fields
Replace the `reconstruction::Load_Data` with `hydro_utilities::Load_Cell_Primitive` in the PLMC reconstructor. This required templating `PLMC_cuda` for the value of `dir` and netted about a 6.5% improvement in performance
Replace the `reconstruction::Load_Data` with `hydro_utilities::Load_Cell_Primitive` in the PPMC_VL reconstructor. This required templating `PPMC_VL` for the value of `dir` and netted about a 6.0% improvement in performance
Replace the `reconstruction::Load_Data` with `hydro_utilities::Load_Cell_Primitive` in the PPMC_CTU reconstructor. This required templating `PPMC_CTU` for the value of `dir`
evaneschneider
approved these changes
May 22, 2024
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.
This all looks good.
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.
Summary
The primary purpose of this PR is to introduce 4 new utility functions for loading grid data and converting between the primitive and conserved variables. This builds off of PR #371 and will show changes from both that PR and this PR until #371 is merged into
dev
. Most of the relevant changes are in the following files:The data loading functions are both templates that take the direction as a template parameter and default to
dir = 0
. Per Issue #308 we've seen that this can improve performance noticeably. After integrating these new templated functions into PLMC and PPMC (and making them templates in the same way) I found a ~6% improvement in performance on a single V100. (timing data)hydro_utilities::Load_Cell_Conserved
This function loads the conserved data from the
dev_conserved
array and returns an assembledConserved
object.hydro_utilities::Load_Cell_Primitive
This function calls
hydro_utilities::Load_Cell_Conserved
and thenhydro_utilities::Conserved_2_Primitive
to load the conserved data, convert it to primitive, and returns aPrimitive
object.hydro_utilities::Conserved_2_Primitive
Converts the conserved variables in a
Conserved
object into primitive variables in aPrimitive
object and returns it.hydro_utilities::Primitive_2_Conserved
Converts the primitive variables in a
Primitive
object into conserved variables in aConserved
object and returns it.math_utils::Cyclic_Permute_Once
andmath_utils::Cyclic_Permute_Twice
These two functions take a
hydro_utilities::Vector
object and cyclically permute its members once or twice. It's used in theLoad_Cell_Conserved
function and I split it out on its own for clarity and because I thought it might be more generally useful. I tried to think of a single function that would do this more elegantly but I couldn't figure out a way, if you have suggestions I would be happy to hear them.Other
hydro_utilities::Conserved
reconstruction::Kind
, it hadPLMC
twice when one of them should have beenPPMC
.