Skip to content
This repository has been archived by the owner. It is now read-only.

Improve scalability of insertion in LIGGGHTS #1

Merged
merged 1 commit into from Jul 21, 2015

Conversation

@rbberger
Copy link

@rbberger rbberger commented Jul 21, 2015

The current insertion algorithm exhibits poor scaling performance with a runtime complexity of O(n²). This is due to the fact that during each time step a utility data structure is build up to hold any particles which might collide with newly inserted particles. If a large number of particles is inserted this linear list of particles will grow accordingly. E.g. if 3 million particles are inserted, the last particle will check 2,999,999 particles for possible overlap.

To improve this situation, this PR introduces a cell list data structure around the insertion volume to replace the linear list of particles. This reduces lookup times during overlap checking.

The PR also includes a simple benchmark test case which can be used to compare the scaling of the old and the new version of the code. This test case simply inserts a specified number of particles into the domain box. The tests ranged from 10,000 - 150,000 particles. As the number of particles increases the achieved speedup of the optimized code continues to grow due to the better
runtime complexity. With a serial run (Intel Core i7-3770) of inserting 150,000 particles into a box a speedup of 76x was observed.

The full scaling change is summarized by the following Figure. While the old code exhibits O(n²) runtime complexity, the optimized variant shows nearly linear scaling. Notice the differences in order of magnitude in the run times of the first two graphs. In the final plot both results are merged into one graph.

insertion_opt_data

This patch reduces the computational overhead of particle insertion from
being O(n²) to O(n). It also includes a benchmark testcase for
insert/pack to illustrate the benefit.
@rbberger rbberger self-assigned this Jul 21, 2015
rbberger added a commit that referenced this pull request Jul 21, 2015
…tion

Improve scalability of insertion in LIGGGHTS
@rbberger rbberger merged commit 1c86e65 into develop Jul 21, 2015
@rbberger rbberger deleted the feature/insertion_optimization branch Jul 21, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant