alexxy/gromacs.git
3 years agoRemove mdatoms from forceprovider call signature
Paul Bauer [Fri, 19 Mar 2021 11:11:49 +0000 (11:11 +0000)]
Remove mdatoms from forceprovider call signature

This makes it possible to test the forceprovider without having to build
a partial mdatoms datastructure first. Needed for future refactoring of
mdatoms.

3 years agoUse ArrayRef in ewald_LRcorrection
Joe Jordan [Fri, 19 Mar 2021 10:50:48 +0000 (10:50 +0000)]
Use ArrayRef in ewald_LRcorrection

This will make refactoring t_mdatoms easier. Also changed
signatures of calculateLongRangeNonbondeds to use more
ArrayRef.

3 years agoMake non bonded energy terms enum class
Joe Jordan [Fri, 19 Mar 2021 09:54:58 +0000 (09:54 +0000)]
Make non bonded energy terms enum class

Also renamed some of the enum values.

3 years agoFix a warning from CUDA 10.1
Andrey Alekseenko [Fri, 19 Mar 2021 08:13:39 +0000 (11:13 +0300)]
Fix a warning from CUDA 10.1

Discovered during nightly build:

warning: static_assert with no message is a C++17 extension [-Wc++17-extensions]

3 years agoUse ArrayRef in gmx_pme_send_parameters
ejjordan [Thu, 18 Mar 2021 15:42:02 +0000 (16:42 +0100)]
Use ArrayRef in gmx_pme_send_parameters

This will make refactoring t_mdatoms easier.

3 years agoUse const refs in atoms2md signature
ejjordan [Thu, 18 Mar 2021 16:05:02 +0000 (17:05 +0100)]
Use const refs in atoms2md signature

Const refs are now used for mtop and inputrec in atoms2md. Doxygen
is also added and inputrec renamed from ir.

3 years agoAdd wallcycle counting tests
Paul Bauer [Thu, 18 Mar 2021 17:12:34 +0000 (17:12 +0000)]
Add wallcycle counting tests

Basic tests for running main and sub counters, and to check overhead.

3 years agoUse DeviceBuffer in GPU update and NBNXM code
Andrey Alekseenko [Thu, 11 Mar 2021 10:48:06 +0000 (13:48 +0300)]
Use DeviceBuffer in GPU update and NBNXM code

... instead of raw device pointers and DeviceBuffer<float3>.

We try to use DeviceBuffer<Float3>, but in some places we have to use
DeviceVector<gmx::RVec>, until we can define FloatN types without
including any backend-specific headers. Currently, Float3 is defined as
gmx::RVec, so this should not cause any issues.

Also added some helper functions to convert RVec ̌<-> Float3 <-> float3.

Preparation for #3932 and #3941.

3 years agoUse ArrayRef<const real> in gmx_pme_do
ejjordan [Wed, 17 Mar 2021 09:31:48 +0000 (10:31 +0100)]
Use ArrayRef<const real> in gmx_pme_do

Also changed some static functions to use ArrayRef. Some local
variables need to be vectors because they use operator[]. This
is part of preliminary work to make refactoring t_mdatoms
easier.

3 years agoFix errors overlooked in gmx msd changes
Paul Bauer [Wed, 17 Mar 2021 05:59:56 +0000 (05:59 +0000)]
Fix errors overlooked in gmx msd changes

Made some NOLINT sections more broad.
Fixed documentation.

3 years agoUse RVec and std::array in gmx_domdec_comm_t
Joe Jordan [Tue, 16 Mar 2021 18:03:19 +0000 (18:03 +0000)]
Use RVec and std::array in gmx_domdec_comm_t

Where possible, rvecs have been changed to RVecs and pointers
changed to std::arrays.

3 years agoMigrate gmx msd to the trajectoryanalysis framework
Kevin Boyd [Tue, 16 Mar 2021 17:28:24 +0000 (17:28 +0000)]
Migrate gmx msd to the trajectoryanalysis framework

Features to still be added
-tensor, for the MSD tensor
-pdb, for per molecule B-factors
-rmcomm, for system COM removal
-mw, for tuning mass-weighting options
-maxtau, for limiting resource usage and unneccessary computation (refs #3870)
-improvements to documentation and maybe some flag behavior changes (refs #3869)

Refs #2368

3 years agoUnify gpu_init_atomdata(...) function
Artem Zhmurov [Tue, 16 Mar 2021 12:53:21 +0000 (15:53 +0300)]
Unify gpu_init_atomdata(...) function

Refs #2608

3 years agoUnify gpu_launch_cpyback(...) function in NBNXM
Artem Zhmurov [Tue, 16 Mar 2021 13:26:37 +0000 (16:26 +0300)]
Unify gpu_launch_cpyback(...) function in NBNXM

Refs #2608

3 years agoRemove conditional assignemnt of cell sizes from domdec partition
Joe Jordan [Tue, 16 Mar 2021 11:21:10 +0000 (11:21 +0000)]
Remove conditional assignemnt of cell sizes from domdec partition

The variable cellsizesWithDlb is always initiallized since it is a
std::vector, so there is no reason to set it to nullptr in
domdec/partition.

3 years agoUnify gpu_init_atomdata(...) function
Artem Zhmurov [Sat, 13 Mar 2021 13:13:14 +0000 (16:13 +0300)]
Unify gpu_init_atomdata(...) function

Refs #2608

3 years agoMove pmalloc(..)/pfree(...) to separate source files in CUDA/OpenCL/SYCL
Artem Zhmurov [Mon, 15 Mar 2021 16:57:02 +0000 (19:57 +0300)]
Move pmalloc(..)/pfree(...) to separate source files in CUDA/OpenCL/SYCL

Having pmalloc(..) and pfree(..) functions in unrelated files in CUDA,
OpenCL and SYCL makes it hard to use these functions in platform-agnostic
code. This creates common header and moves these functions to separate
source files.

3 years agoAdd subcycle counting to MPI build
Paul Bauer [Mon, 15 Mar 2021 13:56:18 +0000 (14:56 +0100)]
Add subcycle counting to MPI build

This code path has not been tested in CI and should be added.

3 years agoMove M_PI definition to math/units.h
Paul Bauer [Mon, 15 Mar 2021 14:59:03 +0000 (14:59 +0000)]
Move M_PI definition to math/units.h

This makes more sense to have the definition there with the other
constants.

Resolves build issues with MSVC not finding M_PI definition.

Needed some minor header fixes.

3 years agoAdd another cool quote.
Paul Bauer [Mon, 15 Mar 2021 10:06:16 +0000 (11:06 +0100)]
Add another cool quote.

Recently seen on Twitter ...

3 years agoDo not overallocate shiftVec and fshifts buffers in OpenCL
Artem Zhmurov [Mon, 15 Mar 2021 09:12:04 +0000 (12:12 +0300)]
Do not overallocate shiftVec and fshifts buffers in OpenCL

When changing buffers from flat float format to Float3,
the sizes of the shiftVec and fshift buffers were not updated
in OpenCL NBNXM data management, which lead to the buffers being
overallocated. This fixes the issue.

Introduced in c66827166fc9099ecd1a4a2f7080558df70bf529

3 years agoAdd a cool quote from Elvis Presley's song
Artem Zhmurov [Mon, 15 Mar 2021 10:16:45 +0000 (10:16 +0000)]
Add a cool quote from Elvis Presley's song

3 years agoFix clang-format in topio.cpp
Artem Zhmurov [Mon, 15 Mar 2021 09:09:49 +0000 (12:09 +0300)]
Fix clang-format in topio.cpp

Introduced in 0dab36f99294056b33f4ee58383587a82447b9e6

3 years agoFix leak in cpp_opts
Kevin Boyd [Sun, 14 Mar 2021 19:53:15 +0000 (12:53 -0700)]
Fix leak in cpp_opts

Refs #3984

3 years agoUse existing PME f ready event in PmeForceSenderGpu
Szilárd Páll [Fri, 5 Mar 2021 19:29:38 +0000 (20:29 +0100)]
Use existing PME f ready event in PmeForceSenderGpu

Instead of recording internally into the PME stream and sending that
event to the PP rank to sycn on from the separate PME rank, use the
already existing event recorded in PME.
This also eliminates the unnecessary use of multiple events, one for
each PP rank.

Refs #2891 #2915

3 years agoRename launchReceiveCoordinatesFromPpCudaDirect
Szilárd Páll [Sat, 13 Mar 2021 11:05:43 +0000 (11:05 +0000)]
Rename launchReceiveCoordinatesFromPpCudaDirect

The receiveCoordinatesSynchronizerFromPpCudaDirect() method name better
reflects what the code it actually does.

Refs #2891

3 years agoRemove cyclic dependency check from check-source
Paul Bauer [Sat, 13 Mar 2021 08:31:24 +0000 (08:31 +0000)]
Remove cyclic dependency check from check-source

This hasn't been properly checked for a while now and we are planning to
move this to a CMake check anyway.

3 years agoAdd DeviceAccessor<T,read> ctor from const DeviceBuffer<T>
Andrey Alekseenko [Fri, 12 Mar 2021 15:46:48 +0000 (15:46 +0000)]
Add DeviceAccessor<T,read> ctor from const DeviceBuffer<T>

A bit hacky, but better preserves the intent behind declaring
DeviceBuffer const.

Part of preparatory work for #3932.

3 years agoModernize PME GPU timing enums
Paul Bauer [Fri, 12 Mar 2021 11:44:11 +0000 (11:44 +0000)]
Modernize PME GPU timing enums

Part of general modernization of enums to enum classes.
Used enumerationarray in places where it made sense.

3 years agoMove responsibility for GPU force clearing to state propagator
Alan Gray [Fri, 12 Mar 2021 06:52:02 +0000 (06:52 +0000)]
Move responsibility for GPU force clearing to state propagator

Force was previously cleared within GPU force halo exchange which was
quite opaque. Now moved into do_force() and done by state propagator,
to make schedule clearer.

Fixes #3971 and partly addresses #3970

3 years agoUnify insertNonLocalDependency(...) function in NBNXM
Artem Zhmurov [Thu, 11 Mar 2021 20:04:05 +0000 (20:04 +0000)]
Unify insertNonLocalDependency(...) function in NBNXM

Refs #2608

3 years agoSimplify gmx_pme_send_force_vir_ener()
Szilárd Páll [Thu, 11 Mar 2021 10:54:19 +0000 (10:54 +0000)]
Simplify gmx_pme_send_force_vir_ener()

sendFToPP() provided no benfit, so code is merged back into the caller.
Also removed unused send bufer pointers.

3 years agoFix unit test error due to GPU peer access already enabled
Alan Gray [Thu, 11 Mar 2021 09:26:58 +0000 (09:26 +0000)]
Fix unit test error due to GPU peer access already enabled

Fixes #3980

3 years agoFix clang-tidy failures in AWH tests
Artem Zhmurov [Thu, 11 Mar 2021 04:40:32 +0000 (07:40 +0300)]
Fix clang-tidy failures in AWH tests

Commit d4610e91e7815756f728e68785b58b884aead153 introduced a
clang-tidy warning in AWH tests with integer used in place of
bool argument (modernize-use-bool-literals,-warnings-as-errors).
This removes these warnings.

3 years agoProperly check for frozen atoms when disabling GPU update
Andrey Alekseenko [Thu, 11 Mar 2021 05:33:39 +0000 (05:33 +0000)]
Properly check for frozen atoms when disabling GPU update

Follow-up of !1241 (9550c3e8564068c86a0f34baee0f578e8ce6d5a9)

Initially, the check was overly relaxed, and was triggered even when
there were no frozen atoms.

Thanks to @alangray3 for noticing!

3 years agoMake AWH parameters proper C++
Paul Bauer [Wed, 10 Mar 2021 20:06:31 +0000 (20:06 +0000)]
Make AWH parameters proper C++

All structs have been converted to classes with RAII constructors.
Parameter objects can only be constructed from input data or
serializers.

Tests are adapted to use the new constructors, this means some code got
a bit ugly there.

This change is only refactoring, plus adding tests for the
serialization.

3 years agoRename some variables in GPU task assignment and fix their usage
Artem Zhmurov [Wed, 10 Mar 2021 18:34:49 +0000 (18:34 +0000)]
Rename some variables in GPU task assignment and fix their usage

Some variables are oddly named which causes a confusion. This changes
the naming so that it reflects the meaning of the variables. Also,
fixes a miss0use of one of such variables cause by the bad naming.

Fixes #3980
Fixes #3981

3 years agoRework atom locality validity checks
Artem Zhmurov [Wed, 10 Mar 2021 09:43:52 +0000 (12:43 +0300)]
Rework atom locality validity checks

The function that checks the validity of atom locality partly
duplicates its callers logic. The chacks are done naturally in
the callers and the function is used to construct and print
an error message.

3 years agoConvert PmeGpu->kernelParams->atoms.d_forces to RVec
Andrey Alekseenko [Wed, 10 Mar 2021 10:37:52 +0000 (13:37 +0300)]
Convert PmeGpu->kernelParams->atoms.d_forces to RVec

In most other places, forces are in RVec format, while it was float
here. While it is used as float in gather kernels, it is more consistent
to keep the buffer type as RVec.

This change is preparation for adding a SYCL implementation of GPU
update (Issue #3932).

3 years agoRemove param fillLocal, which was always false, from nbnxm call stack
Joe Jordan [Wed, 10 Mar 2021 12:37:49 +0000 (12:37 +0000)]
Remove param fillLocal, which was always false, from nbnxm call stack

Several functions in nbnxm took a bool to determine whether to fill
local atoms with zeros, but the parameter was always set to false.
This is now removed from the function signatures, and some code is
slightly simplified.

3 years agoChange vector references to Arrayref in AWH
Paul Bauer [Wed, 10 Mar 2021 09:39:18 +0000 (10:39 +0100)]
Change vector references to Arrayref in AWH

Preparation for further refactoring.

3 years agoRevert "Wrap more device pointers in DeviceBuffer" (!1244)
Andrey Alekseenko [Wed, 10 Mar 2021 09:06:41 +0000 (09:06 +0000)]
Revert "Wrap more device pointers in DeviceBuffer" (!1244)

This reverts commit 850429f3ebe34d27dabed6d8c31c08968befd1f5,
which broke some MPI functionality, as revealed in post-merge tests.

3 years agoDon't test for pressure in replica exchange regression
Pascal Merz [Wed, 10 Mar 2021 05:58:07 +0000 (22:58 -0700)]
Don't test for pressure in replica exchange regression

Pressure is not reproducible enough to have reliable regression tests.
The failures described in #3976 happen on step 0, so are independent
of replica exchange.

This change replaces testing for the pressure by testing for the
volume, where possible.

Fixes #3976

3 years agoDisable GPU update in the presence of frozen atoms
Andrey Alekseenko [Wed, 10 Mar 2021 05:55:30 +0000 (05:55 +0000)]
Disable GPU update in the presence of frozen atoms

There is a known bug (Issue #3920) affecting GPU update when frozen
atoms are present. While the bug is being resolved, we mark such
configuration as not allowed.

Refs #3920

3 years agoWrap more device pointers in DeviceBuffer
Andrey Alekseenko [Wed, 10 Mar 2021 05:28:27 +0000 (05:28 +0000)]
Wrap more device pointers in DeviceBuffer

Store and pass around more device pointers as DeviceBuffer<T>
instead of as a raw or even void pointer.

Related changes:

- PmeGpu->kernelParams->atoms.d_forces is now RVec, not float. Forces in
  most other places are RVec, so it seems more logical.
- GpuForceReduction::Impl::baseForce_ now stores pointer to the
  beginning of the array, without shift.

3 years agoUnify gpu_copy_xq_to_gpu(...) function
Artem Zhmurov [Tue, 9 Mar 2021 16:17:15 +0000 (19:17 +0300)]
Unify gpu_copy_xq_to_gpu(...) function

Refs. #2608

3 years agoMove radian-angle conversions to math/utility
ejjordan [Tue, 9 Mar 2021 15:16:05 +0000 (16:16 +0100)]
Move radian-angle conversions to math/utility

The constant M_PI is always defined there, and conversion is more
properly a utility than a unit.

3 years agoUse constexpr for physical constants and move them into gmx namespace
Joe Jordan [Tue, 9 Mar 2021 14:33:55 +0000 (14:33 +0000)]
Use constexpr for physical constants and move them into gmx namespace

The physical constants that are part of the public API are converted from
defines to constexprs and are moved into the gmx namespace. This means
that many files are touched with tirvial changes. The benefit is that
now the risk of symbol collision is reduced in cases where a library
might depend on these constants.

Additionally, in the same vein of library cleanup, the math/utility
header is removed from units header and included only in the sources
that actually need it.

3 years agoFix missing stdint.h
Paul Bauer [Tue, 9 Mar 2021 13:37:55 +0000 (13:37 +0000)]
Fix missing stdint.h

MSVC complained about missing definitions for int64_t because stdint.h was
not included.

3 years agoRevert "Use std::aligned_alloc"
Mark Abraham [Mon, 8 Mar 2021 09:24:30 +0000 (10:24 +0100)]
Revert "Use std::aligned_alloc"

This C++17 library capability is not yet available on Windows or Mac.

This reverts most of commit 768894fb93bb03a6972b10a8c930b1d1f64221c3.
Incidental aspects of that commit have not been reverted,
specifically, where unused header inclusions and unused functions were
removed.

Fixes #3968

3 years agoUse map to speed up PreprocessingAtomTypes::atomTypeFromName
Andrey Alekseenko [Mon, 8 Mar 2021 16:38:32 +0000 (16:38 +0000)]
Use map to speed up PreprocessingAtomTypes::atomTypeFromName

Previously, we were doing O(numExistingTypes) string comparisons in
PreprocessingAtomTypes::atomTypeFromName.

This significantly slowed down print_bonded function from toputil.cpp,
and, consequently, the pdb2top.

Here, we add an unordered map to store the mapping from type name to
type number, making the whole search O(log(numExistingTypes)), and
avoiding constantly constructing new std::string's from char*'s.

On my machine, this change reduced run time of Pdb2gmx3Test test from ~8
seconds to ~2 seconds.

Closes #3974

3 years agoRemove includes from math/utilities that are not needed there
ejjordan [Mon, 8 Mar 2021 08:15:05 +0000 (09:15 +0100)]
Remove includes from math/utilities that are not needed there

Neither of the include statements in math/utilities were actually needed there.

3 years agoFix "wait before marking" synchronization bug
Andrey Alekseenko [Fri, 5 Mar 2021 15:37:51 +0000 (18:37 +0300)]
Fix "wait before marking" synchronization bug

We did not initiate a D2H copy of coordinates when doing a neighbor
search but were anyway waiting on the associated event.

Unlikely that it had any negative consequences, but that's still a logic
bug.

3 years agoFix clang-tidy complaint failing our CI lint test
Andrey Alekseenko [Sat, 6 Mar 2021 14:01:57 +0000 (17:01 +0300)]
Fix clang-tidy complaint failing our CI lint test

The complaint was about non-const reference, but I also changed an
uninitialized variable nearby.

3 years agoFix typo introduced during nbfp_comb refactoring
Andrey Alekseenko [Fri, 5 Mar 2021 17:45:18 +0000 (20:45 +0300)]
Fix typo introduced during nbfp_comb refactoring

d440c46ef06c3a4c1695e3ec37e7e108ab7a2817 introduced a bug in OpenCL
NBXNM kernel.

Refs 3973

3 years agoClarify the SYCL subgroup size on different targets
Szilárd Páll [Fri, 5 Mar 2021 16:18:45 +0000 (16:18 +0000)]
Clarify the SYCL subgroup size on different targets

Also added some doxygen.

Refs #3934

3 years agoRemove physical constant enums
Paul Bauer [Fri, 5 Mar 2021 15:01:47 +0000 (15:01 +0000)]
Remove physical constant enums

Those have not been used anywhere.

Removed unused conversion functions.

Noted change in release notes API section.

3 years agoFix clang-format and naming of static variable
Mark Abraham [Fri, 5 Mar 2021 11:46:51 +0000 (11:46 +0000)]
Fix clang-format and naming of static variable

3 years agoIntroduce StringToEnumValue
Mark Abraham [Fri, 5 Mar 2021 08:02:59 +0000 (08:02 +0000)]
Introduce StringToEnumValue

This helper functor seems useful in a few places. Adds tests and
improves documentation.

Fixes #3963

3 years agoModernize AWH enumerations
Paul Bauer [Thu, 4 Mar 2021 08:39:30 +0000 (09:39 +0100)]
Modernize AWH enumerations

Changed enums to enum classes.
Use EnumerationArray for strings.

3 years ago Simplify LJ parameter lookup
Szilárd Páll [Thu, 4 Mar 2021 08:08:51 +0000 (08:08 +0000)]
 Simplify LJ parameter lookup

  - Unify the CUDA per-pair scaled C6/C12 LJ parameter
    loading codepaths so both texture and LDG paths do
    8-byte float2 loads.
  - Unify the CUDA per-atom LJ parameter loading codepaths
    so both texture and LDG paths do 8-byte float2 loads.
  - Simplify the LJ self interaction energy term calculation
    by only using the non-texture loads path to simplify code.
    As this is outside the main loop, its impact is negligible.
  - Use float2 loads for the above in OpenCL as well.

3 years agoCheck version names to be correct for release
Paul Bauer [Wed, 3 Mar 2021 18:52:43 +0000 (18:52 +0000)]
Check version names to be correct for release

Adds a check during release verification that the version names coming
from CMake and the actual name in the binary match.

Prevents issues with calculation of verified checksum.

Refs #3862

3 years agoCreate a documentation section for GitLab Label guidelines.
M. Eric Irrgang [Wed, 3 Mar 2021 14:05:32 +0000 (14:05 +0000)]
Create a documentation section for GitLab Label guidelines.

Also rename `gitlab.rst` to `gitlab-ci.rst` since we are starting
to document non-CI GitLab-related information in various places,
making `gitlab.rst` a misleading name.

Fixes #3949

3 years agoRemove PDO reading from gmx wham
Mark Abraham [Wed, 3 Mar 2021 08:56:19 +0000 (08:56 +0000)]
Remove PDO reading from gmx wham

These files were written by gmx 3.x, so likely nobody has any left
that they care about. Subsequent versons of GROMACS can still read
them if anybody does still have them. Meanwhile, we can simplify gmx
wham by removing this support, which was deprecated in GROMACS 2021.

3 years agoModernize atom enums
Paul Bauer [Tue, 2 Mar 2021 15:34:21 +0000 (15:34 +0000)]
Modernize atom enums

Use enum classes and enumeration array for particle and PDB record
types.

3 years agoFix nightly clang-tidy build
Paul Bauer [Tue, 2 Mar 2021 13:01:28 +0000 (14:01 +0100)]
Fix nightly clang-tidy build

Function signatures had not been correctly updated.

3 years agoUse optional instead of magic numbers in preprocessing
Paul Bauer [Tue, 2 Mar 2021 13:13:38 +0000 (13:13 +0000)]
Use optional instead of magic numbers in preprocessing

Replaced the NOTUSED magic numbers in the atom type preprocessing
functions with optionals to indicate that an entry was found or not.

Needed for modernizing the particle type and pdb record type enums
further along.

3 years agoUse std::aligned_alloc
Mark Abraham [Tue, 2 Mar 2021 08:18:02 +0000 (08:18 +0000)]
Use std::aligned_alloc

There is no longer any need to write our own code to allocate aligned
memory, as the C++ standard library provides a function to do that.

Relaxed some comments on our allocators as it is now technically
possible to free such memory with std::free.

Removed related configuration infrastructure that is no longer
required.

Also removed the unused gmx_pause, which shared some of that
infrastructure, and so was able to reduce the include requirements of
gmxomp.h header file.

3 years agoSet up build with hipSYCL
Andrey Alekseenko [Tue, 2 Mar 2021 07:30:21 +0000 (07:30 +0000)]
Set up build with hipSYCL

The kernel code is currently non-functional on NVIDIA/AMD hardware, but
the build itself is useful to ensure code portability.

- Disabled LeapFrog for hipSYCL. With `float3` being used in the host
  code, it is easiest to just disable the integrator until #3312 is
  resolved. This will have to be resolved in order to run full MD loop
  on GPU with hipSYCL. See #3941.

- Some warnings from the compiler and include headers silenced.

- Workarounds for features not supported by hipSYCL are introduced.
- - Shuffles. Should work, but not tested. Hopefully, they will be
    introduced in the mainline hipSYCL soon.
- - Barrier synchronization. Intel-specific extension to SYCL which can
    be imitated fairly well with native OpenCL/CUDA calls, but is
    stubbed very stupidly now. Proper solution will be done after #2527
    and #3924 are resolved.

- CI jobs are added. The set of target device architectures is chosen
  semi-arbitrarily, since the code is not being run yet anyway. Main
  concern was to have both HIP and CUDA there.

Refs #3923.

3 years agoUse const ref for mtop and inputrec in EnergyOutput initialization
Joe Jordan [Mon, 1 Mar 2021 08:14:16 +0000 (08:14 +0000)]
Use const ref for mtop and inputrec in EnergyOutput initialization

Some renaming for ir to inputrec is also done.

3 years agoUse more const ref in domdec API
Joe Jordan [Sun, 28 Feb 2021 14:10:06 +0000 (14:10 +0000)]
Use more const ref in domdec API

Several places that were using const pointers are changed to use
const refs. A few gmx_bool are replaced with bool as well.

3 years agoAdd coverage build to post merge
Paul Bauer [Fri, 26 Feb 2021 14:36:45 +0000 (14:36 +0000)]
Add coverage build to post merge

Every merged commit will be checked for changes to code coverage with
this addition.

Small change to flags added when building for coverage.

Build can be extended for other metrics later as well.

3 years agoOnly use const ref for mtop and inputrec in domdec
Joe Jordan [Fri, 26 Feb 2021 14:02:54 +0000 (14:02 +0000)]
Only use const ref for mtop and inputrec in domdec

All const pointers of mtop and inputrec in domdec module are
converted to const refs. Additionally, since inputrec lines need
to change anyway, renaming from ir to inputrec is performed.

3 years agoAdd device-to-device copy function wrapper with tests in CUDA
Artem Zhmurov [Wed, 24 Feb 2021 21:44:28 +0000 (00:44 +0300)]
Add device-to-device copy function wrapper with tests in CUDA

The D2D copy is currently only used in CUDA, so only stubs are added for OpenCL and SYCL.

Closes #3321

Refs #3318

3 years agoDeprecate gmx::Any
Mark Abraham [Thu, 25 Feb 2021 10:49:13 +0000 (11:49 +0100)]
Deprecate gmx::Any

Refs #3951

3 years agoIntroduce GTest regression tests for replica exchange
Pascal Merz [Fri, 26 Feb 2021 12:31:41 +0000 (12:31 +0000)]
Introduce GTest regression tests for replica exchange

This introduces regression tests within the GTest framework for
replica exchange simulations. These tests are restricted to 4
MPI ranks, used as either 2 replicas with 2 ranks each (using
the DD code path), or 4 replicas with 1 rank each (using code
paths used by multiple replicas). As the reference data would
be different for each combination of number of ranks / number
of simulations, this is restricted to a few setups to keep the
reference data manageable.

The tests are run with integrator `md` using v-rescale and
Nose-Hoover thermostats and c-rescale and parrinello-rahman
barostats, covering the thermodynamically correct temperature
and pressure control algorithms. The tests are also run with
integrator `md-vv`, Nose-Hoover thermostat and no barostat
to cover the Trotter decomposition code path (MTTK barostat
would require a different system because it doesn't work
with constraints, and it's not obvious that it would actually
increase code coverage significantly).

Refs #3918

3 years agoIncrease multsim test flexibility, test multisim + DD
Pascal Merz [Thu, 25 Feb 2021 20:08:52 +0000 (20:08 +0000)]
Increase multsim test flexibility, test multisim + DD

This increases the flexibility of the multisim testing infrastructure
by allowing to parametrize it for number of ranks per simulation,
integrator algorithm, and temperature and pressure coupling.

The multisim tests are also extracted into a separate test binary,
allowing to use a different MPI setup than the remaining MPI tests.

Finally, the flexibility is used to introduce multisim tests which
use domain decomposition in the respective single simulations.

Refs #3918

3 years agoFix testing of positions against reference data
Pascal Merz [Tue, 23 Feb 2021 02:15:43 +0000 (19:15 -0700)]
Fix testing of positions against reference data

When applying PBC to positions before comparing them to reference
data, a returned std::vector was assigned to an ArrayRef. This lead
to undefined values being compared. Position comparison against reference
data is currently unused, so this did not lead to any failing tests.

3 years agoAdd tests on asynchronous host-to-device copy and back
Artem Zhmurov [Wed, 24 Feb 2021 19:24:01 +0000 (19:24 +0000)]
Add tests on asynchronous host-to-device copy and back

The copy routines take different paths depending on transfer kind,
hence both sync and async copy should be tested. This adds tests
for async calls.

3 years agoRework state checkpoint enum handling
Paul Bauer [Wed, 24 Feb 2021 17:05:57 +0000 (17:05 +0000)]
Rework state checkpoint enum handling

The state enumerations have been changed to enum classes and enumeration
arrays. This was required by clang-tidy to remove the global available char
arrays.

Added templated function to convert enum to underlying int.

Was able to simplify quite a lot of the checkpoint handling that had to
work around the pure ints used before the enumerations to get the
correct names for the entries.

3 years agoUse GpuTimers in CUDA and OpenCL versions of NBNXM directly
Artem Zhmurov [Wed, 24 Feb 2021 13:42:23 +0000 (16:42 +0300)]
Use GpuTimers in CUDA and OpenCL versions of NBNXM directly

The GpuTimers are used through proxy objects in OpenCL and CUDA
versions of NBNXM, which complicates the unification of the code.
This change eliminates the proxy object by using the underlying
object directly.

Refs #2608

3 years agoFix multi-sim checkpoint writing bug
Pascal Merz [Fri, 19 Feb 2021 06:10:54 +0000 (23:10 -0700)]
Fix multi-sim checkpoint writing bug

In rare cases (when a checkpoint file existed on at least one multisim
rank but not on all), checkpoint writing with multiple simulation could
cause the ranks to get out of sync. This fixes the problem by moving
the barrier outside of the relevant if clause, making sure that it
is hit by all ranks.

Fixes #3919

3 years agoUse verbose names in init_forcerec
Joe Jordan [Tue, 23 Feb 2021 13:10:31 +0000 (13:10 +0000)]
Use verbose names in init_forcerec

3 years agoFix doxygen in domdec
Artem Zhmurov [Tue, 23 Feb 2021 11:09:57 +0000 (14:09 +0300)]
Fix doxygen in domdec

e2adf21a8c2ed0f6a8e1e590e3a12a099a6ebe24 was merged before all
Doxygen warnings got fixed. This fixes them.

3 years agoUse getAtomRanges(...) function in NBNXM more
Artem Zhmurov [Mon, 22 Feb 2021 18:27:08 +0000 (21:27 +0300)]
Use getAtomRanges(...) function in NBNXM more

Make getAtomRanges(...) function to return gmx::Range and
use it more.

Refs #2608

3 years agoHide newly exposed domdec internals
Mark Abraham [Mon, 22 Feb 2021 12:54:38 +0000 (13:54 +0100)]
Hide newly exposed domdec internals

By declaring the top-level destructor, we avoid needing to expose
details so the compiler has to generate the destructor everywhere.

Fixes #3926

3 years agoHold unique_ptr to gmx_ewald_tab_t in forcerec
Joe Jordan [Mon, 22 Feb 2021 19:00:38 +0000 (19:00 +0000)]
Hold unique_ptr to gmx_ewald_tab_t in forcerec

Proper constructor and destructor are added. The field eir, which
was anyway recomputed with every call to do_ewald, is removed from
the struct and made local to do_ewald. Since the type cvec is only
used by eir, it is moved to reside in ewald.cpp.

3 years agoHold unique_ptr for interaction_const in forcerec
Joe Jordan [Mon, 22 Feb 2021 17:35:53 +0000 (17:35 +0000)]
Hold unique_ptr for interaction_const in forcerec

Also renamed ic->interactionConst in init_interactionConst.

3 years agoFix code so clang-tidy no longer complains
Mark Abraham [Mon, 22 Feb 2021 12:29:43 +0000 (13:29 +0100)]
Fix code so clang-tidy no longer complains

3 years agoremove InteractionLocality from PairListSet constructor
ejjordan [Sun, 21 Feb 2021 18:47:09 +0000 (19:47 +0100)]
remove InteractionLocality from PairListSet constructor

The InteractionLocality is removed as a member from PairListSet
and is no longer passed to the constructor, but instead to
PairListSets::construct. This will make it easier to remove the
explicit dependence on domdec_zones in nbnxm module.

3 years agoUnify NB atoms and staging data structures in OpenCL, CUDA and SYCL
Artem Zhmurov [Mon, 22 Feb 2021 14:15:16 +0000 (14:15 +0000)]
Unify NB atoms and staging data structures in OpenCL, CUDA and SYCL

Refs #2608

3 years agoRemove raw pointer to gmx_reverse_top
Paul Bauer [Mon, 22 Feb 2021 12:00:03 +0000 (12:00 +0000)]
Remove raw pointer to gmx_reverse_top

Changed the underlying type to an unique_ptr and changed the type to an
impl struct to make this possible. This removes the memory leak found
there.

3 years agoReduce use of gmx_domdec_t in domdec_topology.cpp
Berk Hess [Mon, 22 Feb 2021 10:15:48 +0000 (11:15 +0100)]
Reduce use of gmx_domdec_t in domdec_topology.cpp

3 years agoRefactor md_enums
Paul Bauer [Mon, 22 Feb 2021 10:24:36 +0000 (10:24 +0000)]
Refactor md_enums

The old enum handling caused clang-tidy to complain about the globally
defined symbols for the enum strings, and also violated type safety by
using the enums both as enumerations and integers.

Changed all exposed enum strings and their corresponding char arrays
to classes and enumeration arrays.

Used enumeration array in a few places where it made sense to me.

Was not able to get rid of some instances where the enum to integer
conversion was abused.

Moved enum reading template to header to have it available for reading
all enums.

3 years agoAdd FloatN aliases to OpenCL and use them in NBNXM
Artem Zhmurov [Mon, 22 Feb 2021 09:43:43 +0000 (09:43 +0000)]
Add FloatN aliases to OpenCL and use them in NBNXM

These aliases are nessesary to unify OpenCL, CUDA and SYCL
code.

Refs #3312, #2608, #3311

3 years agoAdd FloatN aliases to CUDA and use them in NBNXM
Artem Zhmurov [Sat, 20 Feb 2021 08:12:02 +0000 (11:12 +0300)]
Add FloatN aliases to CUDA and use them in NBNXM

These aliases are nessesary to unify OpenCL, CUDA and SYCL
code.

Refs #3312, #2608, #3311

3 years agoRename our SYCL aliases floatN to FloatN
Andrey Alekseenko [Thu, 18 Feb 2021 10:09:14 +0000 (13:09 +0300)]
Rename our SYCL aliases floatN to FloatN

Main reasons:

- Clearly separate our types (or aliases) from native types. This will
  likely make later changes (e.g., in scope of #3312) easier.
- Enable hipSYCL build by avoiding clashes of multiple floatN in the
  global namespace.

Refs #3312, #3923

3 years agoSet temperature scaling groups upon construction of integrator
Artem Zhmurov [Sat, 20 Feb 2021 22:48:03 +0000 (22:48 +0000)]
Set temperature scaling groups upon construction of integrator

The temperature scaling parameters do not change, so can be
set upon construction of the integrator object.

Closes #3794

3 years agoRemove unsed structs from nblist and use vector in t_nblist
Joe Jordan [Sat, 20 Feb 2021 08:52:44 +0000 (08:52 +0000)]
Remove unsed structs from nblist and use vector in t_nblist

Several unused structs are removed from nblist.h. Some unused members of
t_nblist are removed, and pointers are changed to vectors.

3 years agoRevome unused code from nsgrid
Joe Jordan [Fri, 19 Feb 2021 20:33:04 +0000 (20:33 +0000)]
Revome unused code from nsgrid

In addition to removing several functions that are not used,
some unused parameters from the t_grid struct are removed.