Tsjerk / Backward

Mapping from Coarse Grain Models to Atomistic (and Back)
GNU General Public License v2.0
14 stars 8 forks source link

Extend GMX version check to work also for versions > 5.x #5

Closed ricalessandri closed 5 years ago

ricalessandri commented 5 years ago

The GROMACS version check: grompp -h 2>&1 | sed -n '/^.*VERSION/{s///p;q;}' works only for GROMACS versions < 2016.x. As a consquence, the if statement which changes the default cutoff scheme to "group" is not executed, and backward crashes because of the error:

ERROR 1 [file 1-EM.mdp]:
  Energy group exclusions are not (yet) implemented for the Verlet scheme

Indeed, the line of $GROMPP -h which contains the GROMACS version keeps changing, as shown below. GMX 4.6.7: :-) VERSION 4.6.7 (-: GMX 5.1.5: GROMACS: gmx grompp, VERSION 5.1.5 GMX 2016.5: GROMACS: gmx grompp, version 2016.5 GMX 2018.1: GROMACS: gmx grompp, version 2018.1

The proposed code works in all these cases thus fixing this issue.