Move modular simulator decision before checkpoint loading
authorPascal Merz <pascal.merz@me.com>
Wed, 12 Feb 2020 23:58:57 +0000 (16:58 -0700)
committerPascal Merz <pascal.merz@me.com>
Fri, 14 Feb 2020 02:08:06 +0000 (19:08 -0700)
commit42ba62e17be3c70beeb30a754f101ab79f012494
treebfce4cf00a1b5ab9f71410deb24de6b30db96ddf
parenta31b420b4af6cff4a79c1677c7280704ad43e80c
Move modular simulator decision before checkpoint loading

Currently, the decision on whether to use modular simulator is done
relatively late during the runner stage. This makes it impossible to
allow for different behavior at checkpoint loading time. The current
change therefore moves this decision before checkpoint loading time.
To achieve this, some adaptations were needed:

* Use gmx_mtop_interaction_count to determine whether virtual sites
  will be used before the respective object is created.
* The membrane embedding check via pointer is replaced by a boolean
  set earlier during the runner phase.
* The essential dynamics check was split to catch command line inputs
  during the runner phase, and mismatching checkpointing data during
  the simulator phase (mirroring legacy behavior in do_md()).
* Replace the ensemble restraint check by a low-level alternative
  for the early runner call (mimicking the distance restraint
  initialization), while keeping the current check for the
  simulator-level call. Note that as multi sims are disabled, this
  low-level test will effectively never fail, but the additional
  clarity is helpful in further development. The later test ensures
  that changes to the init_disres() don't make this check invalid -
  if they would ever get out of sync, the simulations would exit with
  a fatal error.

Refs #3377 (fixes point 1)

Change-Id: I635e033db51d6ecc8bf121c72730a121e04586dd
src/gromacs/mdrun/runner.cpp
src/gromacs/modularsimulator/modularsimulator.cpp
src/gromacs/modularsimulator/modularsimulator.h