Christian Blau [Mon, 2 Sep 2019 13:47:24 +0000 (15:47 +0200)]
Adding energy output field for density fitting
Added a new energy output field for energies that stem from the density
fitting code.
refs #2282
Change-Id: I78c64213f4b958f00a938f0a67c586c2f4e9033e
Pascal Merz [Tue, 9 Jul 2019 13:14:35 +0000 (07:14 -0600)]
ComputeGlobalsElement for the modular simulator
This element encapsulates the calls to `compute_globals`. A new
approach to fit the global computation calls into the client approach has
been proposed in I44a7193c, but a complete rewriting is currently outside
the scope of this effort. This element therefore aims at offering an
interface to the legacy implementation which is compatible with the new
simulator approach.
The element comes in 3 (templated) flavors: the leap-frog case, the first
call during a velocity-verlet integrator, and the second call during a
velocity-verlet integrator.
This commit is part of the commit chain introducing the new modular
simulator. Please see docs/doxygen/lib/modularsimulator.md for details
on the chosen approach. As the elements of the new simulator cannot all
be introduced in one commit, it might be worth to view Iaae1e205 to see
a working prototype of the approach.
Change-Id: I35f310daed6355dc9ea6b574d855929ec2fee6fe
Mark Abraham [Fri, 6 Sep 2019 12:08:14 +0000 (14:08 +0200)]
Clean up commrec uniformly
This was leaking commrec from gmx help during the building of
command-line completions, which the ASAN build sometimes complained
about.
Change-Id: I4ce53ba13187ea71102f5a93118978525da7061a
Szilárd Páll [Thu, 5 Sep 2019 10:26:59 +0000 (12:26 +0200)]
Add gpuupdate and gpucomm OnDemand tokens
These allow triggering the GPU update-constraints and the GPU direct
communcation development features (both PP-PME and halo exchange),
respectively.
Also added matrix configs for both with configs identical to those in
the gpubufferops for the sake of simplicity.
Added an OpenCL config to ensure the additons of uninmpled features on
that codepath don't break things.
Change-Id: Iaf308d9b55ff10d8e43b655c2e1708eb05a5b43c
Christian Blau [Mon, 2 Sep 2019 18:07:12 +0000 (20:07 +0200)]
Periodic boundary correction for density fitting
Corrects the periodic boundaries for density fittinng
such that always the periodic image closest to the center
of the density is chosen.
ref #2282
Change-Id: I46d9546d7dbb659e03070b4ba6ffd401eb7368c4
Berk Hess [Thu, 5 Sep 2019 13:33:46 +0000 (15:33 +0200)]
Extract getting of DDRankSetup
This change is only refactoring.
Change-Id: I9a7f8ce16fe81f0016b33139933336fcb49b48b4
Berk Hess [Thu, 5 Sep 2019 12:14:28 +0000 (14:14 +0200)]
Add PP grid info to DDRankSetup
This enables many functions to use only DDRankSetup instead of
the whole gmx_domdec_t.
This change is only refactoring.
Change-Id: I6467481e3e1fa27c035c70d34591a6db0eeae90d
Pascal Merz [Thu, 27 Jun 2019 07:09:57 +0000 (01:09 -0600)]
Introduce topology class for modular simulator
The topology object owns the local topology and holds a pointer to the global
topology owned by the ISimulator.
The local topology is only infrequently changed if domain decomposition is
on, and never otherwise. The topology therefore offers elements to register
as ITopologyClients. If they do so, they get an updated local topology whenever
it is changed, and can rely that their copy is valid until the next update. The
domain decomposition element is defined as friend class to be able to update
the local topology when needed.
This commit is part of the commit chain introducing the new modular
simulator. Please see docs/doxygen/lib/modularsimulator.md for details
on the chosen approach. As the elements of the new simulator cannot all
be introduced in one commit, it might be worth to view Iaae1e205 to see
a working prototype of the approach.
Change-Id: I89e4006809ac74785205c549781a90b2d8233688
Mark Abraham [Wed, 4 Sep 2019 15:18:22 +0000 (17:18 +0200)]
Update mdrun test comparison infrastructure
This change is refactoring and extension, no use is made of any new
capabilities.
Referred to position coordinates as coordinates, in line with
agreement elsewhere. Also referred to energy terms consistently,
rather than energy fields or tolerances.
Extended the range of mdp option parameters able to be tested
configurably with the contents of the simulation database.
Made energy and trajectory comparison machinery easier to use.
Trajectory comparison is now more configurable. Sometimes the test
runner will know that it is OK to compare the data in a test frame
with a reference frame even though one of them has data that the other
does not have, or will differ, etc. So, it is now possible to compare
e.g. a test trajectory that has a frame with velocities and not forces
with a reference trajectory whose frame has both velocities and
forces, and have the comparison be valid or not according to whether
the test runner expected the mismatch in contents.
Fixed issue with trajectory frame comparison assuming that coordinates
would always be present.
More use of std::string.
Change-Id: I6926380e271344e7bd1a7c6594cc604d7a68e67a
Pascal Merz [Thu, 5 Sep 2019 02:59:18 +0000 (20:59 -0600)]
Rename MicroState to StatePropagatorData for modular simulator
The name of the t_state replacement is changed from MicroState
to StatePropagatorData. Also, the write and read access to x/v/f
data is renamed to xxxView() and constXxxView() for additional
clarity and to avoid confusion with file writing operations.
This also removes the constraint element from the list of friend
classes, as there is no need for direct access to the state
anymore thanks to I28b58df4.
Change-Id: I1b5b966aafbfa6fe5c44c36416ebb25f38505b58
Berk Hess [Thu, 5 Sep 2019 09:57:08 +0000 (11:57 +0200)]
Extract DDRankSetup from gmx_domdec_comm_t
Change-Id: I5b16d624a375478928546788d1f8319e9d796100
Christian Blau [Mon, 2 Sep 2019 08:20:25 +0000 (10:20 +0200)]
Add reference density file option to densityfitting
Add option to density fitting to read reference density for
density fitting code.
refs #2282
Change-Id: I598b679a3c1c63b913a104d7ccff8e1643b3946d
Pascal Merz [Wed, 4 Sep 2019 22:36:49 +0000 (16:36 -0600)]
Adapt inheritance intendation to uncrustify
As discussed in I35f310da and some other commits along the modular
simulator chain, uncrustify insists on aligning the first inheritance
with the `final` keyword, as in
template <ComputeGlobalsAlgorithm algorithm>
class ComputeGlobalsElement final :
public ISimulatorElement,
public IEnergySignallerClient,
public ITrajectorySignallerClient,
public ITopologyHolderClient
It was therefore decided to align all inheritances to the same level,
as in
template <ComputeGlobalsAlgorithm algorithm>
class ComputeGlobalsElement final :
public ISimulatorElement,
public IEnergySignallerClient,
public ITrajectorySignallerClient,
public ITopologyHolderClient
This formatting will be reevaluated when uncrustify is replaced by
clang-format.
This commit applies this decision to the classes previously introduced
along the commit chain. It also addresses two typos in trajectoryelement.h.
Change-Id: I03b9fd142d822f7a7523e351f08a4044bff2cff4
Pascal Merz [Thu, 5 Sep 2019 02:27:31 +0000 (20:27 -0600)]
Make do_constrain_first() independent of t_state
This changes the do_constrain_first() function to directly take the
required state data (natoms, x, v, box, lambda[efptBONDED]) as input
instead of a pointer to the full t_state object. This makes subsequent
changes to the t_state object easier.
This also adds some trivial const qualifier for the box matrix in the
constraining functions.
Change-Id: I28b58df45481549cd93076334b0778e23e228154
Berk Hess [Wed, 4 Sep 2019 10:53:34 +0000 (12:53 +0200)]
Split off getting of the DD setup
Change-Id: I19e956b04a14df75e91b721954bba52abe49d1d8
Berk Hess [Wed, 4 Sep 2019 11:49:10 +0000 (13:49 +0200)]
Collect settings for DD in DDSettings
This change is only refactoring.
Change-Id: Icb32f8f5211ff3033c4d5c70afbfd24d4a8ffbf3
Berk Hess [Wed, 4 Sep 2019 07:53:36 +0000 (09:53 +0200)]
Extract getting of DDSystemInfo
This change is only refactoring.
Change-Id: Ie7127f0fd8219108de1385978a781a3c15fc6239
Berk Hess [Wed, 4 Sep 2019 08:03:46 +0000 (10:03 +0200)]
Simplify handling of DD bonded distances
To simplify and clarify the DD setup code, we now always always store
the systemInfo.minCutoffForMultiBody and use a separate flag to tell
if we should increase the cut-off distance for bonded communication.
There is a minor behavioral change in that with large domains and
bonded communication filtering or DLB, the bonded cut-off is now
5% of the bonded cut-off longer as the margin is now included.
This has a negligible effect on performance in all cases.
Change-Id: Id409353c517181ac56e8d3f1f36c22c705aa8077
Berk Hess [Wed, 4 Sep 2019 06:45:19 +0000 (08:45 +0200)]
Move constraint and bonded filtering info into DDSystemInfo
Change-Id: Ic3cc4b5da309ab3f8e719739a5a162cd2c2d62bf
Szilárd Páll [Wed, 4 Sep 2019 00:33:10 +0000 (02:33 +0200)]
Bump ARM HPC toolchain in post-submit to v19.3
Change-Id: Id27642e016ee47888c7c3a7dac426309288aff9e
Christian Blau [Tue, 3 Sep 2019 10:36:09 +0000 (12:36 +0200)]
Fix double overload in LocalAtomSet code when gmx::index is int
In cases where the int type matches the gmx::index (aka ptrdiff) type
two overloaded constructors in LocalAtomSetData became the same, as well
as the overloaded add method. This is now avoided by an enable_if
clause.
Change-Id: I139c7feff141928f71c71d6f6db3ee1bffe325b7
Szilárd Páll [Fri, 23 Aug 2019 16:12:35 +0000 (18:12 +0200)]
Add back a clang-tidy exception
Previous commit (658819) removed a clang-tidy exception that was
needed with clang 8, but the SIMD + GPU path have not been enabled
yet with clang-8 tidy. To be able to enable the pending CI configs
this change adds back the nolint exception.
Change-Id: I6be4856c64161a1a5f57849d13b4cdea335cc3bb
Christian Blau [Mon, 2 Sep 2019 08:12:31 +0000 (10:12 +0200)]
Read mrc file using file name
Provide a higher level class for reading an mrc file given file name and
convert the information read from the density file into coordinate
transformation and three-dimensional density data.
Change-Id: I30ac5c044c5433043224be288340b794455f8fc9
Berk Hess [Tue, 3 Sep 2019 20:43:34 +0000 (22:43 +0200)]
Move update grouping to DDSystemInfo
Change-Id: Ida28b87a4a0ff004d25ca4d6f0f78f30a19536dd
Magnus Lundborg [Wed, 19 Jun 2019 14:13:33 +0000 (16:13 +0200)]
Inline functions of calculations of FE interaction types.
The functions are so far only templated on the real
requirements of the softcore that is used.
This is one step towards templating the calculations
for SIMD.
Refs #2997.
Change-Id: I3fd119dce30f95eba4f8cd6f139f99260acf0e22
Berk Hess [Tue, 3 Sep 2019 18:52:08 +0000 (20:52 +0200)]
Change DD pme force buffer to std::vector
Change-Id: I8cf00535fab713911e3dbb24a4daed3eeb0b46ee
Berk Hess [Tue, 3 Sep 2019 12:59:17 +0000 (14:59 +0200)]
Initialize all members of gmx_domdec_t
Change-Id: I78958c9c0e72de77d6226685401b9a5ff19434aa
Szilárd Páll [Thu, 20 Jun 2019 18:54:01 +0000 (20:54 +0200)]
Centralize more MD/force shedule flags
This change creates an MdScheduleWorkload top-level class to store
information related to per-step, per search-phase, or per run schedule
information and moving the previous PpForceWorkload call into it.
This change also migrates force flags bitmask into a new class
stored in the MdWorkload class.
Change-Id: I142a76d9515e82b16b9a4100ffb00469d7f3d3c2
Berk Hess [Tue, 3 Sep 2019 09:06:54 +0000 (11:06 +0200)]
Extract DDSystemInfo from gmx_domdec_comm_t
This is only refactoring.
This is preparation for separating the DD grid choice from
the initialization of gmx_domdec_t.
Change-Id: I83d8ecdd1a4d21d0a791c463d092f66d0b28df51
Berk Hess [Tue, 3 Sep 2019 08:45:02 +0000 (10:45 +0200)]
Unify manual and auto DD grid choices
This change is only refactoring, except that now an assert is added
for consistency of the auto grid choice with the cell size limit.
Change-Id: I36306495881826de809e3d048d0ced52543674e2
Berk Hess [Tue, 3 Sep 2019 08:30:36 +0000 (10:30 +0200)]
Remove gmx_domdec_t from dd_choose_grid()
This change is only refactoring.
Change-Id: I2d658739da1f0ff185ab89a5efe2361da0c7fa82
Berk Hess [Tue, 3 Sep 2019 07:40:10 +0000 (09:40 +0200)]
Extact UnitCellInfo from gmx_domdec_t
This required adding an explicit constructor for gmx_domdec_t,
which is currently incomplete.
Change-Id: Iba39fec36945465bffaf97d499c56501500ecb3b
M. Eric Irrgang [Thu, 29 Aug 2019 18:28:43 +0000 (21:28 +0300)]
Python wrapping code for gmxapi mdrun bindings.
Expose the mdrun bindings to the Python interface.
Updates workflow.py and context.py from 0.0.7.4 tagged release of external project.
Refs #2893
Refs #2912
Refs #3027
Change-Id: I44a66646eceb191a2ec755169671af326f22526a
Pascal Merz [Thu, 27 Jun 2019 07:09:43 +0000 (01:09 -0600)]
Introduce energy element for modular simulator
The energy element owns energy related data (energies for output,
tensors for virial and pressure, mu_tot vector), and holds pointers
to energy-related data owned by ISimulator (enerd, ekind). It is
responsible for calculating energies at steps, and writing energies
to trajectory files. It offers interface access to add data to the
virials, but also offers raw pointers, as not a lot of functionality
across GROMACS relies on getting raw pointers to the tensors /
mu_tot vector.
This commit is part of the commit chain introducing the new modular
simulator. Please see docs/doxygen/lib/modularsimulator.md for details
on the chosen approach. As the elements of the new simulator cannot all
be introduced in one commit, it might be worth to view Iaae1e205 to see
a working prototype of the approach.
Improved handling of MSVC warning 4244 about possible lossy conversion.
Change-Id: Iae8d666e1c38b5a817d7ef2018adb13567d4760b
Mark Abraham [Tue, 27 Aug 2019 11:44:24 +0000 (13:44 +0200)]
Simplify energy-file comparisons in tests
Now that we use newer infrastructure, we can use lambdas.
Also made FramePairManager and ContinuationFramePairManager
more consistent.
Change-Id: I8ccc9dd3134e5e188c3ea2b8b6ab335b4f267b10
Artem Zhmurov [Fri, 9 Aug 2019 10:31:08 +0000 (12:31 +0200)]
Add Parrinello-Rahman pressure coupling to CUDA Leap-Frog integrator
Parrinello-Rahman isotropic pressure coupling scheme is now
added to CUDA version of the Leap-Frog integrator. The
Leap-Frog tests are updated to check the new addition.
Refs. #2887, #2888.
Change-Id: Icf42667621c16a994e68baf5158ea4abac387928
Mark Abraham [Mon, 2 Sep 2019 05:45:39 +0000 (07:45 +0200)]
Move initialization of clFFT
Gave ClfftInitializer the responsibility for mutual exclusion, which
means the initialization is now convenient to do alongside other
PME-on-GPU initialization tasks. This simplifies the code.
Removed mention of lazy initialization, which was not implemented at
all.
Refs #2535
Change-Id: I429767b059ddc3b4f16f2f4a8830b54ed1f49fab
Berk Hess [Tue, 20 Aug 2019 08:16:19 +0000 (10:16 +0200)]
Only use fshift when needed
The shift force buffer in ForceWithShiftForces is now empty when
virial computation is not requested. This will simplify refactoring
of the force buffer management.
Change-Id: I6c8e543766703b038c178a0e95ccb536f367d5e1
Christian Blau [Mon, 26 Aug 2019 15:17:59 +0000 (17:17 +0200)]
Add checkpointing for MdModules
Adds the possiblity to write and read from checkpoint files for MdModules.
refs #2282
Change-Id: Id3ab57d1c9a40b6e1fb0193430e5b66ffa87d787
Erik Lindahl [Fri, 30 Aug 2019 19:39:21 +0000 (21:39 +0200)]
Fix CPU detection and SIMD on modern Mac/cmake combos
With recent versions of cmake on Mac, the CPU detection
program failed to compile since it was very fragile (buggy)
with respect to how compiler flags were defined - and that
in turn will mean losing all SIMD support.
This will fix the build, and it also adds a more vocal warning
if the CPU detection code cannot be compiled at all.
Change-Id: Idcdc8b59a4252b3faf8572311d2ca63a4d2a1bc0
Christian Blau [Mon, 26 Aug 2019 21:54:09 +0000 (23:54 +0200)]
Constructing local atom sets for density fitting
Constructs local atom sets for density fitting during simulation
setup.
refs #2282
Change-Id: I0300376a6818f3ad8bb6474b09a9b0f1cbb46eae
Mark Abraham [Thu, 29 Aug 2019 05:42:43 +0000 (07:42 +0200)]
Fix build matrices
Onee agent has a non-SIMD version of fftw that CMake warns us about. As
fftw is well tested elsewhere, we can just avoid testing it here.
icc 19 (only) has a codegen issue for pre-avx2 SIMD paths that mean
some exp SIMD unit tests fail. While we are diagnosing the issue,
this build configuration is changed to something that will pass.
Change-Id: I0e39cc245563b2afc3aba2b76858b17373ee91a3
Christian Blau [Fri, 30 Aug 2019 09:43:24 +0000 (11:43 +0200)]
LocalAtomSet construction with vectors of gmx::index
LocalAtomSet construction is updated to follow the transition to use
gmx::index whenever objects, like atoms, are of type gmx::index in
an array.
Keeping the old int based constructors for legacy compability.
Change-Id: Ic0973f5260a8de9e87bf5391040e14e533012d88
M. Eric Irrgang [Thu, 29 Aug 2019 16:15:02 +0000 (19:15 +0300)]
Import base code for Python-driven simulation from gmxapi 0.0.7.4.
Copy workflow.py and simulation.py from
https://github.com/kassonlab/gmxapi/releases/tag/v0.0.7.4
to unexposed submodules in gmxapi.simulation.
Follow-up change will update these sources and expose functionality
for continued development in the GROMACS repository.
Change-Id: I5f62808371b325de3286f13ee34b87f3a231b67d
Magnus Lundborg [Thu, 29 Aug 2019 16:08:41 +0000 (18:08 +0200)]
Changed some variables from SCReal to real in FE kernel.
This means that there is a reduced precision in some of the calculations
when using sc-r-power 48 if GROMACS is compiled with single precision.
This is to achieve the behaviour intended by
commit
a7c8e19121.
Change-Id: Iff754dfad51d1e468d96c368859db0a48ba51ebb
Christian Blau [Fri, 23 Aug 2019 12:59:59 +0000 (14:59 +0200)]
Implementing the density fitting force provider
refs #2282
Change-Id: Ib65679a82168f18992920f4529596db2494cccc3
Erik Lindahl [Sat, 24 Aug 2019 18:43:17 +0000 (20:43 +0200)]
Some quotes I bumped into last week
Change-Id: I071d73bbdf9dca016d5d229baaad9db770509067
Mark Abraham [Thu, 29 Aug 2019 05:17:52 +0000 (07:17 +0200)]
More quotes
Change-Id: Ia4f11f76be7871ee304167c78366ef2602533b5f
Pascal Merz [Thu, 27 Jun 2019 06:25:11 +0000 (00:25 -0600)]
Introduce MicroState for modular simulator
The MicroState replaces the t_state structure. It owns the position, velocity
and force vectors, as well as the box tensor. It also keeps a backup of the
previous position and box. It is therefore having more data than the pure
statistical-physical micro state definition. TODO: Decide if we should give
it another name to avoid misunderstandings!
While the modular approach aims at having as much data as possible localized,
the data in this class are so universally used in molecular simulations that it
is reasonable to keep them in a central object. Conveniently, this also is all
data commonly used in trr files.
Note that the MicroState can be converted to and from the legacy t_state
object. This is useful when dealing with functionality which has not yet
been adapted to use the new data approach - currently, domain decomposition,
PME load balancing, and the initial constraining are using this.
This commit is part of the commit chain introducing the new modular
simulator. Please see docs/doxygen/lib/modularsimulator.md for details
on the chosen approach. As the elements of the new simulator cannot all
be introduced in one commit, it might be worth to view Iaae1e205 to see
a working prototype of the approach.
Change-Id: Id1a22892c2dcf2f30127a9fd780b89d4c860640f
Pascal Merz [Wed, 19 Jun 2019 02:35:42 +0000 (20:35 -0600)]
Introduce signallers for modular integrator
In the current do_md() function, code flow is governed by booleans
set on every iteration of the simulator loop (e.g. bNS, do_ene,
bCalcEner, etc). In a modular simulator, we want to avoid common,
quasi-global variables. This change proposes an approach to replace
these booleans by a signaller-client system. An object ("signaller")
is thereby responsible to decide when specific events are happening,
and is informing its clients about it. This approach is implemented
for five types of events, namely neighbor-searching steps, logging
steps, energy-calculation steps (energy, free energy and virial
calculation), the last step, and trajectory (x/v/f and energy)
writing steps.
These signallers are designed to run at the beginning of scheduling
for a specific step.
If signallers depend on each others, they need to be ran in their
order of dependency. To illustrate this, consider the case of energy
calculation. This signaller can run by itself, checking if the
current step is an energy-calculation step. It can also be triggered
by the trajectory signaller, since the energy signaller is a client -
another way to say that we should calculate energies if we want to
write to the energy trajectory in this step. While we could imagine
that the trajectory signaller triggers a callback which in turn
informs the energy clients about the next step, this becomes shaky
when a signaller depends on more than one other signaller. Running
the signallers in their order of dependence, on the other hand, is
stable as long as there are no cyclic dependencies (which should
never happen). In our example, we therefore require the trajectory
signaller to run before the energy signaller. The builder, which
also registers signallers which each others, is responsible to keep
the signallers in order. This is trivially done by adding the
signallers to a vector right after building them.
The TrajectoryElement is both a simulator element (as it needs to run
periodically to output state or energy information to file) and a
signaller (as it needs to warn the state / energy objects that a
writing step is coming up). The TrajectoryElement is built around the
gmx_mdoutf object, which it owns. It can therefore not easily be
split into a element and a signaller part, or into a state writing and a
energy writing part. During the simulator run phase, it is
calling its trajectory clients (which do not necessarily need
to be identical with the signaller clients), passing them a valid
output pointer and letting them write to trajectory. Unlike the
legacy implementation, the trajectory element itself knows nothing
about the data that is written to file - it is only responsible
to inform clients about trajectory steps, and providing a valid
file pointer to the objects that need to write to trajectory.
This commit is part of the commit chain introducing the new modular
simulator. Please see docs/doxygen/lib/modularsimulator.md for details
on the chosen approach. As the elements of the new simulator cannot all
be introduced in one commit, it might be worth to view Iaae1e205 to see
a working prototype of the approach.
Change-Id: Ic58a18a374ff0ec5a47d0853c514e439ba1a45a3
Paul Bauer [Wed, 28 Aug 2019 15:38:19 +0000 (17:38 +0200)]
Fix return value
While testing on gitlab, clang-tidy complained about the return value
of a MPI detection function.
Change-Id: I09b4af9ad22d450bf48d360397e378eb10ff1610
Paul Bauer [Wed, 28 Aug 2019 11:47:50 +0000 (13:47 +0200)]
Have selections available for mdrun only
Due to the inclusion of the densityfitting code, selections need to be
available also when only building mdrun.
Fixes post-submit build failures.
Change-Id: I53e63fb5ca9f678dc3fcfcafa180367dd6c62c20
Mark Abraham [Wed, 28 Aug 2019 14:32:42 +0000 (16:32 +0200)]
Fix integration issues
Post-submit is warning about CUDA, and an automatic rebase missed out
on the change to remove gmx_install_headers().
Change-Id: I64d6fd149a4fa0d72cbd7e7d210b325f9f66a112
Pascal Merz [Tue, 18 Jun 2019 13:33:24 +0000 (07:33 -0600)]
Introduce the main modular simulator interfaces and documentation
This change introduces the two main interfaces for the modulator
simulator approach. It also introduces a new module which will contain
all files introduced for the modular simulator, making differentiation
between legacy code and new implementations easier. It further starts
the documentation of the new approach.
The ISimulatorElement interface is for any element that wants to
take part in the simulator loop. It requires to define a
scheduleRun method, which allows the element to decide whether
it needs to run at a specific time step. If it does, it adds one or more
function pointers to the run queue (registration function is passed
as argument, allowing flexibility in the exact implementation of the
run queue and the number of registered function pointers). The
Simulator can hence pre-compute all run function needed in one or
more future simulation step, allowing it to then run through the
function pointers without the need for branching
The ISignaller interface is used to spread information about upcoming
steps. Signallers are guaranteed to be ran before the elements
get queried about running at a specific step. This allows, for
example, to signal to the element that a neighbor-searching step
or a logging step is about to happen. Elements can register to
signallers they are interested in being notified by.
This commit is part of the commit chain introducing the new modular
simulator. Please see docs/doxygen/lib/modularsimulator.md for details
on the chosen approach. As the elements of the new simulator cannot all
be introduced in one commit, it might be worth to view Iaae1e205 to see
a working prototype of the approach.
Change-Id: Iefc9a0c729223cc5da0b500f0b410027c14d1f68
Paul Bauer [Wed, 28 Aug 2019 09:11:08 +0000 (11:11 +0200)]
Change tolerance for normal mode tests
Testing on gitlab showed that the comparisson for the normal mode
tests was too tight, so I relaxed the test tolerances a bit.
Change-Id: I2c0443d8deb9aa2e49559fd75f6b5fe6953d7912
Mark Abraham [Mon, 26 Aug 2019 08:59:22 +0000 (10:59 +0200)]
Improved usability of grompp by rejecting more invalid input
Improved test coverage and code documentation.
Also renamed some test cases so people understand the intent better.
Change-Id: I06f704d2d5516888ef8c84e78b68fa8c53fa7948
Szilárd Páll [Wed, 21 Aug 2019 12:54:21 +0000 (14:54 +0200)]
Add clang-tidy nightly test with SIMD + OpenCL
This also triggers the offline OpenCL kernel compilation.
Fixed some remaining clang-tidy issues found in that configuration.
Change-Id: Ia43404aebdc690f75cf0778391b1395e8770ecaf
Szilárd Páll [Mon, 29 Jul 2019 17:22:10 +0000 (19:22 +0200)]
Move nonbonded GPU wait timing into the GPU module
Extended the wallcycle module to allow only incrementing a counter --
used to simplify the polling GPU wait that would otherwise require a
regular start/stop to accomplish the same.
Also eliminating some TODOs.
Change-Id: I058c7213ab03d3fb5b438db58f69180049771454
M. Eric Irrgang [Tue, 13 Aug 2019 12:06:59 +0000 (15:06 +0300)]
Add sample_restraint Python tests to `check` target.
When building as part of the GROMACS project (not as a standalone
project), add a CMake testing target to invoke pytest for the
sample_restraint package. Include this target in the GROMACS project
`check` target. Make some minor CMake infrastructure changes to help
the sample_restraint tests find the gmxapi Python package.
Change-Id: I753951c1bb5f5a9c6caa20d4d632eba214895a1f
Mark Abraham [Tue, 22 Dec 2015 01:27:54 +0000 (12:27 +1100)]
Add integration tests for exact restarts
These tests demonstrates the extent to which mdrun checkpoint restarts
reproduce the same run that would have taken place without the
restart.
I've been working on these, and the bugs they exposed, for a few
years, but the code has been fixed for a few years now.
The tests don't run with OpenCL because they have caused driver out of
memory issues.
Refs #1137, #1793, #1882, #1883
Change-Id: I8bc441d945f13158bbe10f097e772ea87cc6a559
Christian Blau [Fri, 23 Aug 2019 12:24:13 +0000 (14:24 +0200)]
Add density fitting parameters
Adds the mdp parameters that are required for running a
density fitting simulation.
refs #2282
Change-Id: Id22ceee0f0036450173522bd5e85af06542a2c39
Christian Blau [Fri, 23 Aug 2019 08:26:07 +0000 (10:26 +0200)]
Access to GaussTransform3D data
Return a non-constant view to the GaussTransform3D to allow
sum reduction of Gauss transformation data via MPI. The alternative
to have the GaussTransform3D take a commrec to perform the
sum reduction itself leads to a cyclic dependency between
math and mdtypes modules.
refs #2282
Change-Id: I8b786965c3562ed84fe4e97fa0f68cf89ea0f03a
Christian Blau [Wed, 14 Aug 2019 10:30:40 +0000 (12:30 +0200)]
Add index group option to density fitting
Adds the option to select a specific group for density fitting, stores
the indices in the tpr file and restores them after reading.
Adapted the densityfittingoptions test to test fixture to better reflect
the increased required complexity for testing the storage of indices.
refs #2282
Change-Id: I3e33508bbcadf968b0ddf978a73e7f6cf5753b5b
M. Eric Irrgang [Tue, 27 Aug 2019 09:54:25 +0000 (12:54 +0300)]
Remove unused forward declarations.
A lot of stale forward declarations were cluttering up the public
interface for the Restraint module. The remaining forward declaration
should be revisited as the public / installed API is revised.
Change-Id: I1a4d8a913ade93158ad54ac99ca9da1ced66f347
Paul Bauer [Wed, 7 Aug 2019 08:07:27 +0000 (10:07 +0200)]
Remove section checking api level
Removes the check for api levels in check-source to allow modernization
without having to account for the legacy api layout.
Refs #988
Change-Id: I12cd3f6765bc57801ff4dd81583b7836dc4f18fb
Mark Abraham [Wed, 5 Jun 2019 16:34:15 +0000 (18:34 +0200)]
Make FEP rerun tests cover the intended lambda space
These tests are meant to look at whether a rerun can recompute
quantites for a range of lambda values, but something went wrong at
some point so that only state 3 (bonded-lambda 0.5) has been being
tested.
TODO make a redmine that grompp should reject lines that aren't
recognized as either comments or valid input.
Change-Id: I1eb405aa55bfb77c07d9a7e9c48803380c96c1df
Paul Bauer [Tue, 6 Aug 2019 14:23:45 +0000 (16:23 +0200)]
Remove installed headers from CMake
Removed the gmx_install_header sections from CMake files, as well as the
CMake code used to add and check them.
Refs #2382, #2139, #988
Change-Id: I4525ea14d2967f83d940300daeb2ade08717ed5d
Artem Zhmurov [Thu, 27 Jun 2019 17:43:12 +0000 (19:43 +0200)]
Add temperature coupling to CUDA Leap-Frog integrator
Velocity rescaling added to the integrator. None, one,
or multiple rescaling groups are supported. Tests that
include temperature coupling are added.
NoseHoover temperature control is not implemented.
Refs. #2887, #2888.
Change-Id: I1e6850eeb74de829554260fba6a6e6c1c63ceb46
M. Eric Irrgang [Fri, 23 Aug 2019 18:22:47 +0000 (21:22 +0300)]
Rearrange exposure of gmxapicompat simulation input tools.
* Add gmxapi/gmxapicompat.h installed header. Move the most benign API
aspects to this header, including exceptions. Retain some extra
details in gmxapi/compat/tpr.h and gmxapi/compat/mdparams.h.
* Move the provisional typing enum to gmxapi namespace.
* Change usages of several types to unique_ptr handles to allow opaque
pointers in gmxapi/gmxapicompat.h
Change-Id: I9c0ae50250b6bc1a1ad3e1885356a5ae718c610e
Mark Abraham [Tue, 20 Aug 2019 06:15:07 +0000 (08:15 +0200)]
Converted a CUDA config to use clang host-only compilation
This is distinct from the clang_cuda configuration because that one
uses clang also for device compilation. This one doesn't use the
modified build system, and will be easier to update when NVIDIA
support newer clang versions on Linux.
Refs #2899
Change-Id: I82bdf700c5553fcf367809209481ab4e27b037a2
M. Eric Irrgang [Fri, 23 Aug 2019 13:50:09 +0000 (16:50 +0300)]
Move gmxapicompat TPR tools to libgmxapi.
Make a few adjustments to satisfy clang-tidy and other warnings.
Change-Id: Iaede422d6726d0ca301436806b496b0bb64f2fdf
Mark Abraham [Mon, 26 Aug 2019 08:22:18 +0000 (10:22 +0200)]
Fix pairlist bug
Introduced recently in
658819431c0dabd while fixing issues for
upgrading clang-tidy version
Change-Id: I4c0dd4212e93cccf11f2ce60fbb500923eb136e9
M. Eric Irrgang [Fri, 23 Aug 2019 20:22:21 +0000 (23:22 +0300)]
Reduce artificial header dependencies in restraint plugin machinery.
Change-Id: I8c9c6170d89e8395a1e9a82d03067283d4999154
Christian Blau [Tue, 13 Aug 2019 13:44:36 +0000 (15:44 +0200)]
Activation of density fitting and move of module notifications
The densityfitting code is activated by adding it to the MDModules.
Moved the MdModuleNotifications to mdrunutility to break cyclic module
dependencies between mdrun and applied_forces via MdModules and
DensityFittingModuleInfo.
Observe that this patch changes the default .mdp output. Updated
reference data accordingly. Note that the changes in .mdp output
lead to "check mdp file differences" warning in the regression tests.
refs #2283
Change-Id: I93c0dd85285cac3f9e94d2dfc7c7fcc434aa81db
Artem Zhmurov [Sun, 25 Aug 2019 18:53:38 +0000 (20:53 +0200)]
Make use of recent changes to prepareKernelArguments(...)
Recent change allows to avoid assigning pointers to intermediate
variables before passing them to prepareKernelArguments(...)
functions in CUDA builds.
Change-Id: I3b70d7663cbd687e9f22e0422e7baa3fcdfc1bf3
Christian Blau [Fri, 23 Aug 2019 13:56:22 +0000 (15:56 +0200)]
Index groups for MdModules from grompp
Make index groups available for mdrun modules during preprocessing.
Notify mdrun modules with a DefaultIndexGroupsAndNames class that
translates index group names into atom indices.
refs #2282
Change-Id: Idc1bc3a5840e7b7ec3c82904416887b02417c92c
Szilárd Páll [Fri, 23 Aug 2019 18:58:00 +0000 (20:58 +0200)]
clang-tidy 8 fixes for the GPU host code-path
Tested with OpenCL and CUDA (with nvcc as device compiler).
Change-Id: I6c7f31efdf89aa863e6d831b1a5c41bfc2ef332a
Szilárd Páll [Fri, 23 Aug 2019 17:14:58 +0000 (19:14 +0200)]
Further fixes for clang-tidy clang version 8
These eliminate warnings with the standard recommended flags.
Change-Id: I541f1bfa918489219c5e02d8b0b92619e7c3f293
Artem Zhmurov [Tue, 13 Aug 2019 14:59:11 +0000 (16:59 +0200)]
Misceleneous improvements to the Leap Frog tests
1. The contained with runnerss is made static so it will be
initialized only once for the test case.
2. The member initializer is now only use constructor arguments,
and hence does not impose requirements on the class fields
ordering.
3. mdAtoms_.cFREEZE is set to nullptr explicetely, to make the
code less sesitive to possible further changes in intialization
of t_mdatoms.
Change-Id: I6e1db5cb3d5d81028480457989ce2e2b387018f4
Paul Bauer [Tue, 6 Aug 2019 08:31:01 +0000 (10:31 +0200)]
Removes checker for installed files
As the plan is to remove the current handling of installed header files,
this removes the checker parts from the doxygen check-source script for
this attribute.
Refs #2382, #2139, #988
Change-Id: I76b519f39a5c793c9f1ea8c1eb5eebb39b4a9352
Szilárd Páll [Wed, 21 Aug 2019 12:02:15 +0000 (14:02 +0200)]
Fix clang-tidy warnings in the OpenCL build
Change-Id: I4cc6a1402d068431feab4523911a7b60e0e66d59
Szilárd Páll [Thu, 22 Aug 2019 11:01:17 +0000 (13:01 +0200)]
Fix clang tidy warnings in CUDA build
Tested with clang 7 on a build with clang for both host and device code.
Change-Id: Ie2be427ae63f90f4eec4e79cc85da3ab13fcfe4a
Mark Abraham [Sat, 6 Jul 2019 18:37:45 +0000 (20:37 +0200)]
Update clang-tidy to clang version 8
Some new warnings are well intentioned, but not practical to turn on
in GROMACS given the limited suppression capabilities.
Rationales for suppressions of new warnings can be found in
src/.clang-tidy
Change-Id: I857d3790450e33a669c6a68ad846cae3783875e7
Mark Abraham [Thu, 22 Aug 2019 19:16:04 +0000 (21:16 +0200)]
Merge branch release-2019
Change-Id: I71b540586e32f54f3536c5a59eb99d89ad0b3639
Mark Abraham [Wed, 21 Aug 2019 03:52:58 +0000 (05:52 +0200)]
Improve clang-analyzer build time
The tests for selection and utility modules take a long time to
link, so these are moved earlier in the CMake so that linking
will start sooner.
Change-Id: I2fb50515d8ffe5f93e0bcf13c6a780cb5725aa3e
M. Eric Irrgang [Tue, 11 Jun 2019 12:40:28 +0000 (15:40 +0300)]
C++ code and Python bindings for TPR parameter read/write.
Core functionality to allow TPR files to be rewritten with altered
parameters, ported from https://github.com/kassonlab/gmxapi v0.0.7.4
with modifications to naming and coding style. (Refer to patch history.)
A lot of the C++ code is not intended to be a long term solution,
but demonstrates the use cases that will need to be addressed
as modules become able to self-describe their inputs and outputs.
However, this change is necessary to support near-term data portability
between gmxapi operations for preparing and wrangling chains or
ensembles of simulations.
Refs #2993
Change-Id: I54677c861dfb19c9f34b11d2c30456e6ee5dbe8d
Mark Abraham [Mon, 19 Aug 2019 13:19:51 +0000 (15:19 +0200)]
Fix release matrix
Change-Id: Ieacbb36daa10077e98bf23058c6c261560ad8be2
Berk Hess [Wed, 21 Aug 2019 12:23:55 +0000 (14:23 +0200)]
Fix perturbed bonded bug
Recent commit
0c26c550 allowed perturbed bonded interactions to use
SIMD kernels that only used the A-state parameters.
TODO: Add tests that catch this, refs #3064
Change-Id: I6e03d55f1431e007a9d7d85e1b32151340765b42
M. Eric Irrgang [Thu, 4 Jul 2019 08:54:59 +0000 (11:54 +0300)]
Enable GMXAPI by default.
Change default CMake configuration to enable the build and install of
libgmxapi and associated headers.
Refs #2756
Refs #3059
Change-Id: I5688a1ad6b524882090201014fc34cb34c1e3748
Mark Abraham [Mon, 19 Aug 2019 15:10:02 +0000 (17:10 +0200)]
Improve organization of LINCS reporting
Some result fields were being re-used in a way that was hard
to understand. Also static analyzers could not see that the
in debug mode the behaviour was correct.
Change-Id: I9502a350f888929f82d33c09c07fa12b5078342b
Mark Abraham [Tue, 20 Aug 2019 11:37:56 +0000 (13:37 +0200)]
Apply clang-tidy-8 readability-uppercase-literal-suffix
This new check in clang-tidy-8 seems useful enough to activate, even
if only so people get used to reading code that also conforms to the
check. The value is similar to using upper case for MACROS - that the
token is more clearly not a variable.
Change-Id: Id4712f53e07bd7b9b3148f63c4f1c8457d7e199e
Mark Abraham [Thu, 4 Apr 2019 09:29:24 +0000 (11:29 +0200)]
Use potential-shift as default modifier
The potential-shift-verlet modifier is no longer useful, as
potential-shift was the default with the only cut-off scheme
remaining. That is now explicit. The former modifier is now
named to reflect that it doesn't do anything.
The documentation no longer mentions that modifier, but if a user
supplies an .mdp file using it, grompp silently adopts the behaviour
of the potential-shift modifier. No .tpr files contain that value, as
grompp always converted it to something else, but in any case this
patch doesn't change the situation if somehow such a .tpr does exist.
Change-Id: Ie4f848a298750b9749ebb083812bad06b2faa45c
Berk Hess [Thu, 15 Aug 2019 06:39:15 +0000 (08:39 +0200)]
Merge two dihedral functions
Merged the dihedral functions and sub-functions with and without
nergies and forces, both without SIMD.
his change also adds the angle and force optimization for multiple
dihedrals over the same atoms for the energy flavor of this kernel.
Change-Id: I17e4ff9f625b7b3db05663f19c99b103bc99432f
Mark Abraham [Thu, 8 Aug 2019 14:29:36 +0000 (16:29 +0200)]
Reduce cosine acceleration quantity properly
The momenta should be redueced in compute_globals only when there
actually is cosine acceleration
Change-Id: Id42dbff6272cdfda2c062f97e93658f308e75d34
Berk Hess [Fri, 2 Aug 2019 12:56:23 +0000 (14:56 +0200)]
Use shiftForces in ForceOuputs
The shift force buffer in t_forcerec is changed to std::vector and all
access now happens through ForceWithShiftForces.
Also removed the depreacted rvec getters from ForceOuputs.
Change-Id: I1353e6497d651a8f24e819a8826af78656889953
Erik Lindahl [Wed, 14 Aug 2019 10:53:06 +0000 (12:53 +0200)]
Avoid using GMX_SIMD macros to detect _mm_pause()
This is a first step to start removing all the SIMD
macros and replacing them with C++14 constructs instead.
The change also replaces negative tests for windows
with clearer positive ones, and makes sure we use the
same test for the conditional include and using the
result.
Change-Id: Ie8a2311f88b8704dac135f2ac96ac272dee8695a
Mark Abraham [Tue, 13 Aug 2019 14:48:40 +0000 (16:48 +0200)]
Fix issues for clang-analyzer-8
pdb2gmx can no longer attempt to add a vsite after issuing a warning
that it cannot convert an atom, instead exiting with a fatal error.
Fixed bug in gmx order -calcdist
Suppressed some analyzer leak warnings of gmock objects. If the leaks
are real, ASAN will really find it, and if not we aren't going to fix
it in gmock.
Change-Id: Ib3290d7722c1e719ce5291cf3db68a87bc7ce89a
Berk Hess [Wed, 14 Aug 2019 08:30:13 +0000 (10:30 +0200)]
Make bonded virial computation conditional
Made the shift forces computation conditional of the bonded kernel
flavor for all kernels in bonded.cpp.
Introduced a forces spreading function for bonds to reduce code
duplication.
Change-Id: I7257d2223a28148f4b59583157b352d6d3918461
Berk Hess [Tue, 20 Aug 2019 06:56:43 +0000 (08:56 +0200)]
Fix missing bonded forces with CUDA GPUs and DD
Fixes issue #3063
Change-Id: Ibce7fa741a7d2171f61968f22a758b40f79a8759
Szilárd Páll [Wed, 24 Jul 2019 15:30:53 +0000 (17:30 +0200)]
Bump clang-cuda post-submit compiler/CUDA version
clang 8 + CUDA 10 is the latest working setup
Fixes #2819
Refs #3006
Change-Id: I3dd0bb5c667d2295593178d445260beaf0509277