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

4 years agoAdd initialization to t_nrnb
Berk Hess [Fri, 26 Jul 2019 13:19:32 +0000 (15:19 +0200)]
Add initialization to t_nrnb

Also fixed a memory leak.

Change-Id: I9c4bd3ed1919c82cf26d1181ea98d4c2dcc37b0b

4 years agoFix segmentation fault with cosine pulling
Berk Hess [Mon, 29 Jul 2019 11:45:34 +0000 (13:45 +0200)]
Fix segmentation fault with cosine pulling

Both grompp and mdrun would fail with a segmentation fault when
using cosine-weighted COM pulling.

Fixes #3023

Change-Id: I6342a579251d21ba07a42d23ce578ae1e20c3286

4 years agoRemoved generalized reaction-field
Berk Hess [Fri, 26 Jul 2019 11:29:35 +0000 (13:29 +0200)]
Removed generalized reaction-field

This only worked correctly with the group scheme and charge groups.
Although this could be implemented by using net charges of molecules,
having the interaction function depend on the system volume and
temperature complicates the code and correctness checking.

Change-Id: If29b28772cd83524c5984f64cfcd88cc4060ca36

4 years agoConvert Ewald correction tables to C++
Berk Hess [Fri, 26 Jul 2019 06:52:09 +0000 (08:52 +0200)]
Convert Ewald correction tables to C++

This change introduces a separate struct for the non-bonded
Ewald correction tables that uses std::vector instead of
manual memory management.
Although there are new (unused) table classes, the reorganization
is needed now to convert interaction_const_t to proper C++.

This change is only refactoring.

Change-Id: I9dbdcd401c8a3d9674775a25117663cbe86ecfb3

4 years agoAdd default initialization to interaction_const_t
Berk Hess [Thu, 25 Jul 2019 13:44:17 +0000 (15:44 +0200)]
Add default initialization to interaction_const_t

Also changed the manual destruction to a destructor.

Change-Id: I4c075c7f17b3376edd3b60bc25108f57cc404c88

4 years agoFix failing check-source target on python3.6
Christian Blau [Thu, 18 Jul 2019 09:08:11 +0000 (11:08 +0200)]
Fix failing check-source target on python3.6

When the locale is not set to UTF-8 encoding, check-source fails.

This fixes #3039

Change-Id: I79b222ae9f839123f3e7411c5d73249462aafab0

4 years agoRemove sh_invrc6 from interaction_const_t
Berk Hess [Wed, 24 Jul 2019 13:56:24 +0000 (15:56 +0200)]
Remove sh_invrc6 from interaction_const_t

Change-Id: Ib903b9b0dc3a85f290e084db87f102b9c05c2f56

4 years agoRemove PImpl scaffolding from CUDA version of SETTLE
Artem Zhmurov [Mon, 27 May 2019 16:56:39 +0000 (18:56 +0200)]
Remove PImpl scaffolding from CUDA version of SETTLE

GPU version of SETTLE was implemented as a class with private
implementation so it will be possible to initialize on
non-CUDA hosts. Now, the implementation can be hidden
inside the Update and Constraints PImpl so that the CUDA
specific types and calls can be exposed in SETTLE and
private implementation is no longer needed there.

Refs #2816, #2888

Change-Id: I4c78f2629be34b42bb5f4f7d34970c3e41515691

4 years agoSplit canDetectGpus()
Berk Hess [Mon, 22 Jul 2019 09:24:35 +0000 (11:24 +0200)]
Split canDetectGpus()

The function canDetectGpus() was used in a higher and lower level
fashion. The original canDetectGpus() is renamed to
isGpuDetectionFunctional(). Added canPerformGpuDetection() which also
checks for a GPU build and the env.var. GMX_DISABLE_GPU_DETECTION.

This also fixes an inconsistency error in the PME GPU unit tests
when running with GMX_DISABLE_GPU_DETECTION.

Change-Id: If762b2a108eedeb1bda0a2af9afa8a418aa93e14

4 years agoOnly stop the CUDA profiler if there are devices
Szilárd Páll [Mon, 15 Jul 2019 15:46:20 +0000 (17:46 +0200)]
Only stop the CUDA profiler if there are devices

If there are no CUDA devices the unconditionally called cudaProfilerStop
returns with an error. This change makes the the stop API call
conditional to avoid the corner-case assertion error in a profiler run
with no GPUs.

Change-Id: Ife306c927d163163511a2ebf06a7efe6d4122490

4 years agoAdd transpose operation to Matrix3x3
Kevin Boyd [Mon, 22 Jul 2019 19:34:17 +0000 (15:34 -0400)]
Add transpose operation to Matrix3x3

refs #2976

Change-Id: I8f0ce04b18be1e8b119de02cb6b52b3314cd67eb

4 years agoFix doxygen in coordianteio files
Paul Bauer [Thu, 4 Jul 2019 09:00:43 +0000 (11:00 +0200)]
Fix doxygen in coordianteio files

Had the wrong order for the doxygen statements and corrected that.

Change-Id: Iead4ca5e6b9747f2dcb435f610f8e3dc042da5aa

4 years agoAdd outputadapters (3/3)
Paul Bauer [Thu, 30 Aug 2018 13:31:08 +0000 (15:31 +0200)]
Add outputadapters (3/3)

Add outputadapters based on IOutputAdapter that can be used to set the
output precision and change the time information included in a
t_trxframe.

Change-Id: I3b0b5e975235e4b3e93a159e1a60490ba9d4386b

4 years agoFix HTML source documenation error caused by GaussTransform3D
Christian Blau [Tue, 23 Jul 2019 15:26:38 +0000 (17:26 +0200)]
Fix HTML source documenation error caused by GaussTransform3D

In doxygen/html-full/annotated.xhtml, doxygen generated an invalid
xhtml file with the following error on line 724 at column 493:

Opening and ending tag mismatch: td line 0 and p

This patch fixes the error by changing the math rendering from
multi-line to single line.

It further removes superfluous * in the verbatim comment of same
class.

Change-Id: I80996743743758095ceac78c519fbec88da9f772

4 years agoRemove one of the examples from sample_restraint.
M. Eric Irrgang [Tue, 16 Jul 2019 14:42:51 +0000 (17:42 +0300)]
Remove one of the examples from sample_restraint.

Remove the old simple harmonic spring potential. It is not useful and
presents a maintenance headache as we modify the plugin interfaces.
Take this opportunity to clarify or simplify some naming.

Refs #3027

Change-Id: Ic0c59b0f2b9391beac48f64cabba8dbf05f0cd63

4 years agoRemove tests of make_unique
Mark Abraham [Wed, 24 Jul 2019 11:26:19 +0000 (13:26 +0200)]
Remove tests of make_unique

These made sense when we had compat::make_unique, but we should
not be maintaining code for testing std components.

Change-Id: I794e33638ed97331453bb28da2fbb7b944e72ed2

4 years agoBegin new sample_restraint development.
M. Eric Irrgang [Wed, 10 Jul 2019 15:55:24 +0000 (18:55 +0300)]
Begin new sample_restraint development.

* Update the sample MD plugin project for its new home in the GROMACS
  source tree and the gmxapi Python package that is now part of the
  GROMACS distribution (as opposed to gmxapi 0.0.7 hosted at
  https://github.com/kassonlab/sample_restraint)
* Update googletest infrastructure to use CMake 3.9 utilities.
* Download googletest and pybind sources during docker CI build.
* Download binary test data from GitHub.

Future updates are necessary both for using the subtree in Jenkins
builds (to avoid downloading or using redundant copies of dependencies)
and for using the subtree as a starting point for an external project
(in which case the external dependencies _should_ be bundled).

Also, requires Change-Id: I44a66646eceb191a2ec755169671af326f22526a to
pass all CI tests.

Refs #3027

Change-Id: I4dd699168d6bc8e84e7de4d3b5b7b1cd6bd21090

4 years agoFix gmxapi notebook image and sample_restraint docker build stage.
M. Eric Irrgang [Wed, 24 Jul 2019 09:27:44 +0000 (12:27 +0300)]
Fix gmxapi notebook image and sample_restraint docker build stage.

Resolve conflicting logic from upstream merges.

Change-Id: I2fb42e602ce73d5849cf435f713f2c35101674e2

4 years agoClarify use of Python venv in gmxapi docker images.
M. Eric Irrgang [Tue, 23 Jul 2019 19:44:56 +0000 (22:44 +0300)]
Clarify use of Python venv in gmxapi docker images.

Refs #2756

Change-Id: I182c83be424fcf134bc0f3ce7c41a58c6fb1f07e

4 years agoImprove gmxapi docker testing environment.
M. Eric Irrgang [Wed, 26 Jun 2019 11:35:23 +0000 (14:35 +0300)]
Improve gmxapi docker testing environment.

* Generalize venv directory.
* Add some usage notes.
* Better support alternative users in executing containers.
* Remove stale TODO.
* Allow for passing additional arguments to pytest.

Refs #2756

Change-Id: I9f67d46aa93fb789825cb78cc2a95b24f7dfccaa

4 years agoImprove docs for gmxapi Python environment preparation.
M. Eric Irrgang [Mon, 22 Jul 2019 11:30:02 +0000 (14:30 +0300)]
Improve docs for gmxapi Python environment preparation.

Try to account for differences in system environments with additional
notes on accessing different versions of Python interpreters and on
bootstrapping pip.

Change-Id: I7acea811d86e801b1c9989b09041627c9be718c9

4 years agoUpdate developer guide
Mark Abraham [Tue, 23 Jul 2019 08:44:35 +0000 (10:44 +0200)]
Update developer guide

Noted best practice for using forward declarations in headers.

Change-Id: Ib6411c43d93481a45d4f065b8dd6c8141f199b61

4 years agoDon't install sample restraint package by default.
M. Eric Irrgang [Wed, 17 Jul 2019 15:21:22 +0000 (18:21 +0300)]
Don't install sample restraint package by default.

When building the sample_restraint project as part of a GROMACS build,
do not installed the myplugin Python package as part of the `install`
target. This is almost undoubtedly not what the user intended.

However, the package is still built when GMX_PYTHON_PACKAGE=ON to help
catch errors and facilitate testing by developers or automated systems
(i.e. Jenkins).

Refs #3027

Change-Id: I934fcc9f8f6f3f749435c5a85a904006e48d1d81

4 years agoModernize syntax of enable_if and traits to use _t helpers
Kevin Boyd [Fri, 12 Jul 2019 15:50:02 +0000 (11:50 -0400)]
Modernize syntax of enable_if and traits to use _t helpers

From c++ 14, "typename std::enable_if<something>::type"
can be reduced to
              "std::enable_if_t<something>"

as can traits with ::type

Note that when we switch to C++ 17, a number of traits with
::value can be similarly shorthanded with _v

Change-Id: I92d4502c51ac613fa81f130ed3127c812c4e0a6f

4 years agoConditionally pin GPU-related grid data
Szilárd Páll [Mon, 15 Jul 2019 11:26:36 +0000 (13:26 +0200)]
Conditionally pin GPU-related grid data

Data that is transferred to the GPU when the buffer ops is offloaded is
now only pinned when the nonbonded module uses GPU offload avoidign the
runtime errors encountered when a GPU-enabled build does not detect a
GPU and therefore the CUDA runtime refuses to register the memory.

Refs #2817 #2934

Change-Id: Iabbc0d9f37fad0e88cd39a078af1346e8f713ec1

4 years agoF buffer operations in CUDA
Alan Gray [Fri, 8 Mar 2019 09:05:47 +0000 (01:05 -0800)]
F buffer operations in CUDA

This patch performs GPU buffer ops for force buffers.

Enable with GMX_USE_GPU_BUFFER_OPS env variable.

Currently, the H2D transfer of the force buffer is switched on with
haveSpecialForces || haveCpuBondedWork || haveCpuPmeWork,
where haveCpuPmeWork is true even when useGpuPme == true
until on-GPU PME-nonbonded reduction is added in follow-up.

TODO: enable PME reduction in GPU buffer ops and remove associated H2D
transfer

Implements part of #2817

Change-Id: Ice984425301d24bac1340e883698244489cd686e

4 years agoImprove some documentation formatting and spelling.
M. Eric Irrgang [Tue, 16 Jul 2019 15:09:07 +0000 (18:09 +0300)]
Improve some documentation formatting and spelling.

Change-Id: Ic59eb3407fda2dbd341fb4ce6235d7c5c99c7630

4 years agoRemove extraneous file.
M. Eric Irrgang [Thu, 11 Jul 2019 16:59:53 +0000 (19:59 +0300)]
Remove extraneous file.

A file was overlooked in Change-Id: I0d847bc2490935e0ddc3170b674d7460a5a08506

Refs #3033

Change-Id: I4fb6af0b6d51b477091c6305872c0c7124e754d6

4 years agoExtend MDLogger levels
Paul Bauer [Thu, 27 Jun 2019 15:13:39 +0000 (17:13 +0200)]
Extend MDLogger levels

Added logging levels for errors and debug information.

Extended tests to check those.

Refs #2999

Change-Id: I8b23de7baf3555ffc89896e68c1998608b7b71cf

4 years agoMove methods out from trjconv
Paul Bauer [Wed, 10 Jul 2019 14:07:20 +0000 (16:07 +0200)]
Move methods out from trjconv

Moves some functions out of trjconv to allow access in other tools as
well. This change is just code movement.

Change-Id: I37e9f8d87862e6ad6666704dc85d74b09b144f49

4 years agoAdd gpubufferops test matrix
Mark Abraham [Wed, 10 Jul 2019 18:33:05 +0000 (20:33 +0200)]
Add gpubufferops test matrix

This commit teaches Jenkins to understand how to enable the GPU buffer
ops environment variable that is the feature flag for a developmental
feature. The new capability is used in a releng build configuration
matrix that releng can be taught to trigger on demand with

 [JENKINS] gpubufferops

comments in gerrit

Change-Id: I30ca4a5d84fe136a657be7a134829f4c696c5d85

4 years agoUse HostVector for Grid/GridSet data need on-GPU
Szilárd Páll [Wed, 24 Apr 2019 12:03:39 +0000 (14:03 +0200)]
Use HostVector for Grid/GridSet data need on-GPU

Grid.cxy_na_, Grid.cxy_ind_, GridSet.cells and GridSet.atomIndices
have been converted from std::vector to gmx::HostVector. This allow
the code to pin the HostVector when X buffer ops is used and to
eliminate the hacky pin/unpin in CUDA buffer ops functions.

Part of #2934
Refs #2817

Change-Id: Icca21dd076128ec582f805ed96e253dfab461270

4 years agoFix pre-submit build matrix and description
Mark Abraham [Tue, 2 Jul 2019 07:46:13 +0000 (09:46 +0200)]
Fix pre-submit build matrix and description

Pre-submit should not fail because the ftp server is not reachable, so
moved it to nightly matrix. Also recorded the intent to test
such a build.

Also fixed that the intent to test AVX_128_FMA in mixed precision was
broken in Ib2c5e14e5d89665130ae8d6c749c3230ccfe72a9. There's no
ability to test this SIMD in pre-submit without wider changes, and their
is neither large risk nor consequence of breaking it, so nightly is OK.

Refs #2809, #2629

Change-Id: I9cd41a359ba662a8a9529540c50c9a7ef546cd29

4 years agoUse const views in matrix determinant calculation
Kevin Boyd [Wed, 10 Jul 2019 22:01:59 +0000 (18:01 -0400)]
Use const views in matrix determinant calculation

Reduces scope of the matrix.h implementation to just reals

Change-Id: Ide66967b35ffc58b3e61c403d3ce1862b5f5b8ca

4 years agoAdd trace functionality to 3x3 matrices
Kevin Boyd [Tue, 2 Jul 2019 03:31:02 +0000 (23:31 -0400)]
Add trace functionality to 3x3 matrices

Replacement for vec.h trace

Change-Id: I5c452cb36bab277ffcb3f2f9645d3d025a1805a8

4 years agoGet rid of clang-tidy warning in do_md/rerun/mimic
Pascal Merz [Mon, 1 Jul 2019 05:45:18 +0000 (23:45 -0600)]
Get rid of clang-tidy warning in do_md/rerun/mimic

This change silences most of the clang-tidy warnings
"Clang-Tidy: Use of a signed integer operand with a binary
bitwise operator" in do_md, do_rerun and do_mimic. This warning
is triggered when using a signed integer with a binary bitwise
operator, as we do all over the code when encoding / decoding
flags. Such warnings are popping up in other parts of the code,
but this change takes only care of the ones which can be
silenced by changes in the simulator functions and the bit shift
definitions.

Change-Id: I7345e987e91051c9688cb2e8a96026682f025b6b

4 years agoRemove dependence of compute_globals on t_state
Pascal Merz [Mon, 1 Jul 2019 00:10:42 +0000 (18:10 -0600)]
Remove dependence of compute_globals on t_state

This change makes the different function related to compute_globals
request the fields of t_state explicitly, instead of simply taking
a pointer to the full t_state object. This simplifies refactoring
the t_state object in future commits. This change also clarifies why
both state->box and an additional parameter `matrix box` is required -
the latter one is the box at the last complete timestep in do_md and
has been renamed accordingly.

Note that in the documentation to checkNumberOfBondedInteractions(),
which was changed in a similar way, the argument `state` was
described as being the global state. Throughout the code, the local
state was used, however. This part of the documentation is now
changed, but if that was intended, then a follow-up change fixing
this might be necessary.

Change-Id: If913656fe9bf07567a29f68592402bb5ff17fc52

4 years agoMake relax_shell_flexcon independent of t_state
Pascal Merz [Tue, 9 Jul 2019 13:14:27 +0000 (07:14 -0600)]
Make relax_shell_flexcon independent of t_state

This change writes out the fields of t_state needed as explicit
arguments of relax_shell_flexcon instead of taking a pointer to
the full t_state object. This simplifies refactoring the t_state
object in future commits.

Change-Id: Iec3d0aea7462325963341b1d192cff697b764a7c

4 years agoClean up gmx solvate
Kevin Boyd [Thu, 27 Jun 2019 02:38:22 +0000 (22:38 -0400)]
Clean up gmx solvate

Changed c-style struct to C++ with defaults, and changed a char*
field to a string.

Used vector instead of pointer array, and associated changes
to appending.

Moved a number of incrementing variables to local scope

Removed some unused variables and renamed confusing increment variables

Change-Id: I4a8def5621e133d48dc3dfb82efa916cbffabce6

4 years agoAdd implicit conversion of mdspan-containing types to mdspan.
Kevin Boyd [Fri, 5 Jul 2019 00:30:34 +0000 (20:30 -0400)]
Add implicit conversion of mdspan-containing types to mdspan.

Analagous to arrayRef function args taking vectors, arrays as input

Change-Id: I701f6373592cdf4d30649041ffe8dee76423433b

4 years agogmxapi Python package documentation layout.
M. Eric Irrgang [Wed, 26 Jun 2019 18:25:20 +0000 (21:25 +0300)]
gmxapi Python package documentation layout.

Refs #2698

Change-Id: Id7fb8c6c91640660566394c37e63b5acb8bd9e3d

4 years agoAdded trivial const qualifier to relax_shell_flexcon()
Pascal Merz [Tue, 2 Jul 2019 03:06:48 +0000 (21:06 -0600)]
Added trivial const qualifier to relax_shell_flexcon()

Change-Id: Id9e93c1254634e45fd0ef4f951a74670deae8607

4 years agoConst qualifier for forces in update_coords
Pascal Merz [Tue, 25 Jun 2019 19:34:44 +0000 (13:34 -0600)]
Const qualifier for forces in update_coords

Reflect the fact that forces are not changed in the coordinate
update routines.

Change-Id: I3c168bf185c6bb746c07d2bb10ff0bf6782c05cf

4 years agoFixed small bug in gmx anaeig
David van der Spoel [Mon, 8 Jul 2019 08:24:29 +0000 (09:24 +0100)]
Fixed small bug in gmx anaeig

Poor use of variable names led to a small bug.

Fixes #2972
Change-Id: I244eac13dbaeeb0eac2be6531e579a125f4a66d3

4 years agoIncorporate sample_restraint repository.
M. Eric Irrgang [Tue, 4 Jun 2019 21:12:58 +0000 (16:12 -0500)]
Incorporate sample_restraint repository.

This commit transfers development of the sample MD plug-in
code from an external repository to the GROMACS repository.
It should not be considered to add or change functionality,
but serves as a base for future integrated development.

The sample_restraint subtree serves as the root of a
template repository that a researcher could start from
to develop gmxapi MD extension code. It is meant to be
self-contained and built against an existing GROMACS
installation. Moving it to a GROMACS repo subdirectory
makes it less accessible to extension developers, but
easier to test and maintain for GROMACS developers. Near
term follow-up should include the creation of an external
skeleton repository, downstream subtree repository, or
"cookie cutter" repository drawing core content from the
GROMACS subtree.

* Import project from GitHub
  - https://github.com/kassonlab/sample_restraint/releases/tag/v0.0.7.3
  - Bundled sources for external projects are omitted.
  - Bundled test data files are omitted.
* Updates for compatibility with the gmxapi Python package are deferred
  to future changes.

Refs #3027

Change-Id: I1033a4a74dbce1bf1f9220a31cc9c15055c5dbaf

4 years agoBegin CMake front-end for Python packaging machinery.
M. Eric Irrgang [Thu, 23 May 2019 21:44:00 +0000 (16:44 -0500)]
Begin CMake front-end for Python packaging machinery.

Allow gmxapi Python package sources to be discovered in the main GROMACS
CMake configuration step. During build, a functioning package will
appear in the build tree in
${CMAKE_BINARY_DIR}/python_packaging/src/gmxapi_staging that can be used
for tests and auto-generated documentation builds.

A Python 'sdist' can be built from this location in the build tree, or
the package can be built and installed directly from the source tree
with setup.py in python_packaging/src/

Refs: #2896

Change-Id: I225dd890c93405880ef057465eb7c159cd097665

4 years agoFix link to acpype repository
Paul Bauer [Tue, 9 Jul 2019 08:31:45 +0000 (10:31 +0200)]
Fix link to acpype repository

Fix as reported on the user mailing list.

Change-Id: Ifdba6a60857360346653d3c9caaa929094bebae5

4 years agoFix postsubmit
Paul Bauer [Mon, 8 Jul 2019 09:20:13 +0000 (11:20 +0200)]
Fix postsubmit

Fix unstable post submit matrix by removing unused member functions in
constraint tests.

Change-Id: I156e8b1e6b1689afaa4269e2e4bb505768eea5c9

4 years agoEliminate a use of double precision in the GPU bonded kernels
Szilárd Páll [Fri, 5 Jul 2019 21:09:36 +0000 (23:09 +0200)]
Eliminate a use of double precision in the GPU bonded kernels

The usual degree-to-radian conversion macro pulled in a double
literal.

Change-Id: I0d401427a2649e02dd81f603bf12979d7b15c583

4 years agoStore nbnxm gridSet data in GridSetData
Berk Hess [Thu, 14 Mar 2019 15:20:22 +0000 (16:20 +0100)]
Store nbnxm gridSet data in GridSetData

Change-Id: Ib018c59de965195c3093a0092eb711ff3d1ef41b

4 years agoFix issues found by clang-tidy 7
Paul Bauer [Mon, 8 Jul 2019 08:57:39 +0000 (10:57 +0200)]
Fix issues found by clang-tidy 7

Same issues as found for the master branch after switching the build
to run on a different machine.

Change-Id: Icf7589eae5ebc77d7974181e4faeea9e9fe8b9d7

4 years agoFix hwloc and sphinx detection
Mark Abraham [Sat, 6 Jul 2019 19:06:33 +0000 (21:06 +0200)]
Fix hwloc and sphinx detection

These were too noisy and were not implemented efficiently (e.g. not
caching the result of execute process). If an environment change is
needed to detect something (like loading a module) then we expect
developers to be able to unset a cache variable (or just regenerate a
new cache).

Refs #3024, #3011, #2998

Change-Id: I84dfb03856b9f900fb21004bc676e4ff2647a4b4

4 years agoTest specific hwloc versions
Mark Abraham [Tue, 2 Jul 2019 22:12:28 +0000 (00:12 +0200)]
Test specific hwloc versions

Now that releng understands the installed hwloc versions, we can
specify those in the matrix configurations. We can also specify that a
test configuration requires hwloc, but don't have to specify the
version. And we can leave it auto and provide a specific version of
the library to get detected automatically.

Refs #2899

Change-Id: I7f72b79746e77d04d9e2657b75821a8e3d62d83b

4 years agoChange error message when attempting to offload to nonexistent GPUs
Kevin Boyd [Thu, 4 Jul 2019 22:17:27 +0000 (18:17 -0400)]
Change error message when attempting to offload to nonexistent GPUs

A user could interpret the error as no interactions detected rather
than no GPUs

Change-Id: Iedcc4555313edbb84a504bf01afc99c15eb4fdcb

4 years agoChange affinity enum to enum class
Berk Hess [Mon, 24 Jun 2019 20:03:55 +0000 (22:03 +0200)]
Change affinity enum to enum class

Change-Id: I6accea15d82d2e2e911ce1e6f0735b7859b25021

4 years agoRemove PImpl scaffolding from CUDA version of LINCS
Artem Zhmurov [Fri, 17 May 2019 14:08:24 +0000 (16:08 +0200)]
Remove PImpl scaffolding from CUDA version of LINCS

The CUDA implementation of LINCS was initially introduced as a
stand-alone feature. This required hiding CUDA-specific variables
and subroutines into the private implementation subclass. Since the
LINCS is not a part of Update and Constraints module, this is no
longer required and can be removed.

Refs #2816, #2888

Change-Id: I9698224d4702dfb8d99106999335c62e83a511df

4 years agoImprove tests of index block construction
Mark Abraham [Wed, 29 May 2019 13:37:21 +0000 (15:37 +0200)]
Improve tests of index block construction

Only trivial topologies were tested, and bugs have been
identified. Some test code is commented out until the fix lands.

Added missing Doxygen

Improved some assertions hit while investigating the issue.

Refs #2951

Change-Id: Ia03e38aca42be43efa1fd548c32e522d97e13e94

4 years agoModernize FindHwloc.cmake
Mark Abraham [Wed, 3 Jul 2019 10:53:16 +0000 (12:53 +0200)]
Modernize FindHwloc.cmake

Users (and Jenkins) need the ability to direct finding a particular
hwloc version, e.g. from a module. This is particularly important now
that two API versions exist and are supported in GROMACS. Imported the
find module from Inria, which adds several useful capababilities,
including the ability to specify where to look for a specific version
of this library.

Removed the pkgconfig support from the imported FindHwloc.cmake
because it seems the hwloc.pc file from libhwloc does not lead to the
CMake idiomatic behaviour of HWLOC_LIBRARIES being the full path to
the library.

Refs #2539, #3011

Change-Id: I6837144a556f1c61a0f13406fb31fe1d527b65f4

4 years agoPython bindings for mdrun.
M. Eric Irrgang [Thu, 23 May 2019 21:44:00 +0000 (16:44 -0500)]
Python bindings for mdrun.

This change makes a near-exact copy of the mdrun Python
bindings from gmxapi 0.0.7.
Reference https://github.com/kassonlab/gmxapi/releases/tag/v0.0.7.3

This establishes a base from which to transition Python bindings
development from GitHub to the GROMACS repository, so Python wrappers,
interface updates, and other changes are deferred to separate commits.

The provided interface largely opaque except for arguments passed the
same way as mdrun command line flags.

GROMACS must be built with GMXAPI=ON.

Fixes #2912

Change-Id: I2f51ae8f2369334d06a7ceaa8a4abf3ed9fc444a

4 years agoFurther clang-tidy-7 fix
Mark Abraham [Thu, 4 Jul 2019 08:58:38 +0000 (10:58 +0200)]
Further clang-tidy-7 fix

Change-Id: Ic2915148e6822f10fec6288f29aee55cddacf0f7

4 years agoBump latest CUDA + gcc in the pre-submit matrix
Szilárd Páll [Wed, 3 Jul 2019 12:33:24 +0000 (14:33 +0200)]
Bump latest CUDA + gcc in the pre-submit matrix

CUDA 10.1 and gcc 8 is the latest combination supported.

Change-Id: I4c7a5cc7817de1120e1d4d60783f00db70fb6e70

4 years agoFix a -Wformat-truncation warning in tng
Szilárd Páll [Thu, 4 Jul 2019 10:01:19 +0000 (12:01 +0200)]
Fix a -Wformat-truncation warning in tng

Change-Id: Ib0cc008ad50957dededc857adf6bf921f98118b5

4 years agoUse reallocateDeviceBuffer(...) in CUDA version of SETTLE
Artem Zhmurov [Thu, 27 Jun 2019 11:35:07 +0000 (13:35 +0200)]
Use reallocateDeviceBuffer(...) in CUDA version of SETTLE

Refs #2886 and #2888

Change-Id: Ia45254a24eda8e6ad151b1f4c6583b1a2c926004

4 years agoFix clang-tidy-7 issues
Mark Abraham [Tue, 2 Jul 2019 21:24:18 +0000 (23:24 +0200)]
Fix clang-tidy-7 issues

These are detected on the mac build agent, but weren't on a Linux one,
e.g. because there is a system xdr library found on Linux.

Refs #2899

Change-Id: I591fda21c718b3a76f1fe17962150421f85fce22

4 years agoVectorize GPU bonded data.
Magnus Lundborg [Wed, 19 Jun 2019 11:28:42 +0000 (13:28 +0200)]
Vectorize GPU bonded data.

Loads data for bonds, angles, UB angles and pairs in blocks
of 3, 4, 4 and 3 ints respectively.

Refs: #2983

Change-Id: I37605395bd0c375b2eb4b94e76f9b30f6cb15e8d

4 years agoEarly exit for CUDA versions of SETTLE and LINCS
Artem Zhmurov [Fri, 28 Jun 2019 14:52:17 +0000 (16:52 +0200)]
Early exit for CUDA versions of SETTLE and LINCS

Change-Id: Ia3c56a1be6b8ceaa8e1b7be956c1f1f3628c9139

4 years agoMemory management fixes in CUDA version of LINCS
Artem Zhmurov [Thu, 27 Jun 2019 10:04:23 +0000 (12:04 +0200)]
Memory management fixes in CUDA version of LINCS

This fix is to prepare LINCS to run with DD.

1. The masses array size depends on the current number of atoms
   rather than on the number of constraints.
2. The size of other arrays should be based on the number of
   threads launched on the GPU, which include padding added to
   align coupled constraints with the thread blocks. Also
   renamed variable according to conventions.

Refs #2885 and #2888

Change-Id: I20cb53ebc6da6a1ff2ee1e385613b27c4a01d11f

4 years agoReorder options
Mark Abraham [Tue, 2 Jul 2019 21:39:11 +0000 (23:39 +0200)]
Reorder options

If these are in alphabetical order, inserting new ones is less likely
to clash than if we always insert at the end of the list.

Change-Id: I3262959dc02deeaa628874028b10b9948f177842

4 years agoCombine CUDA Leap-Frog, LINCS and SETTLE. II.
Artem Zhmurov [Fri, 22 Mar 2019 15:47:54 +0000 (16:47 +0100)]
Combine CUDA Leap-Frog, LINCS and SETTLE. II.

Stand-alone CUDA implementations of Leap-Frog, LINCS
and SETTLE required additional scaffolding for integration
and testing. The most prominent part of this is the
management of coordinates, velocities and forces, which
is removed in this commit. Management of periodic boundary
conditions and virial reduction will be removed in
following commits.

Refs #2816, #2888

Change-Id: I4c65a6c7088fd8059f4e7fa3cb4637cb2af79ebc

4 years agoUpdates to math/vec.h
Kevin Boyd [Tue, 2 Jul 2019 02:45:11 +0000 (22:45 -0400)]
Updates to math/vec.h

Removed unused functions

Added some file-level documentation indicating that the file
is deprecated and will be replaced in future

Change-Id: I2d6045884a4e14fa4278ef7a0606ccfbe2db7b63

4 years agoMove more tools out of gmxana
Kevin Boyd [Fri, 18 Jan 2019 14:11:47 +0000 (09:11 -0500)]
Move more tools out of gmxana

Moved some files to simulationdatabase and updated references to them

refs #2727

Change-Id: Idf8375b672fbb6e4676fa22b9eb9c33d1b347166

4 years agoClarify wording of release notes
Mark Abraham [Tue, 2 Jul 2019 13:19:54 +0000 (15:19 +0200)]
Clarify wording of release notes

A query on gmx-users indicated that the previous wording was confusing
- someone thought it might have meant normal nonbonded interactions
didn't work.

Change-Id: I0481c42ae1667bb5841e9541551dd98f5650c3ae

4 years agoPython detection consolidation.
M. Eric Irrgang [Thu, 16 May 2019 11:51:24 +0000 (14:51 +0300)]
Python detection consolidation.

* Move Python discovery up one level to the project root.
* Remove a TODO and clean up comments for validation test.
* Allow Sphinx discovery to appear in CMake output on first config.

Refs #2998

Change-Id: I16a406b2f21c517042729f3d970e0b5a79d40f33

4 years agoRearrange some definitions.
M. Eric Irrgang [Wed, 19 Jun 2019 17:43:37 +0000 (20:43 +0300)]
Rearrange some definitions.

Reduce diff noise in related changes.

Change-Id: Ia1e30507918a3d2ecea7cc6d63b60312576077e9

4 years agoRefactor thread affinity checking
Berk Hess [Mon, 24 Jun 2019 14:19:12 +0000 (16:19 +0200)]
Refactor thread affinity checking

Extracted the function detectDefaultAffinityMask() from
gmx_check_thread_affinity_set(). Now the affinity query check and
CPU count results are also reduced over MPI, so we avoid potential
deadlocks when results differ between ranks.

Change-Id: Ib382f47d63695357f8517b2657c3eb414e5afeef

4 years agoRe-enable affinity diagonostics with MPI
Berk Hess [Mon, 24 Jun 2019 13:57:50 +0000 (15:57 +0200)]
Re-enable affinity diagonostics with MPI

Without thread-MPI, printing diagnostics of detected external
affinity settings when requesting affinities through GROMACS
got lost during refactoring. Now this is enabled again, which
also unifies code paths with and without thread-MPI.

Change-Id: I7a7e43ac4dc45713bda72d62b877d0c7108f1df7

4 years agoAdd mdspan basic elementwise math
Kevin Boyd [Tue, 18 Jun 2019 01:27:30 +0000 (21:27 -0400)]
Add mdspan basic elementwise math

BasicMatrix3x3 provides a replacement for the c-style tensors, but
has yet to replicate the tensor operations in math/vec.h. This provides
a subset of that functionality for msdpan in general, which can be used
for MultiDimArray trivially

Refs #2976

Change-Id: I17b77df032dbbfde0ff87108215edcec07fef6c4

4 years agoUpdate gmxapi test fixtures.
M. Eric Irrgang [Wed, 26 Jun 2019 13:55:16 +0000 (16:55 +0300)]
Update gmxapi test fixtures.

* Rename spc216 to spc_water_box to be more clear and correct. Actual
  solvent number depends on the results of 'solvate'.
* Improve error messaging (fix typo).
* Fix error in mdp parameter writing (surprised this didn't cause an
  error previously...)
* Make spc_water_box fixture and other facilities from unit tests
  available to integration tests.
* Use 2 instead of 1000 nsteps in test fixture TPR

Change-Id: I62eadeb5133d88ee11082755b1c33ae047d8f4dd

4 years agoFix bug in gmx xpm2ps
Paul Bauer [Mon, 1 Jul 2019 09:17:04 +0000 (11:17 +0200)]
Fix bug in gmx xpm2ps

When not providing the name for a library input file the program would
try to create a null string and fail with an assertion failure.

Fixes #3012

Change-Id: Ifd69af5420cdac2f624246aee09f36219b3f6aeb

4 years agoAdd function for calculating 3x3 matrix determinant
Kevin Boyd [Fri, 21 Jun 2019 01:25:42 +0000 (21:25 -0400)]
Add function for calculating 3x3 matrix determinant

C++ matrix compatible version of the det() function in math/vec.h

Change-Id: Iaa2749dc8059fb6c3c112c4798f8e8cc8eae993c

4 years agoRemove references to ecutsGROUP
Kevin Boyd [Thu, 17 Jan 2019 03:54:11 +0000 (22:54 -0500)]
Remove references to ecutsGROUP

Changed warning that group scheme was deprecated to fatal error that
group scheme no longer exists

Modified warning when no cutoff scheme is specified

Change-Id: If971f88003af46c9ccedb98bb2d33987848509ed

4 years agoFix module detection for physical validation
Pascal Merz [Mon, 24 Jun 2019 22:37:35 +0000 (16:37 -0600)]
Fix module detection for physical validation

In I2edbe213, an implicit include() command was deleted, leading to
the module detection for physical validation not working anymore.
This change fixes the problem.

Refs #2615

Change-Id: If865227c2050f5739cd855261f6229f902fa0346

4 years agoRefactor tracking of GPU short-range work/skipping
Szilárd Páll [Thu, 27 Jun 2019 17:53:08 +0000 (19:53 +0200)]
Refactor tracking of GPU short-range work/skipping

This change introduces a set of flags that, for each interaction
locality, whether there are short-range interactions computed and
exposes a query in the nonbonded module's API.
This allows consistent checks for both when work has been done
and whether results need to be reduced.

Refs #2986

Change-Id: I15020d83f73a132d9b8e93d7339529176396089a