alexxy/gromacs.git
3 years agoTemporarily lift requirement to detect GPUs in CI
Mark Abraham [Fri, 30 Apr 2021 06:21:02 +0000 (08:21 +0200)]
Temporarily lift requirement to detect GPUs in CI

3 years agoRemove leftover function declaration from nbnxm atomdata
ejjordan [Tue, 27 Apr 2021 14:45:56 +0000 (16:45 +0200)]
Remove leftover function declaration from nbnxm atomdata

MR !1483 neglected to remove the declaration of function
nbnxn_atomdata_init. This MR rectifies that. Also removed
and unneeded include.

3 years agoApply clang-tidy11 to mdrun
Joe Jordan [Tue, 27 Apr 2021 12:33:43 +0000 (12:33 +0000)]
Apply clang-tidy11 to mdrun

3 years agoUnify constructor of nbnxn_atomdata_t
Joe Jordan [Tue, 27 Apr 2021 08:40:11 +0000 (08:40 +0000)]
Unify constructor of nbnxn_atomdata_t

3 years agoConstructor for t_mde_delta_h_coll
Joe Jordan [Tue, 27 Apr 2021 06:23:06 +0000 (06:23 +0000)]
Constructor for t_mde_delta_h_coll

3 years agoIncrease const correctness of t_mdatoms use in md.cpp
ejjordan [Thu, 22 Apr 2021 12:22:07 +0000 (14:22 +0200)]
Increase const correctness of t_mdatoms use in md.cpp

Previously two instances of t_mdatoms were made in do_md, once const
and one not. This replaces all instances where the non-const was not
used but could be with const usage. Also, non-const usage is now done
by calling MDAtoms->mdatoms() to indicate non-const usage more clearly.

3 years agoRemove inputrec from initialize_lambdas signature
Joe Jordan [Mon, 26 Apr 2021 15:33:40 +0000 (15:33 +0000)]
Remove inputrec from initialize_lambdas signature

3 years agoApply clang-tidy11 to correlationfunctions
ejjordan [Mon, 26 Apr 2021 12:56:15 +0000 (14:56 +0200)]
Apply clang-tidy11 to correlationfunctions

3 years agoApply clang-tidy11 to simd
ejjordan [Mon, 26 Apr 2021 12:39:44 +0000 (14:39 +0200)]
Apply clang-tidy11 to simd

3 years agoApply clang-tidy11 to random
ejjordan [Mon, 26 Apr 2021 12:36:49 +0000 (14:36 +0200)]
Apply clang-tidy11 to random

3 years agoApply clang-tidy11 to commandline
ejjordan [Mon, 26 Apr 2021 12:53:07 +0000 (14:53 +0200)]
Apply clang-tidy11 to commandline

3 years agoFix MSVC build
Paul Bauer [Fri, 23 Apr 2021 13:05:39 +0000 (15:05 +0200)]
Fix MSVC build

The enum class must have collided with some internal type in MSVC, so we
rename it.

3 years agoClang-11 fixes for applied forces
Artem Zhmurov [Mon, 26 Apr 2021 07:24:27 +0000 (07:24 +0000)]
Clang-11 fixes for applied forces

3 years agoSpecialize jacobi() for 3 dimensions
Berk Hess [Fri, 23 Apr 2021 15:53:43 +0000 (15:53 +0000)]
Specialize jacobi() for 3 dimensions

3 years agoMake SETTLE setup code platform-agnostic
Artem Zhmurov [Fri, 23 Apr 2021 11:36:31 +0000 (11:36 +0000)]
Make SETTLE setup code platform-agnostic

3 years agoApply clang-11 fixes for fileio
Artem Zhmurov [Fri, 23 Apr 2021 10:13:49 +0000 (10:13 +0000)]
Apply clang-11 fixes for fileio

3 years agoFix beningn GCC 10.2 Wstringop-truncation warnings
Andrey Alekseenko [Thu, 22 Apr 2021 16:44:08 +0000 (18:44 +0200)]
Fix beningn GCC 10.2 Wstringop-truncation warnings

- `get_pdb_atomnumber`
  GCC was worried that we're copying up to 4 bytes to a buffer of
  length 4, not leaving the space for terminating \0. The source string
  is guaranteed to have length 3 + terminator, so not a problem.
  Changed to strcpy, since it should be safe here.
  While at it, renamed a variable, gave a name to a magic constant,
  added a static_assert to ensure safety.

- `read_vsite_database`
  GCC was complaining that we're copying 4094 bytes from a string of
  length 4094, possibly truncating the terminating \0. The string was
  guaranteed to have a terminator in its first 4093 bytes (fgets2 will
  put it no later than STRLEN-2, and we also skip the first character).
  But to make GCC happy, I see no harm in adding 1 more byte to strncpy.

Another warning from GCC is an actual error, fixed in MR !1487.

3 years agoClang-11 fixes for PME and FFT
Artem Zhmurov [Fri, 23 Apr 2021 09:05:24 +0000 (09:05 +0000)]
Clang-11 fixes for PME and FFT

3 years agoPrepare virial calculation for legacy md-vv pressure coupling
Pascal Merz [Fri, 23 Apr 2021 07:09:54 +0000 (07:09 +0000)]
Prepare virial calculation for legacy md-vv pressure coupling

3 years agoMake LINCS setup code platform-agnostic
Artem Zhmurov [Thu, 22 Apr 2021 16:21:28 +0000 (16:21 +0000)]
Make LINCS setup code platform-agnostic

3 years agoImprove UpdateGroups testing infra
Mark Abraham [Thu, 22 Apr 2021 09:32:27 +0000 (11:32 +0200)]
Improve UpdateGroups testing infra

Made and used a class fixture, used scopes to clarify lifetimes,
updated naming to follow general style, separated tests of the effect
of temperature upon radius calculations.

3 years agoFixes from clang-tidy-11 for signal handling
Paul Bauer [Thu, 22 Apr 2021 14:39:21 +0000 (14:39 +0000)]
Fixes from clang-tidy-11 for signal handling

3 years agoVectors in history_t
Joe Jordan [Thu, 22 Apr 2021 13:19:47 +0000 (13:19 +0000)]
Vectors in history_t

3 years agoFix MSVC build
Paul Bauer [Thu, 22 Apr 2021 12:56:31 +0000 (12:56 +0000)]
Fix MSVC build

3 years agoFix doxygen of the SYCL atomicFetchAdd
Szilárd Páll [Thu, 22 Apr 2021 11:21:19 +0000 (13:21 +0200)]
Fix doxygen of the SYCL atomicFetchAdd

3 years agoMore renaming for UpdateGroups
Mark Abraham [Thu, 22 Apr 2021 05:35:38 +0000 (07:35 +0200)]
More renaming for UpdateGroups

In preparation for introducing a class for managing the use and data for
UpdateGroups, other things need to change so we'll have clarity.

Refs #4004

3 years agoFinish removing t_mdatoms from update module
ejjordan [Wed, 21 Apr 2021 16:46:11 +0000 (18:46 +0200)]
Finish removing t_mdatoms from update module

Remove t_atoms from finish_update and only pass needed params.

Also cleaned up the includes and forward declares a bit.

3 years agoRemove isnormal() check around the atomic increment
Szilárd Páll [Wed, 21 Apr 2021 15:55:30 +0000 (15:55 +0000)]
Remove isnormal() check around the atomic increment

3 years agoMostly remove t_mdatoms from update signatures
Joe Jordan [Wed, 21 Apr 2021 15:32:22 +0000 (15:32 +0000)]
Mostly remove t_mdatoms from update signatures

3 years agoclang-tidy-11 fixes for gmxpreprocess
Joe Jordan [Wed, 21 Apr 2021 14:07:45 +0000 (14:07 +0000)]
clang-tidy-11 fixes for gmxpreprocess

3 years agoIntroduce TimeStep and Offset strong types
Pascal Merz [Sat, 28 Nov 2020 19:13:39 +0000 (12:13 -0700)]
Introduce TimeStep and Offset strong types

When building integration algorithms in modular simulator, the time
step (for propagations) and the scheduling offset (for algorithms called
periodically) are the most frequently used type of arguments. They are
also currently the only arguments which are passed by simple types
(int and double, respectively).

The current change introduces strong types, increasing both safety and
readability. Note that these strong types can easily be adapted to
inheriting from a general base class if one is introduced (refs #4005).

3 years agoFix nbnxm hipSYCL kernels 64-wide exec on AMD
Szilárd Páll [Wed, 21 Apr 2021 10:57:02 +0000 (10:57 +0000)]
Fix nbnxm hipSYCL kernels 64-wide exec on AMD

3 years agoFix doxygen for MessageStringCollector
Mark Abraham [Wed, 21 Apr 2021 08:37:01 +0000 (10:37 +0200)]
Fix doxygen for MessageStringCollector

Refs #4004

3 years agoLet LoggerTestHelper write cleaner tests
Mark Abraham [Wed, 21 Apr 2021 08:39:32 +0000 (10:39 +0200)]
Let LoggerTestHelper write cleaner tests

Now we can write tests that the logger produces no output, e.g. no
warnings occur when a happy path is able to run.

Refs #4004

3 years agoUse index instead of pointer in t_mde_delta_h_coll
ejjordan [Tue, 20 Apr 2021 13:24:18 +0000 (15:24 +0200)]
Use index instead of pointer in t_mde_delta_h_coll

Several members of t_mde_delta_h_coll were just pointers into a
master array of t_mde_delta_h that are held by t_mde_delta_h_coll.
This change makes it so only an int instead of a pointer is stored.
After this it should be much easier to make t_mde_delta_h_coll
default constructible, which is planned for a followup.

Also removed 2 unused members.

A renaming of the members can also be left for a followup, once
the whole t_mde_delta_h_coll struct is modernized.

3 years agoRemove uses of std::bind
Mark Abraham [Wed, 21 Apr 2021 05:44:07 +0000 (07:44 +0200)]
Remove uses of std::bind

clang-tidy-11 correctly warns against these unnecessarily complex
constructs.

Refs #3897

3 years agoUse consistent naming for update groups
Mark Abraham [Wed, 21 Apr 2021 08:02:09 +0000 (10:02 +0200)]
Use consistent naming for update groups

Prepares to introduce an UpdateGroups class that contains the groupings

Refs #4004

3 years agoRename some enum names in ModuleMultiThread
Joe Jordan [Wed, 21 Apr 2021 00:36:10 +0000 (00:36 +0000)]
Rename some enum names in ModuleMultiThread

3 years agoclang-tidy-11 fixes for topology, gpu_utils, and selection
Joe Jordan [Tue, 20 Apr 2021 13:44:44 +0000 (13:44 +0000)]
clang-tidy-11 fixes for topology, gpu_utils, and selection

3 years agoFix clang-format
Paul Bauer [Tue, 20 Apr 2021 11:20:27 +0000 (13:20 +0200)]
Fix clang-format

Was missing from previous commit.

3 years agoFix possible UB in ArrayRef construction
Paul Bauer [Tue, 20 Apr 2021 07:53:33 +0000 (09:53 +0200)]
Fix possible UB in ArrayRef construction

The code could cause possible UB when construction ArrayRefs from
nullptrs.

Added nullptr check to only construct empty ArrayRef in that case.

3 years agoUse enum class for gmx_omp_nthreads
Joe Jordan [Tue, 20 Apr 2021 09:58:52 +0000 (09:58 +0000)]
Use enum class for gmx_omp_nthreads

3 years agoclang-tidy-11 fixes for utils
Joe Jordan [Tue, 20 Apr 2021 09:18:07 +0000 (09:18 +0000)]
clang-tidy-11 fixes for utils

3 years agoclang-tidy-11 fixes mdrun tests
ejjordan [Mon, 19 Apr 2021 18:54:55 +0000 (20:54 +0200)]
clang-tidy-11 fixes mdrun tests

Split off from !1433

3 years agoclang-tidy-11 fixes for listed_forces
ejjordan [Mon, 19 Apr 2021 18:09:25 +0000 (20:09 +0200)]
clang-tidy-11 fixes for listed_forces

3 years agoApply clang-tidy11 to gmxana files with no dependencies
ejjordan [Mon, 19 Apr 2021 18:29:05 +0000 (20:29 +0200)]
Apply clang-tidy11 to gmxana files with no dependencies

Splitt off from !1433. These are only the gmxana files that do not
depend on other clang-tidy11 changes. The files gmx_analyze.cpp,
gmx_nmr.cpp, gmx_bar.cpp, gmx_wheel.cpp and gmx_energy.cpp all have
dependencies, mostly on enum modernization. They can be a subsequent
MR.

3 years agoclang-tidy-11 fixes for options
ejjordan [Mon, 19 Apr 2021 18:40:10 +0000 (20:40 +0200)]
clang-tidy-11 fixes for options

Split off from !1433

3 years agoclang-tidy-11 fixes for hardware
ejjordan [Mon, 19 Apr 2021 18:36:55 +0000 (20:36 +0200)]
clang-tidy-11 fixes for hardware

Split off from !1433

3 years agoclang-tidy-11 fixes for analysisdata
ejjordan [Mon, 19 Apr 2021 18:17:38 +0000 (20:17 +0200)]
clang-tidy-11 fixes for analysisdata

3 years agoMake .rtp/.tdb bond types into enum class
Artem Zhmurov [Mon, 19 Apr 2021 13:53:58 +0000 (16:53 +0300)]
Make .rtp/.tdb bond types into enum class

3 years agoMake Compartment, Channel, ChannelHistory and Domaint into enum classes
Artem Zhmurov [Mon, 19 Apr 2021 14:49:11 +0000 (17:49 +0300)]
Make Compartment, Channel, ChannelHistory and Domaint into enum classes

3 years agoMake XDR type into enum class
Artem Zhmurov [Mon, 19 Apr 2021 18:49:05 +0000 (18:49 +0000)]
Make XDR type into enum class

3 years agoAdd Gaurav to list of contributors
Alan Gray [Mon, 19 Apr 2021 15:55:42 +0000 (08:55 -0700)]
Add Gaurav to list of contributors

3 years agoSet matching number of ranks for OpenCL GPU tests
Paul Bauer [Mon, 19 Apr 2021 08:18:00 +0000 (08:18 +0000)]
Set matching number of ranks for OpenCL GPU tests

3 years agoRemoved a duplicated quote
Philip Loche [Thu, 15 Apr 2021 11:23:46 +0000 (13:23 +0200)]
Removed a duplicated quote

3 years agoRename files to follow style
Mark Abraham [Sat, 17 Apr 2021 08:47:58 +0000 (08:47 +0000)]
Rename files to follow style

3 years agoFix AWH input reading
Paul Bauer [Thu, 15 Apr 2021 16:19:12 +0000 (18:19 +0200)]
Fix AWH input reading

Tests happened at the wrong time before all AWH and FEP parameters had
been initialized, leading to aborts due to failing checks.

Also fix initialization of dim parameters.

Fixes #4027

3 years agoRemove thread-MPI limitation for GPU direct PME-PP communication
Gaurav Garg [Wed, 14 Apr 2021 05:50:07 +0000 (11:20 +0530)]
Remove thread-MPI limitation for GPU direct PME-PP communication

Allows use of direct-GPU communication for PP-PME communication when
running with "real" MPI, including on multiple compute nodes,
through new CUDA-aware MPI communication code paths.

Implements part of #2891
Refs: #2915 #3960

3 years agoIntroduce position and velocity scaling propagators
Pascal Merz [Fri, 16 Apr 2021 09:30:02 +0000 (09:30 +0000)]
Introduce position and velocity scaling propagators

3 years agoUse host buffer instead of host accessors in SYCL LeapFrog
Andrey Alekseenko [Wed, 14 Apr 2021 17:03:23 +0000 (17:03 +0000)]
Use host buffer instead of host accessors in SYCL LeapFrog

3 years agoPass forcerec arguments instead of forcerec to gmx_nb_free_energy_kernel
Joe Jordan [Wed, 14 Apr 2021 16:16:27 +0000 (16:16 +0000)]
Pass forcerec arguments instead of forcerec to gmx_nb_free_energy_kernel

3 years agoModernize wallcycle counting
Paul Bauer [Wed, 14 Apr 2021 13:52:51 +0000 (13:52 +0000)]
Modernize wallcycle counting

3 years agoFix misc-misplaced-const clang-tidy warning
Andrey Alekseenko [Wed, 14 Apr 2021 10:02:43 +0000 (13:02 +0300)]
Fix misc-misplaced-const clang-tidy warning

The problem was introduced in aa66efd3179a671aace62b827c54aadc3d89c1ee
(MR !1374).

As MPI_Comm is typedef'd as a pointer to a structure, declaring it const
would be of little use: the pointer itself would be const, not the data
it is pointing to.

3 years agoImplement Nose-Hoover thermostat for leap-frog modular simulator
Pascal Merz [Tue, 6 Oct 2020 03:02:17 +0000 (21:02 -0600)]
Implement Nose-Hoover thermostat for leap-frog modular simulator

This implements the Nose-Hoover temperature coupling algorithm for the
leap-frog version of modular simulator. Velocity verlet could in theory
use this coupling algorithm as well, but the legacy version uses the
Trotter-decomposed version instead, which will be introduced to modular
simulator in a follow-up commit. To ensure equivalence of the legacy and
the modular code paths, Nose-Hoover will not be enabled for md-vv in
modular simulator until the Trotter scheme is merged.

The implementation added in this change is straightforward, as it extends
the existing general velocity-scaling temperature coupling object by
another algorithm. It is marginally more complex than the existing
algorithms (Berendsen and v-scale) due to the need of checkpointing the
extended ensemble degree of freedom for exact continuation.

Refs #3423

3 years agoAdd GMX_GPU_SYCL_NO_SYNCHRONIZE environment variable
Andrey Alekseenko [Wed, 14 Apr 2021 07:14:21 +0000 (07:14 +0000)]
Add GMX_GPU_SYCL_NO_SYNCHRONIZE environment variable

3 years agoImplement dynamic pair search for EM
Berk Hess [Tue, 13 Apr 2021 11:31:01 +0000 (11:31 +0000)]
Implement dynamic pair search for EM

3 years agoReplace static trajectoryanalysismoduledata methods with instance methods
Kevin Boyd [Mon, 12 Apr 2021 18:02:11 +0000 (11:02 -0700)]
Replace static trajectoryanalysismoduledata methods with instance methods

This paves the way for multiple concurrent frames analyzing
selections in parallel, via individual analysismoduledata objects

3 years agoRemove thread-MPI limitation for GPU PP Halo exchange
Gaurav Garg [Thu, 25 Mar 2021 08:19:37 +0000 (13:49 +0530)]
Remove thread-MPI limitation for GPU PP Halo exchange

Allows use of direct-GPU communication for PP halo exchange when
running with "real" MPI, including on multiple compute nodes,
through new CUDA-aware MPI communication code paths.

Implements part of #2891
Refs: #2915 #3960

3 years agoUse array for term and foreign_term in gmx_enerdata_t
Joe Jordan [Tue, 13 Apr 2021 09:43:44 +0000 (09:43 +0000)]
Use array for term and foreign_term in gmx_enerdata_t

3 years agoAdd basic position restraints test
Kevin Boyd [Tue, 13 Apr 2021 08:26:05 +0000 (08:26 +0000)]
Add basic position restraints test

3 years agoFix check source
Pascal Merz [Mon, 12 Apr 2021 16:47:42 +0000 (10:47 -0600)]
Fix check source

2e8da9f2ad7536ed0da612a977c6bfe0f89bc071 added a function argument
without updating the doxygen. This adds the missing argument description.

3 years agoPass cFREEZE and cTC to update after DD partitioning
Joe Jordan [Mon, 12 Apr 2021 18:18:53 +0000 (18:18 +0000)]
Pass cFREEZE and cTC to update after DD partitioning

3 years agoImprove docs and naming for MdModulesNotifiers
Mark Abraham [Mon, 12 Apr 2021 17:00:34 +0000 (17:00 +0000)]
Improve docs and naming for MdModulesNotifiers

3 years agoRemove explicit dependency of EnergyData on thermostat / barostats
Pascal Merz [Mon, 12 Apr 2021 15:39:51 +0000 (15:39 +0000)]
Remove explicit dependency of EnergyData on thermostat / barostats

3 years agoAdd unit test for the nonbonded fep kernel.
Sebastian Kehl [Mon, 12 Apr 2021 15:10:18 +0000 (15:10 +0000)]
Add unit test for the nonbonded fep kernel.

3 years agoWorkaround for compilation with hipSYCL 0.9.1
Szilárd Páll [Mon, 12 Apr 2021 09:52:20 +0000 (11:52 +0200)]
Workaround for compilation with hipSYCL 0.9.1

3 years agoExpose init_interaction_const and move to correct header/source
Joe Jordan [Mon, 12 Apr 2021 13:36:26 +0000 (13:36 +0000)]
Expose init_interaction_const and move to correct header/source

3 years agoRelax default tolerance on pressure comparisons
Mark Abraham [Mon, 12 Apr 2021 05:52:35 +0000 (07:52 +0200)]
Relax default tolerance on pressure comparisons

Fixes #3975

3 years agoReplace defines with constexpr in ishift
Joe Jordan [Mon, 12 Apr 2021 10:24:29 +0000 (10:24 +0000)]
Replace defines with constexpr in ishift

3 years agoConstructor for gmx_ekindata_t
ejjordan [Fri, 9 Apr 2021 08:57:01 +0000 (10:57 +0200)]
Constructor for gmx_ekindata_t

Moved init_ekin_data from tgroup header/source to group and made
it the constructor for gmx_ekindata_t. Also made gmx_ekindata_t a
class since the number of threads is only needed by constructor
and destructor and can thus be private. Further refactoring of
members of gmx_ekindata_t would eliminate the need for the nthreads
data member entirely. Other members we not made private to avoid a
ripple of changes adding "()" to numerous lines in several files.

3 years agoPrepare SelectionCollection for parallel analysis
Kevin Boyd [Mon, 12 Apr 2021 08:52:57 +0000 (08:52 +0000)]
Prepare SelectionCollection for parallel analysis

3 years agoAdd a fourth coordinate to virial tests
Joe Jordan [Mon, 12 Apr 2021 08:24:45 +0000 (08:24 +0000)]
Add a fourth coordinate to virial tests

3 years agoAllow thermostat to scale velocities before and after step
Pascal Merz [Fri, 2 Apr 2021 19:35:01 +0000 (13:35 -0600)]
Allow thermostat to scale velocities before and after step

Velocity scaling thermostats are currently only able to scale
velocities before the respective propagator step. This change allows
to also scale velocities at the end of the step. This functionality
is needed by the Nose-Hoover thermostat.

This requires an additional template parameter in the `updateVelocities`
function, and an additional callback in the
`PropagatorThermostatConnection` struct to allow temperature coupling
algorithms to get a view to the end velocity scaling.

This also sorts the forward declarations in modularsimulatorinterfaces.h
alphabetically to simplify follow-up changes.

Refs #3423

3 years agoAdd a note on early return in device buffer operations
Artem Zhmurov [Sun, 11 Apr 2021 17:36:11 +0000 (20:36 +0300)]
Add a note on early return in device buffer operations

Functions that (re)allocate, clear and copy to or from
device buffer have an early return in case of zero operation
size. This is a safety mechnism that allows calling these
functions even if the buffers are not intialized, if the
size of the respective buffer is set to zero. A note is
added to the devicebuffer.h that explains why these early
returns are needed.

3 years agoClean some headers in NBNXM GPU
Artem Zhmurov [Sun, 11 Apr 2021 17:30:41 +0000 (20:30 +0300)]
Clean some headers in NBNXM GPU

1. Remove declarations of non-existing functins.
2. Remove declarations of internal helper functions,
   move some of the helper functions up in the
   respective sources so that their declaration can
   be removed from the headers.
3. Remove unnecessary includes.

Refs #2608

3 years agoPropagate from current rather than previous position
Pascal Merz [Thu, 8 Apr 2021 21:58:15 +0000 (15:58 -0600)]
Propagate from current rather than previous position

The current implementation was using the previous position as a starting
point of position propagation. This is conceptually wrong: We want to
propagate starting from the current position.

This had no influence currently, as none of the algorithms present has
multiple position propagations per step. Moving forward, this does however
pose the risk of bugs.

3 years agoAdd GpuEventSynchronizer::isMarked to SYCL verion
Andrey Alekseenko [Fri, 9 Apr 2021 10:46:02 +0000 (13:46 +0300)]
Add GpuEventSynchronizer::isMarked to SYCL verion

This function is needed to work around #3988 when implementing GPU
update (#3932).

3 years agotemplate: fix build
Christoph Junghans [Fri, 9 Apr 2021 15:44:17 +0000 (09:44 -0600)]
template: fix build

3 years agoMove ScalingMatrix to common GPU update code.
Andrey Alekseenko [Fri, 9 Apr 2021 10:54:46 +0000 (13:54 +0300)]
Move ScalingMatrix to common GPU update code.

Also, add a constructor to initialize it from an old-style matrix.

Currently, this struct is used only in CUDA, but would be used in SYCL
soon.

Refs #3932.

3 years agoAdd early returns in clearDeviceBuffer(...) in OpenCL and CUDA
Artem Zhmurov [Fri, 2 Apr 2021 12:31:27 +0000 (15:31 +0300)]
Add early returns in clearDeviceBuffer(...) in OpenCL and CUDA

Clearing of empty buffer can cause the OpenCL/CUDA API failure.
Early return when requested size to clear is zero allows to
avoid this failure not calling the API for empty buffers.

This also makes the definition of the clearDeviceBuffer(...) in
OpenCL, CUDA similar to its definition in SYCL, where the early
return is already present.

Fixes #4002.

3 years agoPass ref_t to initialize_lambdas
Joe Jordan [Sun, 11 Apr 2021 00:48:56 +0000 (00:48 +0000)]
Pass ref_t to initialize_lambdas

3 years agoFix several errors when compiling with MSVC
Dmitry Morozov [Wed, 7 Apr 2021 14:18:12 +0000 (17:18 +0300)]
Fix several errors when compiling with MSVC

3 years agoMinor forcerec cleanup
ejjordan [Tue, 6 Apr 2021 09:21:22 +0000 (11:21 +0200)]
Minor forcerec cleanup

* gmx_bool -> bool
* rename a variable
* rvec -> RVec
* more array and vector
* now has default destructor

3 years agoClean up leaks
Kevin Boyd [Sat, 10 Apr 2021 20:25:12 +0000 (20:25 +0000)]
Clean up leaks

3 years agoRename NBAtomData into NBAtomDataGpu
Artem Zhmurov [Sat, 3 Apr 2021 09:51:17 +0000 (12:51 +0300)]
Rename NBAtomData into NBAtomDataGpu

NBAtomData can only be present in GPU code, hence it should has
Gpu prefix in its name.

3 years agoReplace gmx_mtop_ilistloop_all
Paul Bauer [Fri, 2 Apr 2021 15:58:10 +0000 (15:58 +0000)]
Replace gmx_mtop_ilistloop_all

3 years agoMove domdec/partition into gmx namespace; minor cleanup
ejjordan [Thu, 1 Apr 2021 08:08:57 +0000 (10:08 +0200)]
Move domdec/partition into gmx namespace; minor cleanup

* Move functions in partition header into gmx namespace
* Localize variables
* Remove an in-out parameter that is never used

3 years agoEnsure coordinates are copied for dipole moment calculation
Andrey Alekseenko [Thu, 1 Apr 2021 13:40:30 +0000 (15:40 +0200)]
Ensure coordinates are copied for dipole moment calculation

With GPU update, we should wait for the coordinates to be copied to host
before using them for calculating the dipole moment.

This did not seem to cause any issues with CUDA but was causing a unit
test failure with SYCL (with !1329):

    SYCL_BE=PI_OPENCL GMX_USE_GPU_BUFFER_OPS=1 GMX_FORCE_UPDATE_DEFAULT_GPU=1 ./bin/mdrun-test --gtest_filter=EwaldSurfaceTerm/EwaldSurfaceTermTest.WithinTolerances/0

Refs #3930, #3932

3 years agoMake FileOptionTypes enum class
Paul Bauer [Thu, 1 Apr 2021 09:18:47 +0000 (11:18 +0200)]
Make FileOptionTypes enum class

Changed to enum class and made mapping to legacy types use
EnumerationArray.

Removed Unknown type as it wasn't used except for error checking. Used
Count type instead in its place.

3 years agoClarify connection of temperature / pressure coupling and propagators
Pascal Merz [Fri, 2 Apr 2021 00:53:32 +0000 (00:53 +0000)]
Clarify connection of temperature / pressure coupling and propagators

Temperature and pressure coupling and propagators are linked, as most
thermostats and barostats apply some type of scaling to positions and
/ or velocities. The temperature and pressure coupling objects must
therefore be linked to the propagators to properly function.

The current implementation did not allow for much flexibility, as it
only allowed propagators to decide whether to connect to a thermostat
or barostat or not. To allow for more complex algorithms, more
flexibility is required. To that end, this change introduces a
PropagatorTag object, which tags the propagators, and allows the
temperature and pressure coupling objects to pick which propagator to
act on. Additionally, this moves the responsibility of connecting to
the coupling algorithm rather than the propagator, which makes more
sense conceptually.

Refs #3423