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

4 years agoBug fix and simplification for CUDA X Buffer Ops
Alan Gray [Wed, 12 Jun 2019 15:03:27 +0000 (08:03 -0700)]
Bug fix and simplification for CUDA X Buffer Ops

Fixes bug when there are more than two grids (ie they don't naively
map to local/nonlocal), by using a separate GPU memory space for
cxy_na and cxy_ind data for each grid (it previously only had one
local and one nonlocal space with overwriting). Also simpifies by now
only calling init fn once per NS step to set up data for all grids
(previously called for both local and nonlocal).

Change-Id: Ia2b97d22324aa97dca34b05da2eca2e2090372af

4 years agoFix MPI deadlock in affinity setting
Berk Hess [Mon, 24 Jun 2019 09:50:35 +0000 (11:50 +0200)]
Fix MPI deadlock in affinity setting

Commit 96d28d6b introduced the possiblity for deadlocks when
the affinity masks changed over time.

Fixes #2989

Change-Id: I454b38deb9ff11c90cdf4a19aaa80e79e8898df5

4 years agoTemplate free-energy kernel on differing coul/vdw soft-core
Berk Hess [Wed, 19 Jun 2019 10:44:51 +0000 (12:44 +0200)]
Template free-energy kernel on differing coul/vdw soft-core

The power function used for the soft-core potential is expensive.
When using the same lambda and alpha parameters for Coulomb and VdW,
we can skip one power core, giving a 10% performance improvement.

Change-Id: I8733838c6c32ef2b6fee5a6fb97657679f9bd3b3

4 years agogmxapi Python package documentation infrastructure.
M. Eric Irrgang [Sat, 29 Jun 2019 06:08:43 +0000 (09:08 +0300)]
gmxapi Python package documentation infrastructure.

* Begin a documentation tree in python_packaging/documentation.
* Create a docker image for quick rebuild and review of Sphinx docs.

Refs #2698

Change-Id: Ib05e0309e60bfdadf52dadc7af0942c25c89f1e4

4 years agoCreate dedicated subcounter for nonbonded FEP
Szilárd Páll [Thu, 27 Jun 2019 15:26:50 +0000 (17:26 +0200)]
Create dedicated subcounter for nonbonded FEP

Now all nonbonded work has their own separate subcoutners which allows
measuring the performance of each task separately.

Refs #2997

Change-Id: I601445364592923d08087a858da4629b0b58ae76

4 years agoRemove group scheme checks from runner
Kevin Boyd [Sat, 12 Jan 2019 14:47:54 +0000 (09:47 -0500)]
Remove group scheme checks from runner

refs #1852

Change-Id: I906ffc7c063694fbbd17128ee0d1e62259040306

4 years agoCleaning up the GPU bonded kernel
Magnus Lundborg [Tue, 18 Jun 2019 12:22:10 +0000 (14:22 +0200)]
Cleaning up the GPU bonded kernel

Improved variable names
Removed unnecessary includes

Refs #2988

Change-Id: Ife5f50e68f27994203305e376f2781a076052b64

4 years agoSeparate CPU NB kernel and buffer clearing subcounters
Szilárd Páll [Mon, 13 Nov 2017 22:54:21 +0000 (23:54 +0100)]
Separate CPU NB kernel and buffer clearing subcounters

This is aimed to allow comparing the performance of the pair-interaction
kernels separately from the force buffer clearing.

Change-Id: Ifb2b4b3e5a43ac2ee547da651f9432a22fe58421

4 years agoAdd copy and move operations to density similarity
Christian Blau [Wed, 19 Jun 2019 11:35:18 +0000 (13:35 +0200)]
Add copy and move operations to density similarity

Enable copying and moving for DensitySimilarityMeasure.

Change-Id: Ie4250f67ae42b5cea227b7c17b0a932b04a42a63

4 years agoFused GPU bonded kernels
Magnus Lundborg [Thu, 23 May 2019 14:39:50 +0000 (16:39 +0200)]
Fused GPU bonded kernels

To reduce the GPU kernel launch times the
GPU bonded kernels have been fused to a single kernel.

Refs #2818

Change-Id: I2299e1857df5db469739e3aefbc0f771968a6bd5

4 years agoAdd class to look up density fitting amplitudes
Christian Blau [Fri, 31 May 2019 06:30:39 +0000 (08:30 +0200)]
Add class to look up density fitting amplitudes

Adds a look-up for the weight used for spreading atoms on a grid and
calculate forces on them.

refs #2282

Change-Id: Iadd26f04265aa85ad30a827c92f2c5d5fc48ef85

4 years agoRemove already resolved post-submit matrix TODO
Szilárd Páll [Thu, 27 Jun 2019 12:35:53 +0000 (14:35 +0200)]
Remove already resolved post-submit matrix TODO

Change-Id: I4b4f8c81376ac36c141e27fd6a3301f550968d1a

4 years agoUse random water removal in gmx solvate
Kevin Boyd [Thu, 27 Jun 2019 01:57:48 +0000 (21:57 -0400)]
Use random water removal in gmx solvate

Given a number of solvent molecules to remove, gmx solvate
previously used a striding selection. This patch addresses a
TODO to use random selection

Change-Id: Icb065d61349a55b816337fa49470050eac194aa9

4 years agoAdd helpful note about gmxpai docker notebook server.
M. Eric Irrgang [Mon, 24 Jun 2019 10:11:15 +0000 (13:11 +0300)]
Add helpful note about gmxpai docker notebook server.

Per Joe's comment on https://gerrit.gromacs.org/c/gromacs/+/11502, it
was not clear where the notebook files live or how they may / may not
change. An extra snippet in the README.md may be helpful.

Change-Id: Ifd7b68ebf58fb3f2c3bed50f3267980358ffc047

4 years agoRemove tabulation from free-energy kernel
Berk Hess [Wed, 26 Jun 2019 15:44:21 +0000 (17:44 +0200)]
Remove tabulation from free-energy kernel

The recent group scheme removal cleanup forgot to remove the cubic
spline tabulated Coulomb and VdW interaction. This is done now.
Also removed the switches in the inner loops, as now there are only
two types of Coulomb and LJ interaction functional forms left.

Change-Id: Ia4aa8917077a3e48c7f1f055f171698a4fede8d0

4 years agoOnly use AVX512 in own-FFTW if GROMACS also uses it
Szilárd Páll [Thu, 20 Jun 2019 17:18:23 +0000 (19:18 +0200)]
Only use AVX512 in own-FFTW if GROMACS also uses it

Building the own FFTW with AVX512 enabled for all AVX-flavors means that
an AVX2 build can end up loosing a significant amount of performance due
to clock throttle if the FFTW auto-tuner inadvertently picks and AVX512
kernel. This is not unlikely as measurements at startup are very noisy
and often lead to inconsistent kernel choice (observed in practice).

Change-Id: I857326a13a7c4dd1a6f5ab44360211301b05d3ac

4 years agoMake global topology constant in trajectory writing
Pascal Merz [Wed, 12 Jun 2019 17:22:12 +0000 (11:22 -0600)]
Make global topology constant in trajectory writing

Added a few trivial const qualifiers to make the global topology
const in the call to do_md_trajectory_writing(...).

Change-Id: Id9a501a37bafb4ac25ef6157429d6fb5cb1ff098

4 years agoAdd a docker layer with a jupyter notebook server.
M. Eric Irrgang [Wed, 12 Jun 2019 10:47:28 +0000 (13:47 +0300)]
Add a docker layer with a jupyter notebook server.

Provide a docker image based on the gmxapi/ci-mpich image that runs a
Jupyter notebook server for easier browsing of the gmxapi Python package
artifacts.

Change-Id: I245bccb0522bd7c1e4e7467e10e2e91f09976f25

4 years agoUse ISerializer for TPR file IO
Paul Bauer [Wed, 5 Jun 2019 13:18:34 +0000 (15:18 +0200)]
Use ISerializer for TPR file IO

Change all the function calls in do_tpx and friends to use the
ISerializer instead of the previous t_fileio pointer.
This is intended to prepare for the change where the datastructures
get populated from a byte buffer instead of reading them from disk one
by one.

Refs #2971

Change-Id: I9c2d51c4af0cad5a14da7026d58ecbe053e8efb7

4 years agoAdd coordinate scaling class and extend TranslateAndScale
Christian Blau [Fri, 31 May 2019 06:25:03 +0000 (08:25 +0200)]
Add coordinate scaling class and extend TranslateAndScale

 - Make TranslateAndScale copyable and movable.
 - Make coordinate transformation application const on the
TranslateAndScale object itself
 - Add a function that returns the scale operation only without translation.
 - Add a coordinate scaling class that also allows to inverse the scaling, ignoring zero input.

refs #2282

Change-Id: I73f9bd892f1f81692e05ac6b2fece2e7be9e8e69

4 years agoAllow non-uniform Gaussians
Christian Blau [Fri, 31 May 2019 06:19:52 +0000 (08:19 +0200)]
Allow non-uniform Gaussians

For three-dimensional Gaussian spreading, as well as density guided force
evaluation, allow spreading with different widths along x, y, and z-direction.

This required to account for the common, slightly non-uniform grid
spacing in input densities.

Added some simplifactions for the vector operations based on newly
implemented functions in for BasicVector in a previous patch.

refs #2282

Change-Id: I730897fe672d2444a04ea68fea83e2273b359b27

4 years agoRemove unnecessary #if GMX_MPI in pme code
Berk Hess [Wed, 19 Jun 2019 07:46:19 +0000 (09:46 +0200)]
Remove unnecessary #if GMX_MPI in pme code

Change-Id: I1c645c84b229258527d4c40edb055a706189c2bf

4 years agoTemplate free-energy kernel on soft-core
Berk Hess [Wed, 19 Jun 2019 09:33:05 +0000 (11:33 +0200)]
Template free-energy kernel on soft-core

Templated the free-energy kernel on the presence of soft-core
and the soft-core r-power.
Not doing the soft-core math when not using soft-core doubles
the speed of the free-energy kernel.
Templating for the soft-core power gives 15% performance improvement
with soft-core power 6.
Double precision r variables are only needed with r-power 48.

Change-Id: I5a37307b2a83304a40343a0708afce46f4bdcf75

4 years agoAdd BasicVector scaling, max, min and toIvec
Christian Blau [Wed, 19 Jun 2019 13:00:12 +0000 (15:00 +0200)]
Add BasicVector scaling, max, min and toIvec

Allows element-wise multiplication, maximum, minimum evaluation
as well as conversion to IVec.

Change-Id: I49ba61aff72b197dbe3a67a9516ae0924d28c786

4 years agoRefactor PME atom handling
Berk Hess [Wed, 15 May 2019 11:04:44 +0000 (13:04 +0200)]
Refactor PME atom handling

Converted pme_atomcomm_t to PmeAtomComm class.
The PME atom count on CPU without separate PME ranks is now set by
gmx_pme_reinit_atoms(), as for PME on GPU.
Made all coordinates in PME const and use arrayref where possible.

Change-Id: Iaeb59f8cee910e4c52f2f59016af85662b2109fb

4 years agoSplit tpr header reading reading from tpr body
Paul Bauer [Tue, 11 Jun 2019 09:20:28 +0000 (11:20 +0200)]
Split tpr header reading reading from tpr body

Split the low level functions for TPR file header and file body reading
into fully separate parts to allow reading the main part of the file
without having to read the header again.

Also gave the header datastructure a new name in line with naming
conventions and default initialized all fields.

Refs #2971

Change-Id: I110fb80cf19d9d2e59df1576e50c64806f532e00

4 years agoRemoved unused code paths in the NB FE kernel
Berk Hess [Wed, 19 Jun 2019 08:29:55 +0000 (10:29 +0200)]
Removed unused code paths in the NB FE kernel

Code paths that were only used with the group scheme were removed.

Change-Id: I27175abfad5da9948f0626af90d16e7801eaf19d

4 years agoUpdates to gmxapi docker entry points.
M. Eric Irrgang [Tue, 2 Apr 2019 16:41:50 +0000 (19:41 +0300)]
Updates to gmxapi docker entry points.

* Read GMXRC in gmxapi docker test environment. Allows `gmx` binary to
  be easily discovered by Python wrappers. Supports expected behavior
  for gmxapi/ci-... docker containers and ensures that GROMACS
  components available during image build are available when running.
* Allow more granular testing. Rename and reorganize entry points for
  the docker test containers.

Ref: #2756

Change-Id: I5e781fae4709e4ccb718a8295c3fbe68dd59de44

4 years agoFix gmx dump
Paul Bauer [Wed, 12 Jun 2019 09:39:33 +0000 (11:39 +0200)]
Fix gmx dump

The program would fail because the filename for writing the output mdp
file was passed as valid empty string that could not be opened as an
output file.

Now only passes the string when it is not empty.

Added test and fixed possible floating point exception found by the
test.

Change-Id: I8b18fbc0dfc5642399935f32fb0b1999fad44c98

4 years agoMove code handling mdrun -gpu_id to taskassignment module
Mark Abraham [Mon, 20 May 2019 08:28:28 +0000 (10:28 +0200)]
Move code handling mdrun -gpu_id to taskassignment module

Also made the error message report all incompatible GPU IDs, not just
the first, and do so by throwing an exception.

Change-Id: I4e1f26a59903077b5ab6cc671486fb059cb78964

4 years agoMake forcerec const in dispatchNonbondedKernel()
Berk Hess [Tue, 18 Jun 2019 08:28:19 +0000 (10:28 +0200)]
Make forcerec const in dispatchNonbondedKernel()

Changed forcrecin Nbnxm::dispatchNonbondedKernel() from a pointer
to a const reference. The GPU emulation kernel now writes the shift
forces to nbnxn_atomdata_t.

Change-Id: I170165529ba447db9b5d1824eea10675ae1bef7d

4 years agoMrc format header to lattice coordinate transform
Christian Blau [Fri, 3 May 2019 10:21:32 +0000 (12:21 +0200)]
Mrc format header to lattice coordinate transform

Extracts a coordinate transformation into lattice coordinates from the mrc density
header, as well as the three dimensional grid extents.

refs #2282

Change-Id: I8c01a370e3010add29b8810e2f3320b9ab428c02

4 years agoDensity similarity measure and gradient
Christian Blau [Wed, 17 Apr 2019 11:43:52 +0000 (13:43 +0200)]
Density similarity measure and gradient

Adding a class that allows evaluating the similarity of three dimensional
densities and their gradient given a comparison method, along with a
concrete implementation of the inner-product as a comparison method.

refs #2282

Change-Id: Id73f237e123bed14241227b84cbf83970a09ff49

4 years agoExtend ISerializer functionality
Paul Bauer [Mon, 10 Jun 2019 07:54:06 +0000 (09:54 +0200)]
Extend ISerializer functionality

Add datatypes to ISerializer that are needed to read TPR files but were
missing.

Refs #2971

Change-Id: I5d5e7f1f91c533a079cb287b018fa1d579c4f3f9

4 years agoCombine CUDA Leap-Frog, LINCS and SETTLE. I.
Artem Zhmurov [Mon, 18 Mar 2019 18:03:59 +0000 (19:03 +0100)]
Combine CUDA Leap-Frog, LINCS and SETTLE. I.

This is the first step in combining constraints and integrator
into "UpdateAndConstraints" module. The initial merge does not
imply any performance optimisation or code clean-up. Hence, this
patch keeps all the temporary infrastructure that was built
around SETTLE, LINCS and Leap-Frog to allow them to function as
a separate units. In the following commits, this infrastructure
will be removed and these three implementations will be more closely
integrated. To enable, set GMX_UPDATE_CONSTRAIN_GPU environment
variable. Note, that environment variables GMX_LINCS_GPU,
GMX_SETTLE_GPU and GMX_INTEGRATE_GPU will no longer work.

Refs #2816, #2888

Change-Id: I8730aad0ecaa0230686fe89d1157b0da2f01f7bc

4 years agoReduce docker image size for gmxapi CI.
M. Eric Irrgang [Wed, 12 Jun 2019 10:40:07 +0000 (13:40 +0300)]
Reduce docker image size for gmxapi CI.

Use ``--no-cache-dir`` option to ``pip install``.

Change-Id: I4c1794cc020096c3cee377ff2d79c6c599542bc1

4 years agoBug fix: Constraints tests are not instantiated with CUDA
Artem Zhmurov [Thu, 16 May 2019 08:06:06 +0000 (10:06 +0200)]
Bug fix: Constraints tests are not instantiated with CUDA

If the tests initialization macros is called with ValuesIn
function, the container provided should be filled. In the
current version, it is filled in the test SetUp function,
after the macros is processed. As a result, the empty
container is used in instantiation and no test are run.
Only CUDA-enabled builds are affected.

Change-Id: Ia2f38c9908d4b7d4277d282c01781b278eeeead0

4 years agoSimplify GPU nbnxm x conversion
Berk Hess [Fri, 7 Jun 2019 07:37:25 +0000 (09:37 +0200)]
Simplify GPU nbnxm x conversion

The GPU nbnxm x conversion change 42b343b9 lead to data being transferred
multiple times and introduced several ugly hacks. This change simplifies
the code and transfers each coordinate only once.

Change-Id: I430496251ae40ee4c604e3920b789b3ae2b297dd

4 years agoRemove unused nbnxm include files
Berk Hess [Mon, 17 Jun 2019 07:54:26 +0000 (09:54 +0200)]
Remove unused nbnxm include files

Change-Id: I04ca522139dfa7f1b809a2db9dd494ed9f0f0b23

4 years agoFix pygments detection for sphinx for docs build
Mark Abraham [Wed, 12 Jun 2019 15:39:08 +0000 (17:39 +0200)]
Fix pygments detection for sphinx for docs build

Got broken in 29616660 but somehow wasn't a problem in the docs build
on the dedicated slave for that.

Refs #2615

Change-Id: I407383bd0342decae56e4c60202ffbf190e8bb1b

4 years agoUse RAII approaches for hardware information detection
Mark Abraham [Tue, 21 May 2019 20:59:26 +0000 (22:59 +0200)]
Use RAII approaches for hardware information detection

Eliminated gmx_hardware_info_free. The lifetime of the hardware info
should be from the first time it is needed until the end of the
process, and in particular its ownership should not be related to the
lifetime of any threads implementing mdrun.

The implementation of gmx_detect_hardware now uses a simple mutex and
file static smart pointer to hold the data, lazily create it, and leave
it to process cleanup to call the destructor to free resources. Helper
functions no longer refer to the static smart pointer directly.

Internal data structures of gmx_hw_info_t are now held by smart pointer rather
than needing manual memory cleanup.

Extended not_null to be able to be created from smart pointers, and
tested the new behaviours.

Reduced the header dependencies of detecthardware.cpp, now that it
doesn't do all the string handling of printhardware.cpp

Change-Id: I9d5cd838dc6e214163cf2e3104e0f7aaa356fcf8

4 years agoClean up multisim, communication, and REMD code
Mark Abraham [Sun, 26 May 2019 22:00:46 +0000 (00:00 +0200)]
Clean up multisim, communication, and REMD code

Moved multisim declarations and code to one place.

Moved mpi_in_place_buf_t to its own files in a low-level module, and
made sure we tested a build that needed it. Removed duplicate tng
option declaration while I was there.

Moved a check for REMD to its code, removed another that was redundant
with that for multisim requiring more than one simulation.

Added some t_commrec and gmx_multisim_t cleanup code, but not all
of it can work before some more cleanup takes place.

Change-Id: Ie591f50a2162dce2e83552102f8633c8d49553a7

4 years agoMore quotes
Erik Lindahl [Sun, 9 Jun 2019 11:51:36 +0000 (13:51 +0200)]
More quotes

Having to prepare slides for a Gromacs workshop is
a great motivation for procrastination in the form
of adding more quotes :-)

Change-Id: Ieed151881f5eecdc552726f8d95541a2ab9b5eb7

5 years agoTemplate x buffer ops call on whether GPU is used
Szilárd Páll [Mon, 29 Apr 2019 10:02:32 +0000 (12:02 +0200)]
Template x buffer ops call on whether GPU is used

This allows the code to get optimized to avoid the overhead of merged
CPU and GPU codepaths.

Change-Id: If98c5eff327f5f9ecb81f278ca27b6d139bc19ab

5 years agoClean up renamed simulator.h file
Pascal Merz [Mon, 27 May 2019 04:42:47 +0000 (22:42 -0600)]
Clean up renamed simulator.h file

This change is a follow-up to I9bc31588, in which the Integrator class
was renamed to Simulator, and integrator.{h,cpp} was accordingly
renamed to simulator.{h,cpp}. The former change did, however, miss
the include guard, a typedef, and two mentions of "integrator" in
comments. The current change addresses this.

Change-Id: I14d55eeb35c18f198d4123a7132fbee2366713df

5 years agoRemove dependence of mdoutf_write_to_trajectory_files on global top
Pascal Merz [Sat, 25 May 2019 06:02:52 +0000 (00:02 -0600)]
Remove dependence of mdoutf_write_to_trajectory_files on global top

mdoutf_write_to_trajectory_files is currently taking the full global
topology object as input, but uses only the number of atoms. Removing
this dependency simplifies some refactoring further down the road,
as the new state element can use this function without needing
access to the global topology.

Change-Id: I3ad39050bfd5d7bb0792f3b158bad0817907e029

5 years agoRename Integrator class
Pascal Merz [Sat, 25 May 2019 05:44:47 +0000 (23:44 -0600)]
Rename Integrator class

This renames the `Integrator` class to `Simulator`, which does not
actually represent integrators, but rather types of simulations
(some of which contain an integrator, but not all!).

Refs #2943

Leaves the TODO to rename the corresponding mdp-option, but no
consensus on the new name has been reached yet.

Change-Id: I9bc3158856cd68dfc2ca5f3da793cd1ecbc2ffaf