Don't strip input state file in GROMACS (pre-2024) #642
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.
This follows the bug report in GROMACS forum here.
The bug lied in the name of the colvars restart file or (colvars input state file) which was
abf_dihedral_state.dat
so the lineinput_prefix_str.erase(input_prefix_str.rfind(".colvars.state"));
crashed.Furthermore, the function
colvarmodule::setup_input()
:colvars/src/colvarmodule.cpp
Lines 1346 to 1351 in 351bfd2
doesn't handle the case when the suffix is
.dat
. (suffix.dat
was introduced due to a limitation in file extension inmdrun
).So the most forward bugfix is to not strip the extension and let
setup_input()
takes the whole string as a filename.The downside is the variable
input_prefix_str
is also called incolvarmodule::print_total_forces_errning()
but according to @jhenin it's only called for code older than 2016colvars/src/colvarmodule.cpp
Line 1535 in 351bfd2
(it's basically a revert of commit efac865)