-
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
Fix issues exposed by running pair style unit tests with pair_modify nofdotr
#2736
Conversation
Not "all", only the first few. But it is pointless to try and fix them in USER-INTEL when the core code doesn't address the problem consistently for all non-accelerated pair styles. Also, for USER-INTEL the fix is often to check and error out, since many of them do not tally per-atom stress at all (for performance reasons). |
# Conflicts: # unittest/cplusplus/test_lammps_class.cpp
@athomps this is now almost complete. The only pending issue are the INTEL package specific failures, which are likely due to a limitation caused by the optimizations therein. Those pair styles don't support per-atom stress, for example. So I may have to address those in the tester tool rather than in the pair styles themselves. |
- no need to test for it - add a check and report an error if the nofdotr setting is used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. I approve.
Summary
Pair styles frequently use
F dot r
to determine the (global) virial and thus compute pressure. However, for computing per-atom stress this is accumulated for each pair. In addition there is the commandpair_modify nofdotr
to enforce that code path, even when no per-atom stress is requested. Of course those two code paths are supposed to produce the same results within the level possible by floating-point math. This pull request attempts to fix or flag situations where there is currently a discrepancy.Also a corresponding check was added to the unit test tool for pair styles.
Related Issue(s)
This was detected while working on PR #2708
Author(s)
Aidan Thompson, SNL and Axel Kohlmeyer, Temple U
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
Some setups that would previously run and produce erroneous results may abort now.
Implementation Notes
The basic fix to correct the behavior is that tallying of the virial needs to be done for either
vflag_global
orvflag_atom
, i.e. the test should be forvflag_either
and corresponding the thev_tally*()
orev_tally*()
functions need to compute the virial contribution for either case and then tally it to either the global or per-atom accumulators. For the OPENMP versions this requires changing the API so that the pointer to the "pair" class is passed along so that the various flags set byPair::ev_init()
are accessible.Beyond that, some pair styles had typos, were missing a call to a matching tally function or had a sign error on the arguments to the tally function. For the MEAM package the tallying had to be done manually and thus API for
meam_force()
changed accordingly.Pair styles affected (checked items have a fix in this PR):
This also include several peripheral fixes:
nighbor->find_request(this)
to look up existing neighbor list requests.Post Submission Checklist