alexxy/gromacs.git
3 years agoAllow deployment of nightly webpage to server
Paul Bauer [Thu, 24 Sep 2020 14:46:18 +0000 (14:46 +0000)]
Allow deployment of nightly webpage to server

Still needs to have variables defined on Gitlab.

Change-Id: Id7378942555b69df19cbe377d7c90851d6cf56ba

3 years agoImprove OpenCL log/error reporting
Szilárd Páll [Thu, 24 Sep 2020 12:44:09 +0000 (12:44 +0000)]
Improve OpenCL log/error reporting

Improve reporting by making messages more specific; also added logging of binary caching also for the case where a cache files is found in addition to the case where no cache file is present

3 years agoFix false-positives in checkDeviceBuffer for OpenCL
Andrey Alekseenko [Wed, 23 Sep 2020 16:34:29 +0000 (18:34 +0200)]
Fix false-positives in checkDeviceBuffer for OpenCL

The function takes required number of elements as its argument, but then
compares it with the buffer size measured in bytes.

3 years agoReport name of missing OpenCL kernels
Mark Abraham [Wed, 23 Sep 2020 15:26:35 +0000 (17:26 +0200)]
Report name of missing OpenCL kernels

Refs #3686

3 years agoAccess write checkpoint functionality directly
Pascal Merz [Wed, 23 Sep 2020 16:59:06 +0000 (16:59 +0000)]
Access write checkpoint functionality directly

3 years agoImplement Berendsen thermostat for modular simulator
Pascal Merz [Tue, 8 Sep 2020 03:03:50 +0000 (21:03 -0600)]
Implement Berendsen thermostat for modular simulator

Refs #3423

3 years agoPermit comparison of only first frames
Mark Abraham [Wed, 23 Sep 2020 14:56:57 +0000 (14:56 +0000)]
Permit comparison of only first frames

Integration tests of mdrun sometimes want to compare only the
quantities from the first frame of a trajectory.  This is now
permitted.

3 years agoAdd regression tests for gpucomm paths
Alan Gray [Wed, 23 Sep 2020 07:02:47 +0000 (07:02 +0000)]
Add regression tests for gpucomm paths

Adds regression test runs with GPU communication codepaths enabled for
both thread-MPI and MPI builds.

3 years agoSplit mdrun-test
Mark Abraham [Tue, 22 Sep 2020 13:18:17 +0000 (13:18 +0000)]
Split mdrun-test

The PME tests are the most time-consuming part, so have been split off.

3 years agoDraft: Fix compilation
Andrey Alekseenko [Tue, 22 Sep 2020 12:50:41 +0000 (12:50 +0000)]
Draft: Fix compilation

Also, make ctor etc always defined for DeviceInformation. Otherwise it's
just ugly.

3 years agoMake Oneapi use CCache again
Paul Bauer [Tue, 22 Sep 2020 10:04:35 +0000 (10:04 +0000)]
Make Oneapi use CCache again

The custom before_script meant that builds are not using the cache.

Change-Id: Iaf0546e2dd48cf2a6438c2aa0d6461977ee6b2dd

3 years agoNelder-Mead downhill simplex optimisation
Christian Blau [Tue, 22 Sep 2020 07:30:09 +0000 (07:30 +0000)]
Nelder-Mead downhill simplex optimisation

Nelder-Mead simplex optimiser, according to Saša Singer and
John Nelder (2009), Scholarpedia, 4(7):2928. doi:10.4249/scholarpedia.2928

Implementation for functions returning real values from
vectors of reals.

3 years agoCheckpointdata DD followup
Pascal Merz [Mon, 21 Sep 2020 16:34:37 +0000 (16:34 +0000)]
Checkpointdata DD followup

3 years agoWrong logic was used
Mark Abraham [Mon, 21 Sep 2020 14:21:14 +0000 (16:21 +0200)]
Wrong logic was used

Log files in gitlab gave the warning message for twin-cutoff, but we
are not setting these env variables.

3 years agosimd/impl_none: add missing macros
Gilles Gouaillardet [Mon, 21 Sep 2020 15:01:19 +0000 (15:01 +0000)]
simd/impl_none: add missing macros

add macros for GMX_SIMD_HAVE_HSIMD_UTIL_{FLOAT,DOUBLE}

3 years agoFix script building all CI containers and add gcovr
Paul Bauer [Mon, 21 Sep 2020 13:33:09 +0000 (13:33 +0000)]
Fix script building all CI containers and add gcovr

Additions in 48f9056c196fda338b83e74212d4f9bc5ab3474e broke the script
by changing the default values, while
e9cb08d17b06bc5649d316ee06159b633db9b3d8 inadvertently made all images
use the oneapi images as base.

Also add gcovr tool to documentation images, preparing for coverage
builds.

Change-Id: I0eb9a3bf1e8b45dd4b4a3a41fd214678c4c1c4c2

3 years agoAdd OpenSSH to docs build images
Paul Bauer [Mon, 21 Sep 2020 08:44:58 +0000 (10:44 +0200)]
Add OpenSSH to docs build images

Change-Id: I9b1994a78ef869f3147aa45b5893645ce74f5e04

3 years agoAWH avoid constructors only differing in parameter types
Magnus Lundborg [Mon, 21 Sep 2020 09:07:13 +0000 (09:07 +0000)]
AWH avoid constructors only differing in parameter types

Also clarified a function name in the tests.
Tests had to be updated since the force constant (now removed)
should not have been used before at all.

3 years agoDo not run PinnedMemoryCheckerTest when there are no CUDA-capable devices
Artem Zhmurov [Mon, 21 Sep 2020 08:26:52 +0000 (08:26 +0000)]
Do not run PinnedMemoryCheckerTest when there are no CUDA-capable devices

If there are no CUDA devices in the system, cudaPointerGetAttributes(...)
CUDA API call returns an error. This causes the GPU Utils tests to fail
with fatal error.

Fixes #3679

3 years agoMove the message to the deprEcation-policy file
Artem Zhmurov [Mon, 21 Sep 2020 07:59:07 +0000 (07:59 +0000)]
Move the message to the deprEcation-policy file

Also update the message according to the move

3 years agoAdd NVIDIA GPU compatibility check, following issue #3125
Andrey Alekseenko [Sun, 20 Sep 2020 09:39:41 +0000 (09:39 +0000)]
Add NVIDIA GPU compatibility check, following issue #3125

The incompatibility is documented, but better to verify.

3 years agoSet active device when the device stream manager is initialized
Artem Zhmurov [Sun, 20 Sep 2020 09:18:16 +0000 (09:18 +0000)]
Set active device when the device stream manager is initialized

Replace the direct CUDA API call in PME by the wrapper called
when the device context and streams are created.

3 years agoAllow using old environment variables, but print deprecation message
Artem Zhmurov [Sun, 20 Sep 2020 08:56:29 +0000 (08:56 +0000)]
Allow using old environment variables, but print deprecation message

The following environment variables were unified in
2c644d3b5ebb64f6c89a5db36160c9dc30329888:

GMX_CUDA_NB_ANA_EWALD and GMX_OCL_NB_ANA_EWALD into GMX_GPU_NB_ANA_EWALD
GMX_CUDA_NB_TAB_EWALD and GMX_OCL_NB_TAB_EWALD into GMX_GPU_NB_TAB_EWALD
GMX_CUDA_NB_EWALD_TWINCUT and GMX_OCL_NB_EWALD_TWINCUT into GMX_GPU_NB_EWALD_TWINCUT

This allows user to use old environment variables, but prints deprecation message.

3 years agoRefactor v-rescale thermostat to allow for other algorithms
Pascal Merz [Tue, 8 Sep 2020 02:40:22 +0000 (20:40 -0600)]
Refactor v-rescale thermostat to allow for other algorithms

This is pure refactoring, splitting the element class (interfaces with
the simulator and other objects) from the actual implementation of the
thermostat. This will allow to implement other thermostat algorithms
using the same infrastructure.

Refs #3423

3 years agoImprove naming and docs.
M. Eric Irrgang [Tue, 15 Sep 2020 19:18:22 +0000 (22:18 +0300)]
Improve naming and docs.

Follow up from https://gitlab.com/gromacs/gromacs/-/merge_requests/541

Fixes #3673

3 years agoRemove cutoff_scheme from t_forcerec and interaction_const_t
Berk Hess [Fri, 18 Sep 2020 09:01:21 +0000 (09:01 +0000)]
Remove cutoff_scheme from t_forcerec and interaction_const_t

3 years agoDocument a Mdrunner::BuilderImplementation member.
M. Eric Irrgang [Mon, 14 Sep 2020 16:15:04 +0000 (19:15 +0300)]
Document a Mdrunner::BuilderImplementation member.

Fixes #3665.

3 years agoMove bNonbonded flag from t_forcerec to SimulationWorkload
Berk Hess [Thu, 17 Sep 2020 12:13:57 +0000 (14:13 +0200)]
Move bNonbonded flag from t_forcerec to SimulationWorkload

The flag to store whether nonbonded calculations are requested to be
skipped (set by env.var.) is move from t_forcerec to
SimulationWorkload. A minor side-effect of this change is that the
nbnxn module logs kernels choices when this option is set.

3 years agoRename VRescaleThermostat to VelocityScalingTemperatureCoupling
Pascal Merz [Thu, 3 Sep 2020 03:56:11 +0000 (21:56 -0600)]
Rename VRescaleThermostat to VelocityScalingTemperatureCoupling

Also moves vrescalethermostat.h/cpp to
velocityscalingtemperaturecoupling.h/cpp.

This reflects upcoming changes making the thermostat more general.
As these changes touch a lot of lines in the implementation file,
renaming the file at the same time throws git diff off. Doing the
renaming in a separate commit should therefore make for easier reviewing.

Refs #3423

3 years agoRemove the CPU hardware context from the general list of test hardware contexts
Artem Zhmurov [Thu, 17 Sep 2020 12:49:10 +0000 (12:49 +0000)]
Remove the CPU hardware context from the general list of test hardware contexts

Having CPU code path in the general hardware context list leads to having
many if (CPU) clauses. This complicates things in places, where there are
several CPU runners. Since in most cases (i.e. everywhere apart from Ewald
tests) the runners know the hardware they should use, the selection of CPU
or GPU is now done when the runners are created. TestHardwareContext is
to become TestDeviceContext and will only hold GPU devices.

3 years agoRemove unnecessary condition in DD force buffer resizing
Berk Hess [Wed, 16 Sep 2020 13:33:12 +0000 (15:33 +0200)]
Remove unnecessary condition in DD force buffer resizing

Removed a condition that was no longer necessary, as exactly
the same condition is checked inside the resize() method of
ForceHelperBuffers.

3 years agoActivate AMD OpenCL build in release matrix
Mark Abraham [Wed, 16 Sep 2020 15:41:05 +0000 (15:41 +0000)]
Activate AMD OpenCL build in release matrix

This had never been turned on.

Fixed missing file for OpenCL installation.

Also reordered the install list in alphabetical order, per style.

Refs #3272

3 years agoReduce transitive dependencies in arrayref.h
Sebastian Keller [Tue, 15 Sep 2020 09:09:45 +0000 (11:09 +0200)]
Reduce transitive dependencies in arrayref.h

Reduce transitive dependencies on other GROMACS headers.
* Replace `GMX_ASSERT` with `assert`
* Replace `index` with `difference_type`

Refs #3674

3 years agoExtend user docs on affine transformations for densities
Christian Blau [Tue, 15 Sep 2020 14:55:31 +0000 (16:55 +0200)]
Extend user docs on affine transformations for densities

Add more extensive information to the reference manual and .mdp option description
in the user-guide.

Fix one documentation typo.

3 years agoImplement modular checkpointing
Pascal Merz [Wed, 16 Sep 2020 07:34:44 +0000 (07:34 +0000)]
Implement modular checkpointing

Using the CheckpointData format introduced in a parent commit, this
rewrites checkpointing for the modular simulator to completely use
the new format.

The CheckpointHelper is now passing a CheckpointData object to its
clients (instead of a legacy t_state object). Clients are now stored
in a map, as they are identified by their unique key to be able to
assign the correct CheckpointData sub-objects at reading and writing.

If checkpoint reading occured, the newly introduced
CheckpointHelperBuilder receives the CheckpointData object read at the
runner level from the ModularSimulator. It then initializes its clients
with their respective, read-only CheckpointData subobjects.

The ICheckpointHelperClient interface is adapted to reflect above
changes.

The ModularSimulatorAlgorithmBuilder is slightly simplified thanks to
to the introduction of a proper builder for the CheckpointHelper.

The ComputeGlobalsElement is simplified, as it is not required to know
about the needs of communication of the EnergyData object which
depends on checkpoint reading.

Finally, all elements which are checkpoint clients are updated to
implement the new design. Note that they all introduce their own
checkpoint versioning, as the data being checkpointed is opaque to the
checkpointing infrastructure.

Closes #3517
Closes #3422
In partial fulfillment of #3419

3 years agoUse common device context header for OpenCL
Artem Zhmurov [Tue, 15 Sep 2020 16:43:43 +0000 (16:43 +0000)]
Use common device context header for OpenCL

This moves the OpenCL specific definition into under macro in the main header.
Makes device stream and context definitions more consistent.

3 years agoBreak off some tests from mdrun tests
Paul Bauer [Tue, 15 Sep 2020 14:17:42 +0000 (14:17 +0000)]
Break off some tests from mdrun tests

Done to not hit the time limit in CI with OpenCL.

Change-Id: Ic2e2686530aef51475ab7f49c1bfd29442c3fc0a

3 years agoRemove outdated workaround.
M. Eric Irrgang [Fri, 11 Sep 2020 13:52:31 +0000 (16:52 +0300)]
Remove outdated workaround.

Remove a workaround left over from before issue #2689 was closed.

Refs #2689

3 years agoOnly extend Ewald table when necessary
Berk Hess [Tue, 15 Sep 2020 09:40:23 +0000 (11:40 +0200)]
Only extend Ewald table when necessary

The Ewald correction table for non-bonded interactions was always
extended by change 24595dbb. No this is limited to free-energy
runs only.

3 years agoEnable GMX_GPU=SYCL compiles
Erik Lindahl [Tue, 15 Sep 2020 12:38:19 +0000 (12:38 +0000)]
Enable GMX_GPU=SYCL compiles

Update CMake config to properly apply -fsycl, but only to files
including actual SYCL code, and get linking working.  Tested
with both dpcpp and icpx, and added trivial SYCL code to a
dimmy device context, just to ensure compiles and linking works
both with and without SYCL support enabled.

Also fixes a number of new warnings about unused variables now
detected with dpcpp and icpx.

3 years agoFix missing installed files for OpenCL PME
Paul Bauer [Tue, 15 Sep 2020 11:31:21 +0000 (13:31 +0200)]
Fix missing installed files for OpenCL PME

Change fa6862b510acd7b0225580b661446c278dbb0039 forgot to modify
the CMake files to install the renamed OpenCL header files.

Refs #3664

3 years agoAll coordinates in the density-guided-simulation group undergo an affine transformati...
Christian Blau [Tue, 15 Sep 2020 11:21:14 +0000 (11:21 +0000)]
All coordinates in the density-guided-simulation group undergo an affine transformation before density-fitting forces on them are evaluated, which allows rotation, transformation and scaling of coordinates.

Resolves part of #3581.

3 years agoFix task assignment with multiruns
Berk Hess [Tue, 15 Sep 2020 10:17:46 +0000 (10:17 +0000)]
Fix task assignment with multiruns

Change e0f481ae broke the physical node hardware detection and task
assignment by passing the simulation instead of the world communicator
to the creation of the physical node communicator. Now the world
communicator is stored and passed.

Fixes #3666

3 years agoFix minor warnings noticed by Intel compilers
Erik Lindahl [Tue, 15 Sep 2020 07:59:04 +0000 (09:59 +0200)]
Fix minor warnings noticed by Intel compilers

New things found by dpcpp & ipcx compilers.

3 years agoPass devFlags into createSimulationWorkload replacing bools
Alan Gray [Fri, 11 Sep 2020 11:51:58 +0000 (04:51 -0700)]
Pass devFlags into createSimulationWorkload replacing bools

3 years agoFix VSite out of range error message
Artem Zhmurov [Tue, 15 Sep 2020 05:46:44 +0000 (08:46 +0300)]
Fix VSite out of range error message

3 years agoCreate and use SimulationInput module.
M. Eric Irrgang [Mon, 14 Sep 2020 15:37:40 +0000 (15:37 +0000)]
Create and use SimulationInput module.

Allow Mdrunner to accept a handle to SimulationInput from the client.

This change adds an input method to the MdRunner builder to provide
access to resources provided through the new SimulationInput module.

Refs #3374

3 years agoUse common device context header for OpenCL
Artem Zhmurov [Mon, 14 Sep 2020 09:46:19 +0000 (09:46 +0000)]
Use common device context header for OpenCL

This moves the OpenCL specific definition into under macro in the main header.
Makes device stream and context definitions more consistent.

3 years agoRefine the CMakeLists.txt for MPI gmxapi tests.
M. Eric Irrgang [Fri, 11 Sep 2020 13:47:56 +0000 (16:47 +0300)]
Refine the CMakeLists.txt for MPI gmxapi tests.

Exclude tests when GMX_MPI is not set. Normalize test working directory.

3 years agoDecouple nsttcouple and nstpcouple from nstlist
Berk Hess [Sun, 13 Sep 2020 09:30:20 +0000 (09:30 +0000)]
Decouple nsttcouple and nstpcouple from nstlist

The default values of nsttcouple and nstpcouple of -1 would cause
nstlist to be used as the coupling interval. But coupling intervals
should not be linked to nstlist. The default is now set to 10, which
will not change settings for mdp files where nstlist was not specified
as the default nstlist value is also 10.

3 years agoFix GPU device info broadcast with MPI
Mark Abraham [Sat, 12 Sep 2020 11:42:42 +0000 (13:42 +0200)]
Fix GPU device info broadcast with MPI

3 years agoMove src/api cmake logic into src/api cmake file
ejjordan [Fri, 11 Sep 2020 12:34:27 +0000 (14:34 +0200)]
Move src/api cmake logic into src/api cmake file

3 years agoRemove leftover data after refactoring
Paul Bauer [Fri, 11 Sep 2020 06:26:02 +0000 (08:26 +0200)]
Remove leftover data after refactoring

The modular simulator still hat the old datastructure for initial
lambdas, causing a complaint in the CI.

Change-Id: Ic97ee36ebea8cd40d7c513f44f767751f5c271cc

3 years agoFix doxygen for unused parameters.
Paul Bauer [Fri, 11 Sep 2020 10:11:17 +0000 (10:11 +0000)]
Fix doxygen for unused parameters.

Recent addition to the code didn't use the parameters for the SYCL
stubs, leading to errors from doxygen.

Change-Id: I61666e4e76cfdcfa5c618c7bc6f58cf24ea2b4f8

3 years agoDefine stubs for GPU data structures in SYCL to make SYCL compilation possible
Artem Zhmurov [Fri, 11 Sep 2020 09:06:16 +0000 (09:06 +0000)]
Define stubs for GPU data structures in SYCL to make SYCL compilation possible

3 years agoForce use of Python3 in Doxygen CMakeFiles
Paul Bauer [Fri, 11 Sep 2020 07:58:35 +0000 (07:58 +0000)]
Force use of Python3 in Doxygen CMakeFiles

Change-Id: Ia7d430fef243d6b3236de903907dbf8e9ba92222

3 years agoSimplify and fix how lambda values are set
Christian Blau [Thu, 10 Sep 2020 19:04:49 +0000 (19:04 +0000)]
Simplify and fix how lambda values are set

Simplified setCurrentLambdasLocal method to return an array of
current lambda points. Removed the faulty use of lam0 as initial
lambdas.

3 years agoFix Visual Studio build
Roland Schulz [Thu, 10 Sep 2020 04:51:17 +0000 (21:51 -0700)]
Fix Visual Studio build

- Add /permissive- flag to disable MSVC extension. Fixes
  ternary operator.
- Fix usage of %l for size_t
- Disable non-wroking FFTW SIMD check
- Missing imports
- Compiler warning fix

3 years agoSimpify CheckpointData
Roland Schulz [Wed, 9 Sep 2020 20:06:04 +0000 (13:06 -0700)]
Simpify CheckpointData

3 years agoMinor fix to the printout for regtest builds
Paul Bauer [Thu, 10 Sep 2020 12:37:44 +0000 (14:37 +0200)]
Minor fix to the printout for regtest builds

Was not printing the branch it is building the archive from.

Change-Id: I597e68a3780d3f300b5a4be447ecac7834126408

3 years agoUse common device context header for OpenCL
Artem Zhmurov [Thu, 10 Sep 2020 13:49:23 +0000 (13:49 +0000)]
Use common device context header for OpenCL

This moves the OpenCL specific definition into under macro in the main header.
Makes device stream and context definitions more consistent.

3 years agoAdd angles to ListedForces selections
Berk Hess [Thu, 10 Sep 2020 11:37:55 +0000 (13:37 +0200)]
Add angles to ListedForces selections

3 years agoUse device information object instead of id when performing device checks
Artem Zhmurov [Thu, 10 Sep 2020 10:27:03 +0000 (10:27 +0000)]
Use device information object instead of id when performing device checks

Initializing plain object is dangerous, since it then can be used to set
active device, with default id. This change ensures that proper device
will be used, even if the high level device management is used in the
checks.

3 years agoFix memory corruption with strings in grompp
Berk Hess [Thu, 10 Sep 2020 09:00:52 +0000 (11:00 +0200)]
Fix memory corruption with strings in grompp

Using a string of more than 31 characters as a default value for
a string entry in the mdp file would lead to memory corruption.

3 years agoReplace GMX_ASSERT with assert in vectypes.h
Joe Jordan [Thu, 10 Sep 2020 06:42:13 +0000 (06:42 +0000)]
Replace GMX_ASSERT with assert in vectypes.h

It is inappropriate to have a wrapper around assert in a public API.
This change removes dependence on GMX_ASSERT in one component of the
installed API. Transient dependencies related to inclusion of
gmxassert.h in vectypes.h are also removed.

3 years agoUnify more functions in CUDA and OpenCL implementations of NBNXM
Artem Zhmurov [Thu, 10 Sep 2020 05:39:44 +0000 (05:39 +0000)]
Unify more functions in CUDA and OpenCL implementations of NBNXM

3 years agoExplicitly include STL headers used in test.
M. Eric Irrgang [Wed, 9 Sep 2020 17:34:13 +0000 (17:34 +0000)]
Explicitly include STL headers used in test.

Include `array` and `optional` in strconvert.cpp test.

Fixes #3657

3 years agoRestore GMX_FORCE_UPDATE_DEFAULT_GPU environment varible check
Artem Zhmurov [Wed, 9 Sep 2020 06:29:11 +0000 (09:29 +0300)]
Restore GMX_FORCE_UPDATE_DEFAULT_GPU environment varible check

This line was accidently removed during unrelated refactoring
in 75c17a76b69c1ade1f29fdce9fe2f6dd78221c1d .

3 years agoBug fix in call to deviceStreamManager constructor
Alan Gray [Tue, 8 Sep 2020 16:34:25 +0000 (16:34 +0000)]
Bug fix in call to deviceStreamManager constructor

DeviceStreamManager construction expects
(deviceInfo,useGpuForPme,havePpDomainDecomposition,
doGpuPmePpTransfer,useGpuForUpdate,useTiming) but was being passed
(deviceInfo,useGpuForPme,useGpuForNonbonded,
havePPDomainDecomposition,useGpuForUpdate,useTiming) Now passing
correct arguments through simulationWork. Also ensures update stream
is correctly set up when gpu buffer ops are enabled.

Fixes #3639 and #3641

3 years agoFix clang-tidy warning
Andrey Alekseenko [Tue, 8 Sep 2020 12:51:19 +0000 (14:51 +0200)]
Fix clang-tidy warning

3 years agoFix "GPU detection deactivated" message when it in fact failed
Andrey Alekseenko [Tue, 8 Sep 2020 12:29:08 +0000 (14:29 +0200)]
Fix "GPU detection deactivated" message when it in fact failed

Also remove duplicate GPU detection check, and raise log level on failure from GPU detection API.

3 years agoMake legacy energy elements use CheckpointData
Pascal Merz [Tue, 8 Sep 2020 13:20:07 +0000 (13:20 +0000)]
Make legacy energy elements use CheckpointData

This enables some legacy energy elements to write to CheckpointData,
namely

* energyhistory_t
* delta_h_history_t
* ekinstate_t

Refs #3517
Refs #3422
Refs #3419

3 years agoAllow density-guided simulations to translate structure
Christian Blau [Tue, 8 Sep 2020 12:49:24 +0000 (12:49 +0000)]
Allow density-guided simulations to translate structure

Density-guided simulations acquire a new feature that allows a
user-defined shift on the structure before forces are calculated.

First step to address #3581

3 years agoRemove dependency of EnergyData on t_state
Pascal Merz [Tue, 8 Sep 2020 10:56:09 +0000 (10:56 +0000)]
Remove dependency of EnergyData on t_state

EnergyData used a t_state object to calculate the conserved energy.
This responsibility is now given to the respective temperature /
pressure control algorithms. This allows to remove the dependency
of EnergyData on t_state.

This also introduces the conserved energy as a test quantity in the
tests comparing legacy and modular simulator code paths.

Refs #3419

3 years agoMove densityfitting to its own directory
Paul Bauer [Tue, 8 Sep 2020 07:29:07 +0000 (07:29 +0000)]
Move densityfitting to its own directory

Preparing for adding more applied_forces modules

Change-Id: Ieec20d1f0752a369d26352ec6b0997812decd21e

3 years agoFix output string for GPU support
Paul Bauer [Mon, 7 Sep 2020 22:47:17 +0000 (22:47 +0000)]
Fix output string for GPU support

This used to print only disabled or CUDA because the variable was only 0
or 1.

Change-Id: Ie406a36e61617c29629f97d811eb93244b5a2e3a

3 years agoFix clang-format failure in coordinatetransformation.h
Christian Blau [Mon, 7 Sep 2020 16:12:52 +0000 (18:12 +0200)]
Fix clang-format failure in coordinatetransformation.h

Fixes formatting clang format error.

3 years agoMake EnergyOutput::addDataAtEnergyStep independent of t_state
Pascal Merz [Mon, 7 Sep 2020 20:23:36 +0000 (20:23 +0000)]
Make EnergyOutput::addDataAtEnergyStep independent of t_state

EnergyOutput::addDataAtEnergyStep took a pointer to a full t_state,
although it only uses a small part of the object. This makes the
dependencies explicit. This is a necessary step to make EnergyData
independent of t_state.

Refs #3419

3 years agoRemove in-body comment from init_forcerec(...) function
Artem Zhmurov [Mon, 7 Sep 2020 10:58:02 +0000 (13:58 +0300)]
Remove in-body comment from init_forcerec(...) function

Fixes doxygen warning

3 years agoFix clang-format
Artem Zhmurov [Mon, 7 Sep 2020 17:44:03 +0000 (20:44 +0300)]
Fix clang-format

3 years agoReplace filename-based initialization functions.
M. Eric Irrgang [Mon, 7 Sep 2020 16:13:31 +0000 (16:13 +0000)]
Replace filename-based initialization functions.

Decouple Mdrunner from the details of `-s` and `-cpi`
filename arguments when establishing initial simulation state.

Declare gmx::SimulationInput and the library utilities needed to
replace direct reference to TPR and CPT files in Mdrunner.
Use SimulationInput and accompanying utilities to remove read_tpx_state
and load_checkpoint from Mdrunner.

Allows TPR and checkpoint file handling to be considered separately
from Mdrunner initialization in future development.

Refs #3374

3 years agoImplement affine coordinate transformation
Christian Blau [Mon, 7 Sep 2020 13:46:40 +0000 (13:46 +0000)]
Implement affine coordinate transformation

Introduce a new class and tests for affine coordinate transformations.
Allows to perform a matrix multiplication and shift to coordinates of the form A*x+t with a 3x3 real valued matrix A and a translation vector t.

3 years agoAccess the device status directly, remove the getter
Artem Zhmurov [Mon, 7 Sep 2020 06:09:04 +0000 (06:09 +0000)]
Access the device status directly, remove the getter

DeviceInformation is a basic contained and does not need the getters.

3 years agoPrepare legacy checkpoint for modular simulator checkpointing
Pascal Merz [Sun, 6 Sep 2020 18:15:55 +0000 (18:15 +0000)]
Prepare legacy checkpoint for modular simulator checkpointing

* Extend legacy checkpointing functionality to accept a CheckpointDataHolder
  for reading and writing
* Bump checkpoint version to reflect above change
* Turn off some checkpoint sanity checks when using modular simulator
* Pass CheckpointDataHolder object into checkpoint reading in runner, and
  move this object in SimulatorBuilder and then ModularSimulator for element
  setup

Refs #3517
Refs #3422
Refs #3419

3 years agoModular simulator: Simplify velocity update dispatch
Pascal Merz [Sun, 6 Sep 2020 12:01:42 +0000 (12:01 +0000)]
Modular simulator: Simplify velocity update dispatch

This simplifies the velocity update dispatch of the modular simulator
propagator. This is pure rebasing reducing the number of branches
required to dispatch the right templated version of the velocity
update.

3 years agoString to array conversion functions
Christian Blau [Fri, 4 Sep 2020 11:59:43 +0000 (11:59 +0000)]
String to array conversion functions

Introduce and test a function that allows to convert a string into
a fixed-size array of arbitrary ElementType.

3 years agoIntroduce CheckpointData
Pascal Merz [Thu, 30 Apr 2020 02:25:41 +0000 (20:25 -0600)]
Introduce CheckpointData

CheckpointData exposes methods to read and write scalar values,
ArrayRefs, and tensors. It also allows to create a "sub-object" of
type CheckpointData which allows to have more complex members
implement their own checkpointing routines. All methods are templated
on the chosen operation, CheckpointDataOperation::Read or
CheckpointDataOperation::Write, allowing clients to use the same code
to read and write to checkpoint. Type traits and constness are used to
catch as many errors as possible at compile time. CheckpointData uses
a KV-tree to store the data internally. This is however never exposed
to the client. Having this abstraction layer gives freedom to change
the internal implementation in the future.

All CheckpointData objects are owned by a ReadCheckpointDataHolder or
WriteCheckpointDataHolder. These holder classes own the internal
KV-tree, and offer deserialize(ISerializer*) and
serialize(ISerializer*) functions, respectively, which allow to read
from / write to file. This separation clearly defines ownership and
separates the interface aimed at file IO from the interface aimed at
objects reading/writing checkpoints.

Refs #3517
Refs #3422
Refs #3419

3 years agoRemove unnecessary friend declaration
Pascal Merz [Thu, 3 Sep 2020 15:28:59 +0000 (09:28 -0600)]
Remove unnecessary friend declaration

3 years agoPrint lambda state to log file if using AWH for FEP.
Magnus Lundborg [Tue, 1 Sep 2020 11:24:20 +0000 (13:24 +0200)]
Print lambda state to log file if using AWH for FEP.

Change-Id: I08c7e6d51a299eb53556d5bde63c29f7c7640f6e

3 years agoFix bug it GPU halo exchange initialization for continuation runs
Alan Gray [Sun, 23 Aug 2020 13:05:51 +0000 (06:05 -0700)]
Fix bug it GPU halo exchange initialization for continuation runs

Fixes a bug introduced in fdf8c9064e2289bb01b1536a06f83755450caee8
where, due to the presence of !(bFirstStep && ir->bContinuation) in
the if statement predicate of the block in which the init call was
located. In the case of continuation runs the halo exchange would not
be initialized until the second search step, causing the code to
crash. This change moves the init call to a separate block with the
correct logic in the if statement.

3 years agoMake dd_collect_vec independent of t_state
Pascal Merz [Thu, 3 Sep 2020 05:27:38 +0000 (23:27 -0600)]
Make dd_collect_vec independent of t_state

This removes the explicit dependency of dd_collect_vec on the
t_state object.

This is a prerequisite for !440.

Refs #3422 #3419

3 years agoMove listed and wall forces out of do_force_lowlevel()
Berk Hess [Wed, 2 Sep 2020 21:02:55 +0000 (21:02 +0000)]
Move listed and wall forces out of do_force_lowlevel()

Renamed do_force_lowlevel() to calculateLongRangeElectrostatics().

Also replace C pointer for coordinates by ArrayRefWithPadding
in calculate() of ListedForces and do_walls().

3 years agoEnable splitting of listed interaction calculation
Berk Hess [Wed, 2 Sep 2020 15:27:23 +0000 (15:27 +0000)]
Enable splitting of listed interaction calculation

This replaces the ListedForces unique_ptr in t_forcerec by a vector
of unique_ptr and adds a selection mechanism for bonded interactions.

Also moved the t_fcdata storage out of ListedForces into t_forcerec
because we need only one instance.

3 years agoFix improved SIMD angles()
Gilles Gouaillardet [Wed, 2 Sep 2020 09:01:44 +0000 (09:01 +0000)]
Fix improved SIMD angles()

avoid division by zero when the angle is (too close to) zero.

Fix a regression introduced in fb7a6480db5914a50a97618b3e6316663041aafb

3 years agoMerge branch 'release-2020' into master
Paul Bauer [Mon, 31 Aug 2020 15:15:45 +0000 (17:15 +0200)]
Merge branch 'release-2020' into master

Resolved Conflicts:
CMakeLists.txt
admin/ci-scripts/build-and-test-py-gmxapi-0.1.sh
admin/ci-scripts/build-and-test-sample_restraint-2020.sh
admin/clang-tidy.sh
admin/gitlab-ci/global.gitlab-ci.yml
admin/gitlab-ci/gromacs.gitlab-ci.yml
admin/gitlab-ci/python-gmxapi.gitlab-ci.yml
cmake/gmxManageGPU.cmake
cmake/gmxManageNvccConfig.cmake
cmake/gmxVersionInfo.cmake
share/CMakeLists.txt
src/config.h.cmakein
src/gromacs/CMakeLists.txt
src/gromacs/analysisdata/CMakeLists.txt
src/gromacs/ewald/pme.cpp
src/gromacs/fileio/tpxio.cpp
src/gromacs/fileio/writeps.cpp
src/gromacs/gmxana/gmx_hbond.cpp
src/gromacs/gmxana/gmx_lie.cpp
src/gromacs/gmxana/gmx_xpm2ps.cpp
src/gromacs/gmxpreprocess/genrestr.cpp
src/gromacs/gmxpreprocess/tests/CMakeLists.txt
src/gromacs/gpu_utils/gpu_utils.cu
src/gromacs/gpu_utils/tests/pinnedmemorychecker.cpp
src/gromacs/math/CMakeLists.txt
src/gromacs/options/CMakeLists.txt
src/gromacs/pbcutil/CMakeLists.txt
src/gromacs/topology/mtop_util.cpp
src/gromacs/trajectoryanalysis/CMakeLists.txt
src/gromacs/utility/CMakeLists.txt

Change-Id: I9c364fc3a8e1d9ba9821e06155136ffc6f46b8cd

3 years agoAdd SIMD version of harmonic bonds
Berk Hess [Fri, 28 Aug 2020 22:34:40 +0000 (22:34 +0000)]
Add SIMD version of harmonic bonds

Change-Id: I63ea7d9b76127112c221a9b6910604a09bbb0bb7

3 years agoAvoid seg fault when PME-PP GPU comm flag is used in isolation
Alan Gray [Sun, 23 Aug 2020 12:31:56 +0000 (05:31 -0700)]
Avoid seg fault when PME-PP GPU comm flag is used in isolation

Improves stability by ensuring that GPU buffer ops flag is
automatically set if GPU PME-PP flag is set (in the same way as was
already done for GPU DD flag). Otherwise get a seg fault if PME-PP GPU
env trigger is used without either GPU DD or GPU Buffer ops env
triggers).

3 years agoClarify t_inputrec allocation logic in runner.cpp.
M. Eric Irrgang [Thu, 27 Aug 2020 11:09:23 +0000 (14:09 +0300)]
Clarify t_inputrec allocation logic in runner.cpp.

Closes #3637

3 years agoUse a heap object for inputrec in gmx::Mdrunner::mdrunner().
M. Eric Irrgang [Thu, 27 Aug 2020 07:04:43 +0000 (07:04 +0000)]
Use a heap object for inputrec in gmx::Mdrunner::mdrunner().

Convert the inputrec pointer to a unique_ptr to combine the clean-up
behavior from both local variables. Remove the explicit inputrecInstance
local variable, converting to a heap object created through make_unique.
This allows the t_inputrec to be moved via its handle for more flexible
management, and allows the allocation to be moved closer to the
initialization.

3 years agoAdd ForceBuffers class
Berk Hess [Thu, 27 Aug 2020 06:09:17 +0000 (06:09 +0000)]
Add ForceBuffers class

This change replaces the type of the force buffer in mdrun from
PaddedHostVector<RVec> to a new class ForceBuffers. This new class
currently only holds one force buffer, but this is in preparation for
multiple time stepping where a second force buffer is needed.