Move mdrun mainFunction to client code.
commitf3ff9147ca51a69671d1b6e2141aa637b3c29c59
authorM. Eric Irrgang <ericirrgang@gmail.com>
Tue, 11 Sep 2018 10:01:50 +0000 (11 13:01 +0300)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 3 Oct 2018 11:33:15 +0000 (3 13:33 +0200)
treee6df97c21db72c8bfdb909664509fde3524552df
parent24e70bfafdf52da9b55477239c7b776471583083
Move mdrun mainFunction to client code.

supports gmxapi milestone 4, described at #2605

API clients need to be able to initialize and run MD simulations with
calls from separate code blocks or even translation units. Also, we
need clear distinctions between a pre-launch master Mdrunner and the
non-master Mdrunner threads.

In this change:

* Insert a Builder on which to develop the distinction between user
  interface and implementation code. User interface is handled in
  Director code, while the Builder and code further down the mdrun call
  stack should be user interface agnostic (i.e. not CLI-centric).
* Introduces a Context object to hold some resources. (see milestone 5
  and issue #2587)
* Prepare for more stateful Mdrunner objects, documenting resources in
  need of clearer management, describing future use cases and possible
  implementation details.
* Make Mdrunner non-copyable and not constructable by clients. Worker
  threads can initialize a new Mdrunner from the master instance with
  cloneOnSpawnedThread.
* Clarify parameter setting for spawned Mdrunner threads.
* Begin to encapsulate filename options available to client code from
  the actual client code.
* Remove extraneous variables `nfile` and `fnm`.

Later changes will:

* Separate Mdrunner into Launcher and Worker at mdrunner() call so that
  tMPI runner does not look reentrant.
* Hide data and clarify ownership / modernize memory management /
  clarify the subjects of the Builder `add` operations.
* Clarify separation of user interface from API parameters.
* Flesh out SimulationContext and related classes.

Refs #2605

Change-Id: I1db1d34b07ec0f8ba5f246ab763c74ad9eafe8f3
src/gromacs/mdrun/CMakeLists.txt
src/gromacs/mdrun/mdfilenames.h [new file with mode: 0644]
src/gromacs/mdrun/runner.cpp
src/gromacs/mdrun/runner.h
src/gromacs/mdrun/simulationcontext.cpp [new file with mode: 0644]
src/gromacs/mdrun/simulationcontext.h [new file with mode: 0644]
src/programs/mdrun/mdrun.cpp