alexxy/gromacs.git
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 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

4 years agoRemove workaround for buggy cmake
Mark Abraham [Thu, 8 Aug 2019 09:31:34 +0000 (11:31 +0200)]
Remove workaround for buggy cmake

Bug 10837 was fixed in cmake 3.6, GROMACS now require 3.9.6

Change-Id: Ie47bb3fc83e44c125058a85a9fed9d54c1176a69

4 years agoFix icc 19 codegen issue
Mark Abraham [Thu, 8 Aug 2019 18:13:35 +0000 (20:13 +0200)]
Fix icc 19 codegen issue

This is one thing broken in post-submit testing right now

Change-Id: I496d99ee86861f2c8b467c09593a5882b19b0bb0

4 years agoIntroduce Context requirement.
M. Eric Irrgang [Thu, 20 Jun 2019 10:51:13 +0000 (13:51 +0300)]
Introduce Context requirement.

Operation handles are acquired with mediation from a
specific Context object, which supports a protocol for
adding nodes to a work graph.

Refs #2994
Refs #2996

Change-Id: I4b110eff23a8326bad21bbf2b1b236522d3ba630

4 years agoQuiet warning
Mark Abraham [Mon, 12 Aug 2019 11:48:55 +0000 (13:48 +0200)]
Quiet warning

Change-Id: I7a7594bb819dff884cb6e96e5c6e4e7dab840c18

4 years agoFix ocl_kernel target
Mark Abraham [Fri, 9 Aug 2019 12:01:49 +0000 (14:01 +0200)]
Fix ocl_kernel target

Got broken during refactoring of nbnxm module

Change-Id: Ia328d522fa5c5b38badb23c6adec715479589cb3

4 years agoFix hwloc find package naming and quietness issues
Szilárd Páll [Wed, 31 Jul 2019 19:09:30 +0000 (21:09 +0200)]
Fix hwloc find package naming and quietness issues

Due to compound issues the hwloc detection has been more noisy at
subsequent cmake executions than it should.
This change corrects the module naming to "HWLOC" as this is the prefix
the variables the modules defines. Also implemented an internal cache
variable to detect subsequent calls to the hwloc detection.

Change-Id: I13c82277b1edf577ebdc4791d6cb2576c5ff434d

4 years agoUse new setenv function for energyoutput test
Pascal Merz [Thu, 1 Aug 2019 17:58:17 +0000 (11:58 -0600)]
Use new setenv function for energyoutput test

The parent commit I5a36ce0c4 introduced a convenience function to
have identical behavior of setenv on Unix and Windows systems. This
change uses it for the energyoutput test.

Change-Id: I81ed288d6a582b733cec7bf9a425d8df1bda5474

4 years agoSeparate out some abstract base classes.
M. Eric Irrgang [Thu, 20 Jun 2019 10:54:45 +0000 (13:54 +0300)]
Separate out some abstract base classes.

Introduce SourceResource and AbstractOperation to improve consistency
and static type checking.

Refs #2996

Change-Id: If7a23ca66e21e55cd67a6242fd699507699423c0

4 years agoMove bonded function table into bonded.cpp
Berk Hess [Wed, 7 Aug 2019 10:10:32 +0000 (12:10 +0200)]
Move bonded function table into bonded.cpp

Instead of exposing the bonded functions for every function type
outside bonded.cpp, now a function in bonded.cpp dispatching
each bonded interaction fuction using a local table.
This is preparation for templating the bonded interaction functions.

This change is only refactoring.

Change-Id: I22d5f46b09fa00ca65e0359f963c1cc6bfb33aa9

4 years agoPrepare Update and Constraints for Domain Decomposition
Artem Zhmurov [Mon, 1 Jul 2019 12:52:22 +0000 (14:52 +0200)]
Prepare Update and Constraints for Domain Decomposition

Initial GPU-based version of the update and constraints was not
designed to run with the Domain decomposition. This introduces a
couple of fixes to the memory management that should alow the
module to work with the DD enabled. The memory buffers are now
re-allocated at the set(...) stage, if so needed.

Refs. #2816, #2888.

Change-Id: I155884f5797252cf048a6400a2dd7b042d355b7e

4 years agoAdd conversion from legacy to modern matrix type
Paul Bauer [Tue, 6 Aug 2019 09:35:25 +0000 (11:35 +0200)]
Add conversion from legacy to modern matrix type

Refs #2976

Change-Id: Iddf400bbb688a00c9de60e33d9c9a05f7c146f66

4 years agoRefactoring of the SETTLE tests
Artem Zhmurov [Fri, 28 Jun 2019 09:18:43 +0000 (11:18 +0200)]
Refactoring of the SETTLE tests

Current version of tests for CUDA version of SETTLE was a quick
addition to the old tests, with direct comparison of the GPU
implementation with the old original CPU-based implementation.
This commit rearranges the test structure, making it possible
to apply the same set of tests to both implementations. There
is no changes to the tests themselves. Currently, comparison tests
will run twice and will dry-run on CUDA builds without CUDA-
capable devices.

TODO: Add comparison with pre-computed values for coordinates,
      velocities and virial. Remove the CPU vs GPU comparison
      tests.

Refs #2886, #2888.

Change-Id: Ifcb6af9af6c93787b919b785348f9f4547b6c267

4 years agoSIMD acceleration for F_FOURDIHS and F_PIDIHS
Berk Hess [Wed, 7 Aug 2019 14:06:12 +0000 (16:06 +0200)]
SIMD acceleration for F_FOURDIHS and F_PIDIHS

Since these are computed by the RB and proper dihedral code for which
we already have SIMD acceleration, this acceleration comes "for free"
(or rather, we have been stupid not to accelerate these before).

Change-Id: I456af11c23fe1cb3749a889c5d92ec3ba06ab237

4 years agoFix estimate of the size of a j list
Mark Abraham [Thu, 1 Aug 2019 16:42:53 +0000 (18:42 +0200)]
Fix estimate of the size of a j list

There is no need to truncate this to an integer. It's made and
consumed as a real.

Change-Id: Idbcc4040428d4a6a3e2a96b69c83e6c11fbe93f2

4 years agoAdd gmxapi_pytest custom target to CMake `check` target.
M. Eric Irrgang [Fri, 26 Jul 2019 16:24:59 +0000 (19:24 +0300)]
Add gmxapi_pytest custom target to CMake `check` target.

Automatically run pytest for the gmxapi Python package in the build tree
when GMX_PYTHON_PACKAGE=ON.

Refs #2765

Change-Id: I3f33b9903fc712d0c027810af6b6af605928f3ab

4 years agoAllow gmxapi Python package tests to be run from GROMACS build tree.
M. Eric Irrgang [Fri, 26 Jul 2019 12:32:22 +0000 (15:32 +0300)]
Allow gmxapi Python package tests to be run from GROMACS build tree.

* Configure gmxapi._gmxapi to build with the ability to find libgmxapi.
* Add a gmxapi_pytest custom CMake target to invoke pytest.

Refs #2961
Refs #2756

Change-Id: I64ca82afbf37da3c37759ec302c2ac9cc1666de2

4 years agoInitialize gmx_ekindata_t and t_vcm properly
Mark Abraham [Thu, 8 Aug 2019 13:27:29 +0000 (15:27 +0200)]
Initialize gmx_ekindata_t and t_vcm properly

Clean up in 0823a1e2e6591d76bcf15bdadfc3ec6, and 70bacbcfd639b17
left some fields initialized. The compute_globals code assumed it was
safe to reduce e.g. mvcos regardless of whether they were being used.
This is bad practice, but not a problem in the context of snew being
used for such structures.

Such fields are now initialized.

Change-Id: I12c462c9907ed34371e880cdd44ae162d44de67b

4 years agoLet base GROMACS docker image be a little more useful.
M. Eric Irrgang [Fri, 26 Jul 2019 16:10:36 +0000 (19:10 +0300)]
Let base GROMACS docker image be a little more useful.

* Break the build up into more steps for easier post-mortem inspection.
* Add `make check` as a default command.

The extra build steps don't add to the image size because we were
already keeping the entire sources for debugging convenience. We only
borrow the installed files in the consuming CI images.

Change-Id: I542e2b01125cdb34c130adcf76d5df50307bfc33

4 years agoHarmonize mrc density format extents with rest of code.
Christian Blau [Fri, 28 Jun 2019 13:50:01 +0000 (15:50 +0200)]
Harmonize mrc density format extents with rest of code.

To have x-dimension varying the fastest, density extents have to be
defined having z first. This patch ensures, that the mrc file format
is read in line with the data layout used in the for, e.g., the
Gauss transformation.

Change-Id: I3a1a9f215d95dfbc50ea5938bb1d724ac4263556

4 years agoReenable gtest_main target.
M. Eric Irrgang [Wed, 7 Aug 2019 10:47:42 +0000 (13:47 +0300)]
Reenable gtest_main target.

To make the the GROMACS use of add_subdirectory(googletest) functionally
equivalent to googletest discovered in other ways, we need both the
gtest and gtest_main CMake targets.

Change-Id: I2e2748ef47e1964cf271ece2754b0c0ac52f4f6b

4 years agoStop testing ICC on Windows
Mark Abraham [Thu, 8 Aug 2019 09:25:55 +0000 (11:25 +0200)]
Stop testing ICC on Windows

Windows is seldom used with GROMACS, and likely Windows+ICC is never
used. Maintaining the build system (including compiler flags) to work
with this combination, together with installing and updating ICC on
our Windows agent node is work that does not deliver value. We're not
likely to be able to afford to continue doing this in Gitlab Runner.

Moved the unrelated test coverage provided by the former post-submit
configuration to other configurations.

Updated install guide to reflect the new status (plus a few other
incidental updates).

Change-Id: I69868d29d95f959b31c1514f219d3d0940af00e6

4 years agoRefactor Leap-Frog tests and connect them to CPU version
Artem Zhmurov [Tue, 30 Jul 2019 14:30:45 +0000 (16:30 +0200)]
Refactor Leap-Frog tests and connect them to CPU version

This introduces test data object and runners to the Leap-Frog
tests, which are now connected to the CPU version of Leap-Frog.
This also makes possible to include tests based on the reference
values, which are needed to make sure that the temperature and(or)
pressure control works fine in new implementations.

Refs. #2816, #2888.

Change-Id: Id2d934c43138889ad178a94126cab4da2895bb5a

4 years agoProvide callbacks/notifications for MDModules
Christian Blau [Tue, 23 Jul 2019 15:25:06 +0000 (17:25 +0200)]
Provide callbacks/notifications for MDModules

Adds functionality for MdModules to subscribe to be called back during
the simulation. Within the run, subscribed modules are notified of
events, that are distinguished by the function argument by the call back
function.

Implements the callbacks based on storing function pointers, following
the discussion in https://gerrit.gromacs.org/c/gromacs/+/10942

refs #2945

Change-Id: I61589215fa9beb79825f0b5261ed50b4116046ff

4 years agoUse gmock and gtest targets from googletest-release-1.8.0
M. Eric Irrgang [Tue, 23 Jul 2019 19:05:53 +0000 (22:05 +0300)]
Use gmock and gtest targets from googletest-release-1.8.0

Import a couple of missing files from the googletest-release-1.8.0 and
switch to the upstream definition of the `gmock` and `gtest` targets.

Removed some outdated content from README.Gromacs

Refs #3033

Change-Id: Iaefe4d11b01a3d37e162d7d00bae7ba34a0b5b4e

4 years agoFix for cmake lists in mdlib tests
Artem Zhmurov [Tue, 6 Aug 2019 15:06:17 +0000 (17:06 +0200)]
Fix for cmake lists in mdlib tests

Merged change 11284 included badly merged cmake list, which can
break cmake. This fixes the problem.

Change-Id: Id0149cfbca0c07513e7ee46fe3c4a612654b71ce

4 years agoSeparate out OperationDetailsBase.
M. Eric Irrgang [Thu, 20 Jun 2019 10:53:40 +0000 (13:53 +0300)]
Separate out OperationDetailsBase.

Develop abstractions for implementing operations with data flow.

Refs #2996

Change-Id: Ie893039f2a73647ed254e0f4a68ed4e21de7a500

4 years agoRemove PImpl scaffolding from CUDA version of Leap-Frog
Artem Zhmurov [Tue, 28 May 2019 14:09:41 +0000 (16:09 +0200)]
Remove PImpl scaffolding from CUDA version of Leap-Frog

Private implementation in CUDA version of Leap-Frog was
used to introduce this integrator as a stand-alone unit.
Now it is merged with constraints, PImpl is no longer
needed.

Refs #2816, #2888

Change-Id: Iea82abef016b7e15b9be44a0e1b446e12e582d3c

4 years agoConvert test infrastructure targets to static library targets.
M. Eric Irrgang [Mon, 5 Aug 2019 15:32:20 +0000 (18:32 +0300)]
Convert test infrastructure targets to static library targets.

Convert CMake function `gmx_add_unit_test_object_library()` to
`gmx_add_unit_test_library()` and produce STATIC instead of OBJECT
targets. Update `mdrun_test_objlib` to `mdrun_test_infrastructure`
using the helper function.

This allows the target to use `target_link_libraries` to get the
compiler flags, definitions, and include directories necessary for
compatibility with `gmock` and other resources. Resolves some noisiness
from googletest headers under the standard GROMACS `-Wundef` flag.
Relevant to related change that migrate from global GMOCK variables to
modern usage of gtest and gmock CMake targets.

Removed unnecessary TESTUTILS_LIBS variable.

Refs #3033

Change-Id: Id5b47774b679e8e205f899ea80df65153da44516

4 years agoAdd ForceWithShiftForces class
Berk Hess [Fri, 2 Aug 2019 09:11:46 +0000 (11:11 +0200)]
Add ForceWithShiftForces class

Note that the shift forces buffer is not yet set nor used.

Change-Id: Ic203875536b635af26ab3535c57a2b54c11496e7

4 years agoFix latex formula in reference manual
Berk Hess [Tue, 6 Aug 2019 07:30:07 +0000 (09:30 +0200)]
Fix latex formula in reference manual

Change-Id: I033b2639729ec958a2b7fe9060850921805ac517

4 years agoResolve a compiler warning for the gmxapi Python package.
M. Eric Irrgang [Fri, 26 Jul 2019 17:06:14 +0000 (20:06 +0300)]
Resolve a compiler warning for the gmxapi Python package.

The pybind macro to generate boiler-plate Python module initialization
around the module export code defines a non-static function required by
the Python C API, but this triggers the "missing-prototype" compiler
warning. This change adds the prototype to the module.h header file.

Change-Id: Id173e05c4400326f35b1848bbf0159aebc172a27

4 years agoAdd libgromacs dependency to gpu_utilstest_cuda target.
M. Eric Irrgang [Mon, 5 Aug 2019 10:00:50 +0000 (13:00 +0300)]
Add libgromacs dependency to gpu_utilstest_cuda target.

At least when built with Clang in some cases, gpu_utilstest_cuda did not
have access to several GROMACS symbols, probably due to some recent
shuffling of dependencies affecting what was available transitively.
Explicitly adding the `libgromacs` target resolves issues.

Change-Id: Ie43aa4c42802bce40afb3d33ea6c87ec5a83ffff

4 years agoAdd trivial const qualifier to energy output
Pascal Merz [Mon, 5 Aug 2019 22:55:50 +0000 (16:55 -0600)]
Add trivial const qualifier to energy output

Change-Id: I9b2b2a836388967dc4b4299e9d238ac7a3e27412

4 years agoAdd const getter to MDAtoms
Pascal Merz [Mon, 5 Aug 2019 22:46:27 +0000 (16:46 -0600)]
Add const getter to MDAtoms

This allows objects to have a const pointer / reference to MDAtoms
when using underlying functions requiring a const pointer of type
t_mdatoms.

Change-Id: I0135989f43c7be02ec3b89891d98109100d1f0b9

4 years agoAdd quote
Mark Abraham [Mon, 5 Aug 2019 19:56:56 +0000 (22:56 +0300)]
Add quote

Change-Id: Ie324a88a283e56a511256ce37e3538d680459d6e

4 years agoMove ownership of kinetic energy object to ISimulator
Pascal Merz [Tue, 25 Jun 2019 07:07:10 +0000 (01:07 -0600)]
Move ownership of kinetic energy object to ISimulator

Treating the kinetic energy object (ekind) equivalently to the
energy object (enerd) makes subsequent changes easier. It also
removes some code duplication between do_md, do_rerun and
do_mimic. There are some algorithms that never use the kinetic
energy (e.g. minimization), but this is true for other members
of ISimulator as well.

Change-Id: I995d14652dae25bcbcaa0a75437382a053e76f74

4 years agoMake box const in do_force()
Berk Hess [Wed, 31 Jul 2019 20:49:13 +0000 (22:49 +0200)]
Make box const in do_force()

Change-Id: Ie0854b159512af227790a5d8010d5501af3d5094

4 years agoAdded Simulator comparison test
Pascal Merz [Thu, 14 Feb 2019 06:05:53 +0000 (23:05 -0700)]
Added Simulator comparison test

This change extracts the general machinery to compare two simulation
runs which are expected to yield identical results. Currently, one
such test is used to compare the results of a rerun to the results
of the original simulation run.

This also add a test to compare two runs of the same .tpr file, setting
an environment variable for one of the runs. This allows to test that
new features (implemented behind a feature flag using an environment
variable) which are expected to be equivalent to existing features
yield identical results. The test can be used for other feature flags,
but is currently used for the GMX_USE_MODULAR_SIMULATOR environment
variable, used by the upcoming modular simulator implementation. As
this implementation is not yet present, the current test is supposed
to always pass, as it simply runs the same .tpr file on the same code
path twice.

Change-Id: I5a36ce0c488ba4baf65ad4a137c6d1ea75fa6e60

4 years agoAdd replacements for pbc enumerations
Paul Bauer [Thu, 9 May 2019 08:43:27 +0000 (10:43 +0200)]
Add replacements for pbc enumerations

Adds new enum classes to describe different types of unit cells and
centering operations. Those are intended to replace the legacy types
in the new version of tools that perform operations dependent on them.

They don't replace the old types completely, as the legacy options
handling depends on those.

Change-Id: I64954a8e7a78aab47359a40d6ea06b54e5cb6910

4 years agoIntroduce SimulatorBuilder
Pascal Merz [Mon, 27 May 2019 06:50:47 +0000 (00:50 -0600)]
Introduce SimulatorBuilder

Introduce a builder for Simulator object. Currently, the SimulatorBuilder
class has only a single build(...) function which takes the same
arguments as the LegacySimulator constructor. This framework does,
however, allow us to easily build other, more modular Simulator objects
in future changes.

Change-Id: Ib51a481ccc5019c4e916165102c808e7553cc539

4 years agoAdd free function to convert matrix type
Paul Bauer [Mon, 5 Aug 2019 15:08:31 +0000 (17:08 +0200)]
Add free function to convert matrix type

New free function that allows generation of a Matrix3x3 type from the
legacy matrix type. Prepares for replacing the old matrix types.

Refs #2976

Change-Id: I5f17bef75d666b5221519c38abfa05a2ccd89cb0

4 years agoChange ForceOutputs to a class
Berk Hess [Fri, 2 Aug 2019 08:15:12 +0000 (10:15 +0200)]
Change ForceOutputs to a class

Also moved ForceOutputs to forceoutput.h and made use of it
in post_process_forces() and do_force_lowlevel().

Change-Id: I32471f4eb3daa8c98a7478f88b98f7e3360e55f1

4 years agoRemove libgromacs_generated contributions from FindCUDA.cmake
Mark Abraham [Sun, 4 Aug 2019 17:16:15 +0000 (19:16 +0200)]
Remove libgromacs_generated contributions from FindCUDA.cmake

This causes problems with cmake versions > 3.10

Change-Id: I5d81662788dabe7aca1e5c37955198878a9baab3

4 years agoSeparate out OperationDirector.
M. Eric Irrgang [Thu, 20 Jun 2019 10:50:05 +0000 (13:50 +0300)]
Separate out OperationDirector.

Develop abstractions for implementing operations with data flow.

Refs #2996

Change-Id: Ib0b899ea85a59c58ee33a5e3d8a28b33fb67047a

4 years agoRemove semicolon from GPU TERM macros
Berk Hess [Fri, 2 Aug 2019 14:56:55 +0000 (16:56 +0200)]
Remove semicolon from GPU TERM macros

This leads to less confusion in formatting tools such as clang-format.

Fixes #3053.

Change-Id: I0367b2f9ff1a8f8b4369505a41557c3feb8c9c71

4 years agoRearchitect gmxapi.operation
M. Eric Irrgang [Wed, 19 Jun 2019 15:10:11 +0000 (18:10 +0300)]
Rearchitect gmxapi.operation

Includes many work-arounds for an incomplete data model,
illustrating what will need to be addressed in gmxapi
self-describing type system, data shaping, and Futures
implementation.

* Move several nested classes to the gmxapi.operation scope.
  Introduced abstractions and refactoring to replace some
  dynamic definitions in the function_wrapper closure with
  composition or more tightly scoped closures. Provide
  cleaner helpers for dynamically defined operation, input,
  and output types.
* Introduce minimal NDArray class and ndarray factory.
* Replace ImmediateResult with a Future of a StaticResource
* Implement Future slicing with Futures of ProxyResource
* Define several Descriptor classes for generic attribute
  accessors in standard interfaces, supporting similar
  style of interaction with resources as in C++ extensions.
* Explicitly type collaborations in the preliminary data flow
  protocols.
* Introduce ensemble data.
* Rename append_list to join_arrays.
* Add a lot of static type hinting and run-time type checking.

Note that the execution dependency in FR2 has been superseded by the
data flow driven dependency in FR3. The syntax supported in FR2 is now
disabled to allow development towards FR4.

Refs #2993
Refs #2994
Refs #2996

Change-Id: I94a63d5801f97eb79962c693b48fa80a7c96c0ec

4 years agoIntroduce Simulator base class
Pascal Merz [Sat, 25 May 2019 07:22:11 +0000 (01:22 -0600)]
Introduce Simulator base class

In view of having simulators differing based on user input rather
than a large single rigid simulator object that does everything,
this change introduces a ISimulator interface. The current Simulator
class (renamed to LegacySimulator), implements the interface.
Derived classes cannot be aggregate-initialized, so a constructor
has been added to LegacySimulator. This change paves the way to use
a builder for custom Simulator objects rather than the current
single implementation.

To avoid code repetition, this base class is not a pure interface,
but has the member variables of the current LegacySimulator and a
constructor. This avoids having to write a (largely duplicated)
constructor for each simulator implementation, and allows us to
use parameter packages within the builder to avoid having to write
out the 30+ variables outside of the ISimulator definition.

Change-Id: I6afa478e4d01f6d52b2ed7689acea51a0f69ad5c

4 years agoReduce conflicts with external googletest files.
M. Eric Irrgang [Mon, 29 Jul 2019 11:15:01 +0000 (14:15 +0300)]
Reduce conflicts with external googletest files.

Move the custom googletest CMakeLists.txt up a level to src/external so
that we can just drop in the downloaded googletest bundle as it is
distributed. In a future change, we can use the gmock and gtest targets
defined in that infrastructure instead of sculpting our own.

Refs #3033

Change-Id: I4c8ed84195f7673fd798301ba149de8c122ccb05

4 years agoRemove a pointer in t_forcerec
Berk Hess [Thu, 1 Aug 2019 12:22:15 +0000 (14:22 +0200)]
Remove a pointer in t_forcerec

Change-Id: I8049ed6137bc64230373e3223ae923b42e9f11c3

4 years agoFix nbnxm GPU memory reservation issue
Berk Hess [Thu, 13 Jun 2019 10:09:42 +0000 (12:09 +0200)]
Fix nbnxm GPU memory reservation issue

The nbnxm search code reserved space for exclusions without
overallocation, which led to high allocation overhead during
the first few search calls.
Merged the two loops over cluster-pair parts in
set_self_and_newton_excls_supersub() to simplify the code.

Change-Id: I5a8bad40da312c6f9b1bb44b1d8752f315a1ca53

4 years agoManage compiler flags and some include options per file or target, not globally
Mark Abraham [Wed, 31 Jul 2019 09:55:35 +0000 (11:55 +0200)]
Manage compiler flags and some include options per file or target, not globally

The legacy CMake approach of adding to the global compiler flags
variables is no longer accepted practice. Following the new idiom will
give us more control, e.g. over whether warning flags intended for
GROMACS code will apply to e.g. external code. Now all kinds of
generated and external code cannot emit any of the warnings that we
intend to enable for GROMACS code.

Compiler command lines are now constructed from proper CMake lists of
flags, ie. with semicolon separators. This means we can use more
modern CMake idiom with generator strings, rather than munging our own
strings into compiler command lines.

Similarly, include directories such as for thread-MPI are no longer
added globally.

Some flags that disable warnings activated by bulk warning flags are
changed to be detected in an order that still produces a list of flags
that disables groups of warnings as intended.

Silenced a few MSVC warnings about things that are not worth fixing
for GROMACS.

Change-Id: I8cc470ad74264dc11bc292988f50cc16cbb02437

4 years agoImprove use of object libraries in libgromacs
Mark Abraham [Wed, 31 Jul 2019 09:26:33 +0000 (11:26 +0200)]
Improve use of object libraries in libgromacs

Code such as thread-MPI, linear algebra, the selection parser, and
vmddlopen is external to GROMACS and needs different handling for
things like suppressing compiler warnings.  In modern CMake, this is
best done with OBJECT libraries.

This changes prepares for modernizing how compiler flags are handled.

Removed some warning suppressions that were useful only for the
generated groups-scheme kernel files.

Change-Id: I364ad7b3be7f82ba0f583583e502c4d229a21e9a

4 years agoMerge "Merge release-2019 into master"
Mark Abraham [Thu, 1 Aug 2019 09:54:26 +0000 (11:54 +0200)]
Merge "Merge release-2019 into master"

4 years agoMerge release-2019 into master
Paul Bauer [Wed, 31 Jul 2019 13:28:34 +0000 (15:28 +0200)]
Merge release-2019 into master

Resolved Conflicts:
cmake/gmxVersionInfo.cmake
docs/CMakeLists.txt
docs/release-notes/2019/2019.2.rst
src/external/build-fftw/CMakeLists.txt
src/gromacs/awh/read-params.cpp
src/gromacs/awh/read-params.h
src/gromacs/domdec/domdec_internal.h
src/gromacs/ewald/pme-gather.clh
src/gromacs/fileio/gmx_internal_xdr.cpp
src/gromacs/gmxana/gmx_editconf.cpp
src/gromacs/gmxpreprocess/readir.cpp
src/gromacs/listed-forces/manage-threading.cpp
src/gromacs/mdlib/broadcaststructs.cpp
src/gromacs/mdlib/membed.cpp
src/gromacs/mdlib/nbnxn_atomdata.cpp
src/gromacs/mdlib/nbnxn_atomdata.h
src/gromacs/mdlib/nbnxn_search.cpp
src/gromacs/mdlib/ns.cpp
src/gromacs/mdrun/runner.cpp
src/programs/mdrun/tests/spc-and-methanol.top

Change-Id: I2c0853732620246cade31f3a66ae23b7ba5b902b

4 years agoRemove unused CGLO_INITIALIZATION
Berk Hess [Wed, 31 Jul 2019 19:54:45 +0000 (21:54 +0200)]
Remove unused CGLO_INITIALIZATION

Change-Id: I4445a89ecdf8bfa6255d31a632effdec6c09c86e

4 years agoRemove vcm removal from compute_globals()
Berk Hess [Wed, 31 Jul 2019 13:51:09 +0000 (15:51 +0200)]
Remove vcm removal from compute_globals()

compute_globals() should only compute and not modify t_state.
Therefore the COM removal is now moved out of compute_globals().
Two separate vcm calls are now moved into one wrapper function.
Now compute_globals() no longer needs fplog and x and v are const.

This change is only refactoring.

Change-Id: I1d6577f2d83fda916421b17fda49d328c4e0a600

4 years agoChange the file structure in constraints tests
Artem Zhmurov [Fri, 26 Jul 2019 09:17:34 +0000 (11:17 +0200)]
Change the file structure in constraints tests

To avoid the confusion with the private implementation (PImpl)
classes, _impl suffix is abandoned, the constraining instances
are now called runners. The class that stores all the data
structures is now in separate file.

Change-Id: Ibbff52da578db5e0b001b5802b44e0917f46f70b

4 years agoAdd grompp warning with use of GROMOS FF
Berk Hess [Thu, 7 Mar 2019 17:41:25 +0000 (18:41 +0100)]
Add grompp warning with use of GROMOS FF

Added OPLS-based simulation database entry to replace
the current GROMOS-based one, to avoid simulations triggering
warnings when this is not the intent of the test case.

This commit was cherry-picked from release-2019 and updated for master
branch. The latter makes more widespread use of the GROMOS test setup
that we wish to replace.

Split some PME tests so that we test normal PME with xyz PBC
separately from walls with xy PBC.

Removed unused duplicate files in testing.

Refs #2884

Change-Id: I55afcf7ea5b423fa27792acebe09ea520b475974

4 years agoIntroduce function that checks if the computations can be done on a GPU
Artem Zhmurov [Tue, 23 Jul 2019 13:54:53 +0000 (15:54 +0200)]
Introduce function that checks if the computations can be done on a GPU

The following conditions should be fulfilled in order to compute on a GPU:
1. The code should be compiled with GPU support.
2. There should be compatible GPUs installed in the system.
3. These GPUs shuold be detectible from the code.
4. Environmental variable GMX_DISABLE_GPU_DETECTION should not be set.

TODO: This function is used in tests, so it should be eventually moved
      to src/testutils.

Change-Id: I40ce381b68fcebcfab330db4b48a1bec2a2b7a57

4 years agoStore wcycle pointer in nonbonded_verlet_t
Szilárd Páll [Mon, 29 Jul 2019 16:24:46 +0000 (18:24 +0200)]
Store wcycle pointer in nonbonded_verlet_t

Removed wcycle arguments from method calls that no longer need it and
moved a few instances of cycle counting into the nbmxn module.

Change-Id: Ic5646b3bb85ed2c66137e9db7bd70822df95042b

4 years agoFixes for F buffer ops change
Szilárd Páll [Wed, 10 Jul 2019 18:48:16 +0000 (20:48 +0200)]
Fixes for F buffer ops change

Change-Id: I8880ff91156c983560ee2173748faa8a4b189817

4 years agoRemove need for GROMOS FF in test
Berk Hess [Tue, 30 Jul 2019 11:50:13 +0000 (13:50 +0200)]
Remove need for GROMOS FF in test

The methanol + SPC test system in the simulation database now
incorpates the needed GROMOS force field parameters in the top file
to avoid dependence on the deprecated force field files.

Change-Id: Ib039c09fd38dfc153aed0787ecf14991ccb795cf

4 years agoRename Simulator to LegacySimulator
Pascal Merz [Mon, 27 May 2019 19:36:35 +0000 (13:36 -0600)]
Rename Simulator to LegacySimulator

In view of the new modular simulator, we will want an interface for
simulators rather than a single rigid implementation. As we will keep
the current implementation around for a while, we're renaming it here
to free up the generic "Simulator" term.

Change-Id: Iaa5cca332130b8324e11206e2044af799a52f9c0

4 years agoMove cycle counting into the GPU bonded module
Szilárd Páll [Fri, 26 Jul 2019 18:31:49 +0000 (20:31 +0200)]
Move cycle counting into the GPU bonded module

Additionally:
- removed some outdated TODOs;
- renamed accumulateEnergyTerms() to waitAccumulateEnergyTerms()
to reflect that it does a blocking wait for results.

Change-Id: I1bd7f1ddecea94ff2696721c9f2d6eac45bea738

4 years agoReport when development feature flags are used
Szilárd Páll [Mon, 15 Jul 2019 17:38:58 +0000 (19:38 +0200)]
Report when development feature flags are used

On order to help identify runs that use development features triggered
using environment variables, this change adds reporting of these to both
log and standard output.

Change-Id: I6d554af25e3b17b38f3826efbf2a5179bd6d3b89

4 years agoMove end of step GPU task launches to a function
Szilárd Páll [Fri, 26 Jul 2019 17:35:56 +0000 (19:35 +0200)]
Move end of step GPU task launches to a function

Code movement mostly to improve readability; also moved the misplaced
call to pme_gpu_reinit_computation() which should be called after the
GPU force buffer reduction.

Change-Id: I4dc602b16b67a3f79ee3b8802a6f5d0d39a8f33b

4 years agoUse invsqrt and cbrt in free energy kernel
Berk Hess [Wed, 26 Jun 2019 16:51:24 +0000 (18:51 +0200)]
Use invsqrt and cbrt in free energy kernel

This speeds up the soft-core free-energy kernel by 15%.

Change-Id: Id97226c8611d56312d89df94dec29eeb766a45a8

4 years agoAdd wrapper for outputadapter methods
Paul Bauer [Thu, 30 Aug 2018 13:35:06 +0000 (15:35 +0200)]
Add wrapper for outputadapter methods

Adds a wrapper for containing all the commandline options needed to
initialize the different outputadapter methods.

Change-Id: I5ea750203f3e493394ec7e62f385b05b20e442a7

4 years agoRemove LJ Ewald correction tables
Berk Hess [Fri, 26 Jul 2019 09:35:31 +0000 (11:35 +0200)]
Remove LJ Ewald correction tables

The LJ Ewald correction tables have been removed. This has
the (positive) side effect that the table spacing for Coulomb
Ewald is no longer dependent on the LJ Ewald settings.

Also removed rtab in several places, since it was only used
with the group cutoff scheme.

Change-Id: Ib7d75071bba24508adb94c5d50ac3629d63db10c