Remap optimizations - #61
Open
jacob-moore22 wants to merge 6 commits into
Open
jacob-moore22 wants to merge 6 commits into
jacob-moore22 wants to merge 6 commits into
Conversation
This file contains hidden or 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
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.
Description
Extracts the final optimization stage (
REMAP_OPT=6) out of the experimentalremap_dg_lumped_test_cuda.cppinto a clean, standalone implementation atexamples/reference_element/src/remap_dg_lumped_optimized.cpp, and factors the3x3 Jacobian math that was duplicated across its kernels into reusable inline
Kokkos helpers.
remap_dg_lumped_test_cuda.cppcarried six cumulative optimization levels behind#if REMAP_OPT >= N, plus scaffolding that only existed for experimentation. Noneof it was wired into the build. This PR keeps only the level-6 code path and drops
the scaffolding, taking the file from 2263 to 1503 lines while reproducing the
reference results exactly.
Optimizations retained (all previously validated at level 6):
FOR_FIRST/FOR_SECONDteam policydedicated pass rather than once per DOF
walks contiguous doubles
New shared helpers in
src/geometry/geometry.h, taking 9 doubles rather thanviews, as the natural counterpart to the existing scalar
det_3x3:invert_3x3(det, j00..j22, i00..i22)— the scalar Cramer inverse thatcramers_rule.hppwas missing (it has view-based forms only). This removes a~30-line block that was copy-pasted verbatim between
build_element_geometryand
build_surface_flux.nanson_area_normal(...)— reference normal to physical area normalHow Has This Been Tested?
The clean version is compared against
remap_dg_lumped_test_cuda.cppbuilt with-DREMAP_OPT=6, which is the exact code it was extracted from, so the two areexpected to agree bit-for-bit rather than merely to within a tolerance.
This was done on serial, OpenMP, and Cuda builds, and all passed.