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

MPI-compatible direct sum gravity test #220

Merged
merged 11 commits into from
Feb 11, 2022

Conversation

conradtchan
Copy link
Collaborator

Type of PR:
Bug fix

Description:
directsum_grav, the routine for calculating the gravitational force via direct summation is not MPI aware, and will give incorrect results when particles are distributed over multiple MPI tasks.

This PR shuffles all the particles onto the master task to calculate the direct summation, before allowing derivs to redistribute the particles across the MPI tasks. Care is taken to sort the particles by ID so that the test compares the results of the same particles.

Fixes #219

Testing:

make MPI=yes DEBUG=no SETUP=testgrav OPENMP=no phantomtest
mpirun -n 4 bin/phantomtest gravity

Did you run the bots? yes

due fxyz_ptmass and fxyz_ptmass_gas being allocated different sizes, the slice needs to be specified explicitly
@conradtchan conradtchan marked this pull request as ready for review February 10, 2022 04:35
@conradtchan conradtchan merged commit b528b43 into danieljprice:master Feb 11, 2022
@conradtchan conradtchan deleted the mpi-gravity branch February 11, 2022 00:17
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.

test_directsum does not work with MPI
2 participants