Periodic gravity calculation
This is a large re-write of the periodic gravity calculation in the light of the inaccuracies spotted in high-redshift test cases.
The main changes are:
- Decouple the mesh on which the gravity forces are computed from the top-level grid.
- Interpolate the mesh forces directly to the particles rather than to the multipoles.
- Correct the long-range M2L kernel in the case of periodic BCs.
- Correct the way we compute the exact solution with periodic BCs.
- Add a cosmological term to the potential to reflect the normalisation at infinity.
- Only create pair tasks and recurse in them only if the distance between them is above the scale where forces are 0.
- Help the compiler vectorize more of the gravity code by flagging so-called
const
functions as such. - Updates to the theory documents.
- Ignore the co-moving softening when not running with cosmology (implements #439 (closed)).
- Add an option to undo the 1/sqrt(a) factor in the velocities of Gadget ICs (implements #438 (closed)).
- Adds a cosmology test case with a correct parameter file (fixes #429 (closed)).
One important thing is that I have disabled the use of MPI for periodic gravity for now. I still need to work on this aspect but I'd like the rest to be tested first and secured in the master branch.
Merge request reports
Activity
added enhancement label
added SPH label
added 1 commit
- fcb8e0e0 - Make the long-range gravity task lock/unlock the multipoles and not the gparts.
added 1 commit
- e987e310 - Move the addition to the interaction counter before the MAC check in the long-range task.
Tried running EAGLE_50 on COSMA7:
../swift -a -t 28 -s -G -S eagle_50.yml
with the undefined sanitizer on and we get a couple of signed int overflows:
engine.c:3116:35: runtime error: signed integer overflow: 69457614 * 54 cannot be represented in type 'int' engine.c:3120:35: runtime error: signed integer overflow: 69457614 * 125 cannot be represented in type 'int'
So
s->size_links
is going to be wrong. Sure I've ran this on one node before, so either the total number of cells has grown a lot, or it wasn't fatal for some reason. Will try this out on master.OK, done that job is now running steps.
Edited by Peter W. Draper- Resolved by Matthieu Schaller
The next, single node job on COSMA7, ran until step 2 at which point it exceeded the memory limit and was killed (by SLURM). I'll try raising cell_split_size a bit...
Edited by Peter W. DraperGot a different result this time, still stopped during step 2 with:
[06370.6] mesh_gravity.c:mesh_to_gparts_CIC():202: Invalid gpart position in x
This is with debugging checks enabled.
Repeating this with EAGLE_25 sees the same check failing during step 4.
... and with EAGLE_12 during step 2.
Here are the details:
gnu_comp/7.3.0 gsl/2.4 parallel_hdf5/1.8.20 fftw/3.3.7
./configure --enable-debugging-checks --enable-sanitizer --enable-undefined-sanitizer
../swift -a -t 14 -s -G -S eagle_12.yml
Running with
-c
seems to work for EAGLE_12, I'll try that on the larger volumes, but this is one for you.added 1 commit
- 4032bd5a - Allow the code to compile with lower-order multipoles.
added 1 commit
- 268196ea - Make scheduler_reweight() robust against integer over-flow
added 1 commit
- c4f17f91 - Create the infrastructure to stop and restart with the pm_mesh switched on.
Sadly that only got to step 2 and aborted with:
[02314.4] runner.c:runner_do_ghost():922: Smoothing length failed to converge on 1 particles.
BTW, that check seems to be just a repeat of the code in the debugging section just before it (I also disabled debugging checks this time), I'm sure we could loose that...
added 1 commit
- 5106ef95 - Do not compute the high-order softened derivatives as the resulting term is 0 anyway.
added 4 commits
Toggle commit listadded 1 commit
- 566ab02f - Removed the old outdated cosmological test volume tests.
added 1 commit
- 2987a26b - Added the small cosmological box example provided by Chris Power.