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

optimized_weights_computation_reg #2

Merged
merged 2 commits into from
Nov 12, 2024
Merged

optimized_weights_computation_reg #2

merged 2 commits into from
Nov 12, 2024

Conversation

mumairsadiq
Copy link

I suggest certain changes to weight computations for p2p phase (specifically init_reg_body function inside fmm.cpp).

Currently, We iterate over all the bodies to see if each body influences some cells. This is an exhaustive way of doing that.

I now pick a target cell and just see the bodies in its neighbouring cells if they have some influence on the target cell. This avoids looking into all leaf cells, which slows down computation particularly as the number of particles grows.

Also, I consider only those bodies for regularization which doesn't have weight one in their own cell.

I have tried a few experiments with this update on my workstation:

./test_reg -n 33876 -P 6 -m 16 -a fd -r 0.01

init_reg_body time is reduced from 0.47098 to 0.00800 seconds

./test/test_reg -n 120000 -P 6 -m 16 -a fd -r 0.01

init_reg_body time is reduced from 12.26815 to 0.05770 seconds

3drpp_appx/src/fmm.cpp Outdated Show resolved Hide resolved
@jooooow
Copy link
Contributor

jooooow commented Nov 11, 2024

@mumairsadiq
Aside from the suggestion above, I think the PeriodicInteractionMapP2P part is a very good optimization and suitable for parallel computing.

@jooooow jooooow merged commit 471b568 into reg Nov 12, 2024
@mumairsadiq mumairsadiq deleted the reg_um branch November 12, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants