alexxy/gromacs.git
4 years agoExtract DDSystemInfo from gmx_domdec_comm_t
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

4 years agoUnify manual and auto DD grid choices
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

4 years agoRemove gmx_domdec_t from dd_choose_grid()
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

4 years agoExtact UnitCellInfo from gmx_domdec_t
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

4 years agoPython wrapping code for gmxapi mdrun bindings.
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

4 years agoIntroduce energy element for modular simulator
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

4 years agoSimplify energy-file comparisons in tests
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

4 years agoAdd Parrinello-Rahman pressure coupling to CUDA Leap-Frog integrator
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

4 years agoMove initialization of clFFT
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

4 years agoOnly use fshift when needed
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

4 years agoAdd checkpointing for MdModules
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

4 years agoFix CPU detection and SIMD on modern Mac/cmake combos
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

4 years agoConstructing local atom sets for density fitting
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

4 years agoFix build matrices
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

4 years agoLocalAtomSet construction with vectors of gmx::index
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

4 years agoImport base code for Python-driven simulation from gmxapi 0.0.7.4.
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

4 years agoChanged some variables from SCReal to real in FE kernel.
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

4 years agoImplementing the density fitting force provider
Christian Blau [Fri, 23 Aug 2019 12:59:59 +0000 (14:59 +0200)]
Implementing the density fitting force provider

refs #2282

Change-Id: Ib65679a82168f18992920f4529596db2494cccc3

4 years agoSome quotes I bumped into last week
Erik Lindahl [Sat, 24 Aug 2019 18:43:17 +0000 (20:43 +0200)]
Some quotes I bumped into last week

Change-Id: I071d73bbdf9dca016d5d229baaad9db770509067

4 years agoMore quotes
Mark Abraham [Thu, 29 Aug 2019 05:17:52 +0000 (07:17 +0200)]
More quotes

Change-Id: Ia4f11f76be7871ee304167c78366ef2602533b5f

4 years agoIntroduce MicroState for modular simulator
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

4 years agoIntroduce signallers for modular integrator
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

4 years agoFix return value
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

4 years agoHave selections available for mdrun only
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

4 years agoFix integration issues
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

4 years agoIntroduce the main modular simulator interfaces and documentation
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

4 years agoChange tolerance for normal mode tests
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

4 years agoImproved usability of grompp by rejecting more invalid input
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

4 years agoAdd clang-tidy nightly test with SIMD + OpenCL
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

4 years agoMove nonbonded GPU wait timing into the GPU module
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

4 years agoAdd sample_restraint Python tests to `check` target.
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

4 years agoAdd integration tests for exact restarts
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

4 years agoAdd density fitting parameters
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

4 years agoAccess to GaussTransform3D data
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

4 years agoAdd index group option to density fitting
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

4 years agoRemove unused forward declarations.
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

4 years agoRemove section checking api level
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

4 years agoMake FEP rerun tests cover the intended lambda space
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

4 years agoRemove installed headers from CMake
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

4 years agoAdd temperature coupling to CUDA Leap-Frog integrator
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

4 years agoRearrange exposure of gmxapicompat simulation input tools.
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

4 years agoConverted a CUDA config to use clang host-only compilation
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

4 years agoMove gmxapicompat TPR tools to libgmxapi.
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

4 years agoFix pairlist bug
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

4 years agoReduce artificial header dependencies in restraint plugin machinery.
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

4 years agoActivation of density fitting and move of module notifications
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

4 years agoMake use of recent changes to prepareKernelArguments(...)
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

4 years agoIndex groups for MdModules from grompp
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

4 years agoclang-tidy 8 fixes for the GPU host code-path
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

4 years agoFurther fixes for clang-tidy clang version 8
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

4 years agoMisceleneous improvements to the Leap Frog tests
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

4 years agoRemoves checker for installed files
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

4 years agoFix clang-tidy warnings in the OpenCL build
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

4 years agoFix clang tidy warnings in CUDA build
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

4 years agoUpdate clang-tidy to clang version 8
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

4 years agoMerge branch release-2019
Mark Abraham [Thu, 22 Aug 2019 19:16:04 +0000 (21:16 +0200)]
Merge branch release-2019

Change-Id: I71b540586e32f54f3536c5a59eb99d89ad0b3639

4 years agoImprove clang-analyzer build time
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

4 years agoC++ code and Python bindings for TPR parameter read/write.
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

4 years agoFix release matrix
Mark Abraham [Mon, 19 Aug 2019 13:19:51 +0000 (15:19 +0200)]
Fix release matrix

Change-Id: Ieacbb36daa10077e98bf23058c6c261560ad8be2

4 years agoFix perturbed bonded bug
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

4 years agoEnable GMXAPI by default.
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

4 years agoImprove organization of LINCS reporting
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

4 years agoApply clang-tidy-8 readability-uppercase-literal-suffix
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

4 years agoUse potential-shift as default modifier
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

4 years agoMerge two dihedral functions
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

4 years agoReduce cosine acceleration quantity properly
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

4 years agoUse shiftForces in ForceOuputs
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

4 years agoAvoid using GMX_SIMD macros to detect _mm_pause()
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

4 years agoFix issues for clang-analyzer-8
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

4 years agoMake bonded virial computation conditional
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

4 years agoFix missing bonded forces with CUDA GPUs and DD
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

4 years agoBump clang-cuda post-submit compiler/CUDA version
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

4 years agoSwitch to ARM HPC toolchain v19.2 in post-submit
Szilárd Páll [Fri, 16 Aug 2019 15:32:28 +0000 (17:32 +0200)]
Switch to ARM HPC toolchain v19.2 in post-submit

Refs #3011

Change-Id: Iabba5465651bb8f2715dda372ec8abf930fd85e2

4 years agoModernize t_matrix, t_mapping, t_rgb
Mark Abraham [Mon, 12 Aug 2019 09:00:55 +0000 (11:00 +0200)]
Modernize t_matrix, t_mapping, t_rgb

This supports removing some manual string handling that regularly
troubles e.g. the static analyzer.

Made more use of vector, ArrayRef and ssize.

Stopped installing matio.h, because the transformation introduced
here was going to lead to many more files installed, and we anyway
plan to remove the serendipitous API that we have.

Refs #2899

Change-Id: Ia4c6a37d4f25dc2de93b06b2ffc46e2ddab96f39

4 years agoClean up gmxapi documentation build.
M. Eric Irrgang [Wed, 24 Jul 2019 11:40:11 +0000 (14:40 +0300)]
Clean up gmxapi documentation build.

Address some Sphinx errors. Undo a regression in conf.py. Begin
importing package documentation from Python into Sphinx docs.

Change-Id: Id41dfc5495877a59fd9e8a8b497381b450a3e17e

4 years agoAdd subgraph and while_loop operations.
M. Eric Irrgang [Thu, 20 Jun 2019 10:55:51 +0000 (13:55 +0300)]
Add subgraph and while_loop operations.

Allow multiple operations to be added in a subcontext so that
the set of operations can be instantiated and executed
repeatedly in a looping construct.

Also adds logical_not transformation, which will be further
refined in later changes.

Refs #2994

Change-Id: I482d51bac9756a197d8b50fb2a4af36a44dbde27

4 years agoModernize t_psdata
Mark Abraham [Mon, 12 Aug 2019 09:00:55 +0000 (11:00 +0200)]
Modernize t_psdata

This is useful in itself, but mainly prepares to modernize other users
of t_rgb, which need it to have a constructor.

Also made a comment more neutral

Refs #2899

Change-Id: I1717c8c049f81c313c2b435f7d56b36a3f914551

4 years agoWork around clang CUDA device code codegen bug
Szilárd Páll [Fri, 16 Aug 2019 00:21:17 +0000 (02:21 +0200)]
Work around clang CUDA device code codegen bug

Some of the PME kernels (namely PME spread and solve) get miscompiled
when clang native device code compilation is used with assertions and
optimization on, causing errors in RelWithAssert builds.
As a workaround, this change disables optimization for these kernels when
assertions are enabled (and only if the device compiler is clang).

Refs #2819

Change-Id: I815fc86116ffb57c4d5803ce7fa4d260909ae7ba

4 years agoFix segfault with old tprs processing internal parameters
Christian Blau [Fri, 16 Aug 2019 11:41:07 +0000 (13:41 +0200)]
Fix segfault with old tprs processing internal parameters

Mdrun would occasionally segfault when processing tpr versions before
generic internal parameter storage. This patch fixes the segfaults.

Fixes #3060

Change-Id: Ied638943112ab6c18b425584f3361cbb5a3b7de6

4 years agoFix sim_util.cpp copyright header
Szilárd Páll [Fri, 16 Aug 2019 14:05:51 +0000 (16:05 +0200)]
Fix sim_util.cpp copyright header

c806efa2 added an extra character.

Change-Id: Id8dd7776ad7a38126937f6793a3fc2927cf054ff

4 years agoUpdate testing matrices and fix warnings
Mark Abraham [Sat, 10 Aug 2019 04:43:53 +0000 (06:43 +0200)]
Update testing matrices and fix warnings

Updated to test gcc 9, clang 8, and cmake 3.15.1.

Also fixes for compilation with gcc 9 and clang 9 (still in release
candidate, not yet released)

Added a gmx_source_file_warning_suppression() CMake helper function
(like the recently introduced gmx_target_warning_suppression()) to
manage per-source-file suppressions. This is used to suppress a
warning about the abuse of t_inputrec that is too difficult to fix
without replacing all of the handling of initialization and broadcast
of t_inputrec and subfields.

Refs #2899, #3006
Fixes #3007

Change-Id: I3a31a40c472d420adbb38d11ed5121702d7b3f7d

4 years agoMove keyvaluetreewriter code
Mark Abraham [Thu, 15 Aug 2019 19:02:13 +0000 (21:02 +0200)]
Move keyvaluetreewriter code

This will be needed by more than preprocessing code in future, so
needs to be moved to a module that e.g. is part of the mdrun-only
build. Perhaps utility is too low, but at least there is other
key-value handling code there.

Change-Id: I423a5a342ea4d5d44fb9844f98dafa0aef18f90a

4 years agoStop nbnxm/grid.h depending on SIMD module
Mark Abraham [Thu, 15 Aug 2019 12:49:30 +0000 (14:49 +0200)]
Stop nbnxm/grid.h depending on SIMD module

Only part of the NBNXM module has a SIMD dependence, and this reduces
the size of it.

Change-Id: I1376e9f1b30b436453582bdabc65efd185a66b33

4 years agoFix OpenCL gather reduction
Szilárd Páll [Fri, 15 Feb 2019 19:14:16 +0000 (20:14 +0100)]
Fix OpenCL gather reduction

On >=16-wide execution it is correct (narrower is checked and excluded
during compilation).

TODO: Consider changing the default on NVIDIA & Intel where offloading
PME is generally not advantageous to performance.

Addresses part of #2519
Refs #2453 #2516

Change-Id: I24beaaeea096954ba32b3a80251945a9d82a3c05

4 years agoPME reduction for CUDA F buffer operations
Alan Gray [Fri, 10 May 2019 10:28:58 +0000 (03:28 -0700)]
PME reduction for CUDA F buffer operations

Enable with GMX_USE_GPU_BUFFER_OPS env variable.

Provides functionality to perform reduction of PME forces in F buffer
ops kernel.  Currently active when single GPU performs both PME and PP
(multi-GPU support will follow in patch which perfoms PME/PP comms
direct between GPUs). When active, Device->Host copy of PME force
and CPU-side reduction is disabled.

Implements part of #3029, refs #2817

Change-Id: I3e66b6919c1e86bf0bed42b74136f8694626910b

4 years agoRemove run-time check from calc_shifts
Mark Abraham [Tue, 13 Aug 2019 08:27:48 +0000 (10:27 +0200)]
Remove run-time check from calc_shifts

Now that this logic is unit tested, we don't have to
check it every step when using pressure coupling.

Also fixed some minor issues with pbcenums test that
I used as a template for the new source file.

Change-Id: I8f5dfaa44d2f2a92beee61fa6ba4ec94de21f50e

4 years agoMove densityfitting options and output into seperate file
Christian Blau [Thu, 8 Aug 2019 09:15:41 +0000 (11:15 +0200)]
Move densityfitting options and output into seperate file

Exposes density fitting options and output interface for testing.

Added test for density fitting options class.

refs: #2282

Change-Id: I0107217b5af86abf1ed298dd77553c4c24b1d3f2

4 years agoTemplate bonded interactions on kernel flavor
Berk Hess [Wed, 7 Aug 2019 13:17:57 +0000 (15:17 +0200)]
Template bonded interactions on kernel flavor

This change is only refactoring.

Change-Id: I34c44714824bbb012a0eacd53d013fe21c8f8f94

4 years agoInfo class to name and generate the densityfitting module
Christian Blau [Thu, 8 Aug 2019 15:00:59 +0000 (17:00 +0200)]
Info class to name and generate the densityfitting module

Similar to the trajectoryanalysismodules, use an info class to name and
generate the densityfitting module.

Naming of related mdp options based on the module name.

Change-Id: Iaaffb28bba3633421040f3f9bf5eb6463398f731

4 years agoFix logic error in python_packaging/src/CMakeLists.txt
M. Eric Irrgang [Wed, 14 Aug 2019 11:54:50 +0000 (14:54 +0300)]
Fix logic error in python_packaging/src/CMakeLists.txt

When building as part of the GROMACS project (rather than via `pip`),
some branching logic for CMake versions <3.12 and >=3.12 was reversed.

Change-Id: I28c92372ef421ab14d2f68a17a9ec896179af3af

4 years agoMinor optimization to `pip install` in gmxapi CI build.
M. Eric Irrgang [Thu, 8 Aug 2019 12:28:15 +0000 (15:28 +0300)]
Minor optimization to `pip install` in gmxapi CI build.

Change-Id: I247ca2c253a73b30cd21f36914bcf7c0ecbd7aa2

4 years agoInternal parameter storage for IMDModules
Christian Blau [Thu, 8 Aug 2019 14:18:35 +0000 (16:18 +0200)]
Internal parameter storage for IMDModules

It is currently not possible for MdModules to store data in a tpr
file that is non-mdp input, e.g., the result of some computation
during setup level.

Atom indices of index groups are one example: evaluated from strings
during grompp time, they are stored as list of integers in the run
input file. During the mdrun setup the information to evaluate the
index groups is no longer available.

This patch introduces a storage for internal MdModule parameters.

The parameters are stored in a seperate key-value-tree in the input
record that is then serialized into the tpr file. In contrast to the
ir->params, this key-value-tree does not match the options given in
an input file.

Change-Id: I207d8c837c39f1afb196507fe228306700e46a49

4 years agoBugFix: Zeroing the padded area of coordinates vectors in LeapFrog tests
Artem Zhmurov [Tue, 13 Aug 2019 14:55:57 +0000 (16:55 +0200)]
BugFix: Zeroing the padded area of coordinates vectors in LeapFrog tests

The reserveWithPadding does not put zeros to the vectors. In some cases
this lead to some residue data in padded area which caused floating
point exceptions when SIMD kernel was used (in ~1 out of 200 cases).

Change-Id: I7f9898ffc4b933c054d1ca4746d9b8de8caed3fb

4 years agoFix vv integrators
Mark Abraham [Tue, 13 Aug 2019 19:50:05 +0000 (21:50 +0200)]
Fix vv integrators

This got broken in refactoring commit 88c7ed2de9e66d3a. That change
meant that when restarting from a checkpoint, the velocity propagation
at all non-initial steps was wrong for all vv integrators.

Change-Id: Id3890244a600d6d3ead450acce001a4e5be9e896

4 years agoAdd initial .clang-format file.
M. Eric Irrgang [Wed, 31 Jul 2019 15:57:58 +0000 (18:57 +0300)]
Add initial .clang-format file.

This change separates out the introduction of the clang-format
configuration from the adoption of clang-format as the alternative to
uncrustify.

Discussion on the contents of the config file have taken place at
https://gerrit.gromacs.org/c/gromacs/+/6307

Refs #2107

Change-Id: I2221486ebd24147799338a3be7ca462e9c8e761a

4 years agoMake use of reference data in integrator tests
Artem Zhmurov [Mon, 5 Aug 2019 13:45:06 +0000 (15:45 +0200)]
Make use of reference data in integrator tests

Current version of tests is based on exactly solvable model,
which does not allow for testing more sophisticated cases,
including when temperature or pressure control is enabled.
This commit adds the tests that are based on the reference
data, which can be generated for any existing use-case.

Refs. #2816, #2887.

Change-Id: I64bb2326b0adf44be8b48449ef09cd26939ea467

4 years agoMake use of reference data in SETTLE tests
Artem Zhmurov [Tue, 30 Jul 2019 08:29:00 +0000 (10:29 +0200)]
Make use of reference data in SETTLE tests

As a temporary measure, the CPU and GPU versions of SETTLE
were tested agains each other. Making use of the reference
data framework allows to test them against precomputed values.
Now, the final positions, velocities and virial are properly
tested in CPU and, if available, in GPU versions.

Refs. #2886, #2888.

Change-Id: I8e54e1a741263b8bf9774a21141c527f58130fa9

4 years agoImprove sample_restraint project integration.
M. Eric Irrgang [Tue, 16 Jul 2019 16:00:24 +0000 (19:00 +0300)]
Improve sample_restraint project integration.

Build for testing as part of a gmxapi enabled GROMACS build. Fix some
errors and collisions.

* Use distinct CMake options for using bundled pybind sources in
  gmxapi Python package and sample_restraint package.
* Distinguish between "umbrella" build and standalone build when
  trying to determine googletest source for sample_restraint.
* Avoid a couple of warnings about unused variables.
* Use GTest::Main target more consistently for sample_restraint tests.

Refs #2056
Refs #3027
Refs #3033

Change-Id: I55d20e6228779ecc726587231c83298356192f6f

4 years agoDon't install googletest.
M. Eric Irrgang [Tue, 13 Aug 2019 11:20:02 +0000 (14:20 +0300)]
Don't install googletest.

We neglected the EXCLUDE_FROM_ALL option to add_subdirectory when
recently restructuring the googletest CMake stuff, resulting in
installation of extra stuff that we really only want in the build tree.

Change-Id: Iac9040e0cb2d1c630d489687e86e59c1ca80a707

4 years agoMap gmxapi C++ exceptions to Python exceptions.
M. Eric Irrgang [Tue, 16 Jul 2019 12:14:23 +0000 (15:14 +0300)]
Map gmxapi C++ exceptions to Python exceptions.

Create a base exception and several derived exceptions in the
gmxapi._gmxapi C++ extension module for the Python package. In addition
to mapping the few existing exceptions from gmxapi/exceptions.h, we add
handlers for unmapped exceptions derived from gmxapi::Exception and for
unknown exceptions, such as exceptions originating in the core library
or uncaught stdlib exceptions. gmxapi._gmxapi.Exception derives from
gmxapi.exceptions.Error.

Refs #3034

Change-Id: I270908216271876bcb8ef6e83b78ca333042c336