Speedup verlet list rebuild by copying neighbors into buffers#292
Merged
jkrajniak merged 11 commits intoespressopp:masterfrom Jan 6, 2020
Merged
Speedup verlet list rebuild by copying neighbors into buffers#292jkrajniak merged 11 commits intoespressopp:masterfrom
jkrajniak merged 11 commits intoespressopp:masterfrom
Conversation
added 8 commits
December 6, 2019 12:59
jkrajniak
requested changes
Jan 5, 2020
jkrajniak
approved these changes
Jan 6, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During each Verlet list rebuild, particle positions of neighboring cells of every cell are first copied into contiguous buffers (
c_pos). The buffers are then iterated over to determine the particle pairs that are within cutoff distance. This results in more cache-friendly access since the particle positions are stored contiguously instead of being stored in different memory locations (in the case ofparticlesinstd::vector< Cell >) and separated by other particle information. The cost of copying the data initially is amortized by the number of times the buffer is iterated during the cutoff check (equal to the number of particles in the cell).I've added a test and comparison script that runs a Lennard-Jones simulation (
testsuite/verlet_list_buffer/verlet_list_buffer.py). With one process on a Broadwell node of Mogon 2, compiled with gcc 7.3.0 and -O3 optimization, the method results in around 2x speedup for the Resort part of the simulation.