Avoid FP exception with empty .mdp file
authorMark Abraham <mark.j.abraham@gmail.com>
Wed, 12 Aug 2015 18:18:31 +0000 (20:18 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 13 Aug 2015 09:27:39 +0000 (11:27 +0200)
commit5306ce1dffa0272d41679bfe88c3f8a03ab6da22
treed0ebdc4bb49b72c593929c70fa55f5da66494add
parenta61c5d9bb56dacd08469bc7b436f531fcfe60ad8
Avoid FP exception with empty .mdp file

The default value for nsteps is zero, which used to lead to division
by zero in the above case. Refactored to avoid that.

Added a basic test case for grompp with an empty .mdp file (which
causes all default settings to be used). It is not optimal that the
mdrun integration test machinery is recycled for this, but
re-implementing or refactoring that to avoid the ugliness is not great
for a release branch.

Noted some TODOs. Renamed some variables for clarity.

Change-Id: I5c98c4f460f658277490b11f7fb5629d6fa84a08
src/gromacs/gmxpreprocess/grompp.c
src/programs/mdrun/tests/CMakeLists.txt
src/programs/mdrun/tests/grompp.cpp [new file with mode: 0644]