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
new compute: reaxff/atom #3938
new compute: reaxff/atom #3938
Conversation
@rbberger Thanks for working on this. A few comments ... (1) This appears to be a per-atom compute, not a local compute ? (2) I don't see any logic using the group arg of the compute (3) If you stick with a per-atom compute, it appears you are making size_local_rows |
@rbberger I should also note that it is now possible for a single compute to generate both per-atom and local data. So if it is important to be able dump per-atom values (total_bond_order, nlp, numbonds) along with per-bond info (i,j,abo) then this |
7682b25
to
e560995
Compare
@rbberger I just merged PR #3896 which standardizes access to multiple types of computed data in fixes and computes from variables and similar. This is implementing some of the things that Steve mentioned but that were not available to the standard code at the time. So it may be advantageous to merge with upstream and check your code. |
@akohlmey thanks for the heads up. I was just running into this while trying to create the "Steve" version. |
@akohlmey if you look at the modified example you'll see I needed to hard code the columns for dump local, since the wildcard expansion prefers the peratom columns. It might be beneficial to allow the expansion function to set a preference. |
00183a0
to
f85b55a
Compare
f85b55a
to
e801804
Compare
@sjplimp updated the PR to now do both peratom and local arrays in the compute. You were right that it was breaking dump local. I'm still missing the group logic, but since that was also missing from the fix, I don't see it as a priority. I want to first nail down this base version. I've also created a Kokkos version that reuses the existing PackBuffer logic and then unpacks the buffer onto host arrays. @stanmoore1 can you take a look? |
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.
Hi Richard, this generally looks really good. I have a few minor points in the comments.
void ComputeReaxFFBondsKokkos<DeviceType>::init() | ||
{ | ||
reaxff = dynamic_cast<PairReaxFF*>(force->pair_match("^reax../kk",0)); | ||
if (reaxff == nullptr) error->all(FLERR,"Cannot use compute reaxff/bonds without " |
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.
Pair hybrid will break this logic, if there is more than 1 instance of pair reaxff
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.
Please see if fd83ed4 addresses your concerns.
template<class DeviceType> | ||
void ComputeReaxFFBondsKokkos<DeviceType>::init() | ||
{ | ||
reaxff = dynamic_cast<PairReaxFF*>(force->pair_match("^reax../kk",0)); |
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.
I think this may break if using the suffix command--it looks like force->pair_match
doesn't automatically append the suffix? You can check for reax
instead, then use the kokkosable
flag which is set by every pair style.
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.
Please see if fd83ed4 addresses your concerns.
@rbberger - thanks for the changes - a few more comments: (1) As mentioned earlier, for consistency with compute voronoi/atom, the name should probably be compute reaxff/atom or compute reaxff/bonds/atom (2) Similar to voronoi/atom, we should give users the option to (not) produce the (large) list of bonds. Voronoi/atom does this (3) I think the per-atom output should only be 3 values: total_bond_order, nlp, numneigh. The rest of the values can be accessed with standard dump custom keywords. Again, this is similar to compute voronoi/atom, with numneigh last. (4) @akohlmey I agree with Richard that utils::expand_args() should work // check for global vector/array, peratom array, local array
|
e7944a1
to
bf6c422
Compare
@rbberger Also, the use of numneigh[i] in the code was a bit confusing to me since that is neighbor list nomenclature in LAMMPS. |
@sjplimp that's just duplicating existing reaxff code (see fix reaxff/bonds). But of course, we can definitely give it better names. |
9cf04fc
to
16f0806
Compare
@sjplimp implemented (1), (2) and (3) from your last comment. Still missing @stanmoore1's comments. |
Thanks @rbberger - changes look good. Just this small item: Also, I'm still hoping you can add group logic (item (2) in my Oct 12 comment), before this is merged. |
@sjplimp (1) makes sense, I actually got a question of how to transform it to |
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.
Looks good to me.
I ran this through Kokkos regression testing, everything passed (though the modified example is not included, so the new code was not run). |
Python unit tests failed, seems unrelated to this PR:
|
I suspect it may be related to PR #4011 in upstream, but the failures are somewhat random. I only see them on the Azure macOS instances that have python 3.12. |
Summary
This new compute allows extracting the local bond information from ReaxFF.
Related Issue(s)
Author(s)
@rbberger
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
Implementation Notes
Post Submission Checklist
Further Information, Files, and Links