You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(lammps): tally the global virial in deepmd/kk - #6153
Kokkos can request a global virial through the force–position tally when Newton pair is enabled. Tell LAMMPS that this style tallies the model virial explicitly so that thermo pressure uses the model output.
Compared deepmd/kk with deepmd on the same DPA4 configuration on an NVIDIA A800. Energy and diagonal pressure agreed for Newton on/off, with and without per-atom stress output (eight runs across both pair styles).
This change makes the Kokkos pair style use the model's global virial for thermo pressure, which fixes the zero pressure reported for the DPA4 case. The change is small and easy to revert, and no merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(lammps): tally the global virial in deepmd/kk" matches the main change. The diff sets no_virial_fdotr_compute to 1 in the PairDeepMDKokkos constructor, so deepmd/kk explicitly tallies t…
Linked Issues check
Issue #5983 reports that deepmd/kk leaves the global virial at zero when LAMMPS uses the force-position (FDOTR) tally, because the explicit reduction in pair_deepmd_kokkos.cpp runs only under vflag_gl…
Out of Scope Changes check
The whole-PR change set is a 2-line addition in source/lmp/pair_deepmd_kokkos.cpp (+2/-0 per the change summary). The added flag and its comment are directly tied to the global-virial objective of #59…
Full details: Title check
Explanation
The title "fix(lammps): tally the global virial in deepmd/kk" matches the main change. The diff sets no_virial_fdotr_compute to 1 in the PairDeepMDKokkos constructor, so deepmd/kk explicitly tallies the model global virial. The linked issue #5983 reports that deepmd/kk leaves the global virial unpopulated, which yields zero thermo pressure. The title names the component (deepmd/kk), the fix type, and the affected quantity.
Full details: Linked Issues check
Explanation
Issue #5983 reports that deepmd/kk leaves the global virial at zero when LAMMPS uses the force-position (FDOTR) tally, because the explicit reduction in pair_deepmd_kokkos.cpp runs only under vflag_global, and vflag_global is 0 in that case. The head adds no_virial_fdotr_compute = 1; in the PairDeepMDKokkos constructor (source/lmp/pair_deepmd_kokkos.cpp), with the comment that the style tallies the model virial explicitly, also for FDOTR requests. This makes LAMMPS request the explicit global tally, so the existing vflag_global reduction runs and fills virial[] used by thermo pressure. This addresses the root cause named in #5983. The diff hunk itself was read from the file at head; the author's eight-run A800 comparison (Newton on/off, per-atom stress on/off) is author-reported and was not independently re-run here. No coding requirement from #5983 is left unaddressed in the change set. Per-atom virial behavior is unchanged, as the issue requires.
Full details: Out of Scope Changes check
Explanation
The whole-PR change set is a 2-line addition in source/lmp/pair_deepmd_kokkos.cpp (+2/-0 per the change summary). The added flag and its comment are directly tied to the global-virial objective of #5983. No unrelated change was found in the summary or in the read constructor code.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: e5b95325-fc6a-4425-83be-09e8fc6f8594
Commits
Reviewing files that changed from the base of the PR and between ed85942 and 209b8d1.
Files selected for processing: 1
source/lmp/pair_deepmd_kokkos.cpp
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
This branch has not been deployed
No deployments
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
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.
Kokkos can request a global virial through the force–position tally when Newton pair is enabled. Tell LAMMPS that this style tallies the model virial explicitly so that thermo pressure uses the model output.
Compared
deepmd/kkwithdeepmdon the same DPA4 configuration on an NVIDIA A800. Energy and diagonal pressure agreed for Newton on/off, with and without per-atom stress output (eight runs across both pair styles).Closes #5983.
Summary by CodeRabbit