Repository navigation
kenref: make the requested atoms whole before reading them - #1515
Merged
Merged
Conversation
KENREF fits all GUIDE_ATOMS at once and uses pair distances with no cutoff, so a molecule split across the periodic boundary gives a different energy. KEnRef (>= 2.0.0) builds a spanning tree over the reference at setup and defines makeRequestedAtomsWhole(), but nothing called it: getGuideAtomsX() and fillSubAtomsX() read getPositions() directly, and KEnRef's split check then stopped the run. getLocalModelX() now calls makeRequestedAtomsWhole() first, and both readers use the repaired positions. Whole input is unchanged bit for bit. A reference that is itself split is refused. New regtest rt-kenref-sigma-torn: a torn frame must give the same colvar and forces as the whole one.
v2.0.1 is KEnRef's newest release. Its changes from v2.0.0 are in the GROMACS interface only, so the kenref module is unaffected. The workflow resolves the tag to its commit for the cache key, so the new pin rebuilds the cached prefix.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
KENREFneeds whole molecules: it fits allGUIDE_ATOMSat once, and the pair distances have no cutoff. KEnRef (≥ 2.0.0) already does the setup work. It builds a spanning tree over the reference structure and definesmakeRequestedAtomsWhole(), which moves each requested atom to the periodic image nearest its tree parent. Nothing called it, though.getGuideAtomsX()andfillSubAtomsX()readgetPositions()directly, so on a molecule split across the box, KEnRef's split check stopped the run.This PR makes three small changes to
src/kenref/KEnRefBias.cpp:getLocalModelX()callsmakeRequestedAtomsWhole()first;getGuideAtomsX()andfillSubAtomsX()read the repaired positions.It also adds a paragraph to the
KENREFdocumentation and a note inmodule.md. For builds ofmastermade before this change, the note shows theMOLINFO ... WHOLE+WHOLEMOLECULESworkaround.Effect:
The declarations come from KEnRef's
KEnRefBias.h, so this needs KEnRef ≥ 2.0.0. That is already the floor inconfigure.ac(KENREF_MIN_VERSION). v2.0.0 has both functions, and so do v2.0.1 and KEnRefmaster, the default forKENREF_GIT_TAG.A second commit moves CI from KEnRef v2.0.0 to v2.0.1 (
.ci/install.kenref), its newest release. The changes since v2.0.0 are all in KEnRef's GROMACS interface. The workflow resolves the tag to its commit for the cache key, so the cached v2.0.0 prefix is not reused.New regtest
rt-kenref-sigma-torn. It uses the GB3 fragment ofrt-kenref-sigma, with residue 3 moved by −b and residue 5 by +a. The torn frame must give the same colvar and forces as the whole one, within 1e-6; the measured difference is ≤ 1e-11. The frames are.xyzrather than.pdb, because--mf_pdbstores single-precision coordinates. Without this change, the test fails (KEnRef refuses the split structure).Checked locally against KEnRef v2.0.0 (1dccb2d):
rt_validate_plumed.sh), noMOLINFO/WHOLEMOLECULESMOLINFO WHOLE+WHOLEMOLECULES(forces within 1e-10)--debug-ddon 2 and 4 ranks, GB3 and ubiquitin--multi 2, 2 ranks per replica vs 1regtest/kenref(4 tests)Prepared with the help of Claude.
Target release
I would like my code to appear in release 2.11 (
master).v2.10does not have the kenref module.Type of contribution
Copyright
COPYRIGHTfile with the correct license information. Code should be released under an open source license. I also used the commandcd src && ./header.sh mymodulenamein order to make sure the headers of the module are correct.Tests