Substitute BatchedTridiagonalSolver in SmootherTake #171
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
This PR refactors SmootherTake to use the new BatchedTridiagonalSolver class, replacing the previous vector-based approach with individual SymmetricTridiagonalSolver instances.
Beyond this core substitution, the PR includes significant improvements to code organization, documentation, and structure.
Key Changes
1. Batched Solver Integration
2. Code Reorganization
3. Enhanced Documentation
Added comprehensive header documentation explaining:
The coupled circle-radial smoothing algorithm
Mathematical formulation:
A_sc * u_sc = f_sc − A_sc^ortho * u_sc^ortho
Update sequence: Black-Circle → White-Circle → Black-Radial → White-Radial
Matrix structure and sparsity patterns
Boundary condition handling
4. Stencil and Indexing Cleanup
5. Solver Workflow Improvements
Benefits
Testing Notes
Performance validation required before merge
I have not been able to verify whether the new BatchedTridiagonalSolver yields satisfactory performance compared to the previous vector-based approach.Before merging this PR, I highly recommend that @EmilyBourne (or another team member) benchmarks the solver (Take + No extrapolation)
After adding
export OMP_NUM_THREADS=$maxOpenMPThreadsto run.sh, the new BatchedTridiagonalSolver does yield satisfactory performance. Using omp_set_num_threads(maxOpenMPThreads()) is not sufficient to set the correct thread count for Kokkos.All functional tests should pass without modification.
The coloring scheme change alters the iteration order but should not impact convergence or solution quality.
Merge Request - GuideLine Checklist
Guideline to check code before resolve WIP and approval, respectively.
As many checkboxes as possible should be ticked.
Checks by code author:
Always to be checked:
If functions were changed or functionality was added:
If new functionality was added:
If new third party software is used:
If new mathematical methods or epidemiological terms are used:
Checks by code reviewer(s):