Skip to content
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

Use contiguous memory layout for neighbor lists #10

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

efaulhaber
Copy link
Member

@efaulhaber efaulhaber commented May 11, 2024

Based on #9.

For cheap artificial benchmarks like count_neighbors (see #18), the difference is huge. But it's more interesting to see real-life benchmarks, so I ran a 2D TLSPH benchmark (of interact!) on a perturbed rectangular point cloud.
The difference on a single thread is <1%:
grafik
On 64 threads, we're talking about a 14% speedup for 6.5 million particles and 44% for 26 million particles.
grafik
Interestingly, there is absolutely no speedup in 3D. I'm assuming because there is more computation per particle-neighbor pair and the neighbor lists are >3x larger, so cache misses in the neighbor lists are insignificant.
Note that this memory layout is also GPU-compatible, as opposed to the Vector of Vectors.

Copy link

codecov bot commented May 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.60%. Comparing base (989d0c0) to head (ac18b79).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
+ Coverage   85.02%   87.60%   +2.57%     
==========================================
  Files           9       10       +1     
  Lines         207      250      +43     
==========================================
+ Hits          176      219      +43     
  Misses         31       31              
Flag Coverage Δ
unit 87.60% <100.00%> (+2.57%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@efaulhaber efaulhaber force-pushed the ef/neighbor-lists-vectorofvectors branch 2 times, most recently from 87d232f to 4fbd32d Compare May 16, 2024 15:40
@efaulhaber efaulhaber force-pushed the ef/neighbor-lists-vectorofvectors branch from 4fbd32d to eedc1e3 Compare May 29, 2024 11:18
@efaulhaber efaulhaber force-pushed the ef/neighbor-lists-vectorofvectors branch 4 times, most recently from 43e4cf6 to 2209334 Compare June 7, 2024 14:36
@efaulhaber efaulhaber force-pushed the ef/neighbor-lists-vectorofvectors branch from 69646c3 to ce9153f Compare June 11, 2024 14:22
@efaulhaber efaulhaber self-assigned this Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant