Colvars / colvars

Collective variables library for molecular simulation and analysis programs
http://colvars.github.io/
GNU Lesser General Public License v3.0
196 stars 56 forks source link

Backup files consistently with GROMACS standard #670

Closed giacomofiorin closed 3 months ago

giacomofiorin commented 3 months ago

This PR restores the overridden version of backup_file(), which existed in the patched releases but not in the MDModules version.

The scheme is simple:

  1. If the filename ends with .colvars.state, keep a single backup copy ending with .old (consistent with current behavior), as this is the typical behavior for checkpoints. The extension differs from the CPT because the code that handles it is different and there will be some edge cases.
  2. For all other files, call the relevant GROMACS function to handle multiple backup copies.

Fixes #669

HubLot commented 3 months ago

Good catch. The behavior will be more consistent with GROMACS spirit