Implement sorting of neighbor lists for PrecomputedNeighborhoodSearch#138
Implement sorting of neighbor lists for PrecomputedNeighborhoodSearch#138
PrecomputedNeighborhoodSearch#138Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements sorted neighbor lists for PrecomputedNeighborhoodSearch to improve cache performance on CPUs and coalesced memory access on GPUs. The optimization involves sorting neighbor lists after construction, which can be controlled via a new sort_neighbor_lists parameter.
Key Changes:
- Added
sorteach!function to sort each inner vector inDynamicVectorOfVectorsandVector{Vector{T}} - Integrated sorting into
PrecomputedNeighborhoodSearchwith a new configurablesort_neighbor_listsfield (defaulttrue) - Reorganized test suite into more structured testsets and added comprehensive tests for the new sorting functionality
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vector_of_vectors.jl | Implements sorteach! for sorting inner vectors; adds default_backend method for DynamicVectorOfVectors |
| src/nhs_precomputed.jl | Adds sort_neighbor_lists parameter to constructor and integrates sorting into neighbor list initialization |
| src/util.jl | Moves DynamicVectorOfVectors default_backend method to vector_of_vectors.jl; adds method for PermutedDimsArray |
| src/PointNeighbors.jl | Reorders includes to place util.jl before vector_of_vectors.jl to resolve dependencies |
| test/vector_of_vectors.jl | Reorganizes tests into testsets and adds new tests for sorteach! functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #138 +/- ##
==========================================
- Coverage 84.95% 84.75% -0.21%
==========================================
Files 15 15
Lines 698 715 +17
==========================================
+ Hits 593 606 +13
- Misses 105 109 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…mework/PointNeighbors.jl into ef/sort-neighbor-lists
This PR implements the "sorted NL" optimization mentioned in trixi-framework/TrixiParticles.jl#968. See this PR for benchmark results.