-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add faster method for multi neighboring #2536
Conversation
@jtclemm testing has been mostly successful. I have updated the branch to the latest upstream version and did some (mostly) cosmetic changes. When running the in.comm_modify-002.txt
This looks like either something is not properly initialized when processing the input or some check requiring additional input or a different order of inputs needs to be added. |
FYI, all other failing tests have been updated to be compatible with the new code or are due to a bug in upstream that is fixed in a different pending PR. So addressing the one problem from above should be sufficient for now. In a future pull request we will have to look into creating some proper unit tests for this new feature (and other neighbor list features). |
Thank you for running the tests, I spent all my time verifying user-specified collections worked and forgot to check default cases. The problematic input script should now work with no memory errors. |
Summary
This pull request contains a slightly modified implementation of a new polydisperse neighboring method developed by Tom Shire, Kevin Stratford, and Kevin Hanley (references below). In the current multi implementation, there is a single binlist with a bin size set by the smallest interaction length. A separate stencil is then constructed for each atom type. For each itype, the stencil extends to the maximum interaction distance with other particles. In the new implementation, a separate binlist is used for each atom type and ~ntype^2 stencils are then constructed for itype-jtype pairs. Stencils extend up to the itype-jtype interaction distance.
This approach greatly speeds up the construction of neighbor lists and may also allow fewer ghost atoms to be communicated. If Newton is on and there are only half neighborlists, one only needs to loop through small particles to look for large neighbors to find cross-interactions. Therefore, small ghost atoms only need to be communicated a distance set by the small-small interaction. In all cases tested, the new method improves performance over the old multi method by a factor of 3+. Therefore, we renamed the old method multi/old and replaced multi with this new method.
In addition to upgrading multi, this pull request also cleans up redundancies in the nstencil classes. Previously, most stencil classes had a full, half+newton, and half+newtoff variety. However, the full and half+newtoff classes were redundant as both created what one might consider a fully "spherical" stencil. This contrasts to half+newton where stencils only included bins to the upper right creating a "hemi-spherical" stencil. To remove this redundancy, all half+newtoff stencils were removed and half+newton stencils were renamed half stencils. The logic in neighbor->choose_stencil() was accordingly updated.
Related Issue(s)
NA
Author(s)
Tom Shire (U. Glasgow)
Kevin Stratford (U. Edinburgh)
Kevin Hanley (U. Edinburgh)
Joel Clemmer (SNL - jtclemm@sandia.gov)
Licensing
By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).
Backward Compatibility
No foreseen issues, input scripts using the old multi style will automatically use the new multi style
Implementation Notes
This PR is still in progress. Remaining tasks include:
Extra items (probably a different PR):
Post Submission Checklist
Further Information, Files, and Links
Relevant links:
Journal article for old method
Journal article for new method
Technical document for new method
Original implementation of new method