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
GROMACS: grompp refuses topologies with position restraints (no -r passed) #253
GROMACS energy minimisation (runtype Optimize) of a clay/water system with a MINFF topology is rejected before submission by the Launch check (gromacs.launchpp):
command: /usr/bin/gmx grompp -f gromacs.mdp -c conf.gro -p topol.top -o .../check.tpr -po .../mdout.mdp -maxwarn 0
Fatal error:
Cannot find position restraint file restraint.gro (option -r).
From GROMACS-2018, you need to specify the position restraint coordinate files
explicitly to avoid mistakes, although you can still use the same file as you
specify for the -c option.
Inputs. The structure is em.gro and the topology processed.top. processed.top is grompp's -pp output from the original setup, which was run with define = -Dcis_Oct_Mg2cis_Fe3cis_k500 -DOPC3_IOD_LM -DFLEXIBLE -DPOSRES_noH. Its #ifdef blocks are therefore resolved, and it holds three unconditional [ position_restraints ] sections (molecule types MMT1–MMT3).
Cause. A topology with position restraints needs a reference structure on grompp's -r. ECCE never passes -r, neither in the launch check (gromacs.launchpp) nor, presumably, in the job script that gensub writes. So any topology with restraints is refused, whether they come from a processed topology or from a define = -DPOSRES the user set.
Proposed fix.
Pass -r to grompp in both places whenever the topology (after #include, and with the job's define) has a [ position_restraints ] section. Use the input structure (conf.gro) unless the user supplies a separate reference structure; GROMACS allows the same file for -c and -r.
Possibly offer an optional "restraint reference" file in the GROMACS editor.
Add a test case with a restrained topology to the GROMACS tests.
Related: MINFF (#241). Not worked on yet (budget); logged for the next round.
Fixed on branch wip/a9-more (277057c), not yet on main.
Change. Both grompp calls now pass the starting structure as the position-restraint reference, -r conf.gro: the launch check (scripts/parsers/gromacs.launchpp) and the job script written by scripts/gensub. The job script did have the same gap as the launch check. -r is passed unconditionally. grompp ignores it for a topology without restraints, so no parsing of the topology or of define is needed.
Verification (GROMACS 2025.2).
The reported inputs (em.gro as conf.gro, processed.top as topol.top): without -r, grompp stops with "Cannot find position restraint file restraint.gro (option -r)". With -r conf.gro it builds the .tpr. The old gromacs.launchpp rejects these inputs and the new one accepts them.
The original em.mdp still fails, with a different cause. Its define = -D... -DPOSRES_noH names macros that the processed topology no longer uses, because grompp -pp has already resolved them. grompp raises this as a warning, and the check runs with -maxwarn 0, so the warning stops it. With a processed topology, the define line must go. ECCE's own .mdp (md.gmxtask) writes no define.
tests/gromacs_md: the four existing stages (unrestrained SPC water box: steep, NVT, NPT, MD) pass with -r. A new case is added: three SPC waters, with the first one held by an unconditional [ position_restraints ]. It goes through gromacs.launchpp, the gensub job script and mdrun, and the .tpr contains the restraint. Without -r, grompp refuses this case with the same error.
Not done: a separate "restraint reference" file in the GROMACS editor. The starting structure is always the reference.
The fix is on main (277057c, merged in af9e0a9) and was verified with the reported inputs (em.gro, processed.top) and the new restrained case in tests/gromacs_md. A walkthrough with the full MINFF workflow comes with the GROMACS round. Closing.
Activity
GROMACS: pass the starting structure to grompp as -r (#253)
ohlincha commentedon Oct 9, 2026
Fixed on branch
wip/a9-more(277057c), not yet onmain.Change. Both grompp calls now pass the starting structure as the position-restraint reference,
-r conf.gro: the launch check (scripts/parsers/gromacs.launchpp) and the job script written byscripts/gensub. The job script did have the same gap as the launch check.-ris passed unconditionally. grompp ignores it for a topology without restraints, so no parsing of the topology or ofdefineis needed.Verification (GROMACS 2025.2).
em.groasconf.gro,processed.topastopol.top): without-r, grompp stops with "Cannot find position restraint file restraint.gro (option -r)". With-r conf.groit builds the .tpr. The oldgromacs.launchpprejects these inputs and the new one accepts them.em.mdpstill fails, with a different cause. Itsdefine = -D... -DPOSRES_noHnames macros that the processed topology no longer uses, because grompp-pphas already resolved them. grompp raises this as a warning, and the check runs with-maxwarn 0, so the warning stops it. With a processed topology, thedefineline must go. ECCE's own .mdp (md.gmxtask) writes nodefine.tests/gromacs_md: the four existing stages (unrestrained SPC water box: steep, NVT, NPT, MD) pass with-r. A new case is added: three SPC waters, with the first one held by an unconditional[ position_restraints ]. It goes throughgromacs.launchpp, the gensub job script and mdrun, and the .tpr contains the restraint. Without-r, grompp refuses this case with the same error.Not done: a separate "restraint reference" file in the GROMACS editor. The starting structure is always the reference.
Merge wip/a9-more: CalcEd opens at its final size, property panes sha…
ohlincha commentedon Oct 12, 2026
The fix is on main (277057c, merged in af9e0a9) and was verified with the reported inputs (em.gro, processed.top) and the new restrained case in tests/gromacs_md. A walkthrough with the full MINFF workflow comes with the GROMACS round. Closing.