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

3 years agoAdd unit test for 1-4 interactions.
Sebastian Kehl [Thu, 1 Apr 2021 14:38:08 +0000 (14:38 +0000)]
Add unit test for 1-4 interactions.

3 years agoRemove dead code in sasa module
Paul Bauer [Thu, 1 Apr 2021 11:09:19 +0000 (13:09 +0200)]
Remove dead code in sasa module

If needed, the code can be found again in git.

3 years agoMake EnumerationArray::size() not static
Mark Abraham [Wed, 31 Mar 2021 08:31:48 +0000 (10:31 +0200)]
Make EnumerationArray::size() not static

It's formally correct that the method can be static, but this makes
code more complex at the point of use for the doubtful benefit of
making clear to the human reader that the value returned by size() is
a compile-time constant. The compiler can always see it.

3 years agoArrayRefs and const refs in global_stat
Joe Jordan [Wed, 31 Mar 2021 16:10:35 +0000 (16:10 +0000)]
ArrayRefs and const refs in global_stat

Use const refs where possible in global_stat. Use ArrayRef for
signalBuffer and return an int instead of passing pointer to int.
Also movemost variable definitions to closer to their first use.

3 years agoUse EnumerationArray for pull isAngleType
Berk Hess [Wed, 31 Mar 2021 13:54:14 +0000 (13:54 +0000)]
Use EnumerationArray for pull isAngleType

3 years agoRemove PME coordinate send code duplication
Alan Gray [Thu, 25 Feb 2021 13:23:11 +0000 (05:23 -0800)]
Remove PME coordinate send code duplication

Unifies codepath for PME coordinate send for default and GPU direct
codepaths. The only effect this has on ordering of activities is for a
run config with GPU buffer ops, without GPU direct communication and
without GPU update, where the (CPU-side) PME-PP coordinate transfer
will now be slightly delayed to allow for an H2D launch of coordinate
data.

Partly addresses #3914

3 years agoMove cluster methods to its own file
Paul Bauer [Wed, 31 Mar 2021 11:18:01 +0000 (11:18 +0000)]
Move cluster methods to its own file

Breaks out some of the methods in gmx cluster into a separate file
before future refactoring.

Refs #4000

3 years agoFix doxygen for updateMDLeapfrogGeneral
ejjordan [Wed, 31 Mar 2021 08:35:55 +0000 (10:35 +0200)]
Fix doxygen for updateMDLeapfrogGeneral

Fixes an issue created in !1350.

3 years agoUse more ArrayRefs in signatures of update impl class
Joe Jordan [Wed, 31 Mar 2021 08:30:23 +0000 (08:30 +0000)]
Use more ArrayRefs in signatures of update impl class

Part of ongoing work to make refactoring mdatoms easier. This only
changes the impl class of update. A followup change can propagate
using ArrayRef to the update class itself, which will make it easier
to call update in both tests and in nblib.

3 years agoUse using for ArrayRef and RVec in pull code
Berk Hess [Tue, 30 Mar 2021 20:28:52 +0000 (22:28 +0200)]
Use using for ArrayRef and RVec in pull code

3 years agoUnify gpu_free(...) function in OpenCL, CUDA and SYCL versions of NBNXM
Artem Zhmurov [Tue, 30 Mar 2021 15:08:15 +0000 (18:08 +0300)]
Unify gpu_free(...) function in OpenCL, CUDA and SYCL versions of NBNXM

Refs #2608

3 years agoFix conditional on when DtoH forces copy occur
Artem Zhmurov [Wed, 31 Mar 2021 00:30:33 +0000 (00:30 +0000)]
Fix conditional on when DtoH forces copy occur

d2d4a50b4c636c203028c5bff311924ec15e7825 introduced performance
regression with forces copied from device to host on each step.
This fixes the issue by reinstantiating proper condition on the
copy call.

Fixes #4001
Refs #2608

3 years agoMove dynamic pull groups and pull nthreads
Berk Hess [Tue, 30 Mar 2021 20:21:13 +0000 (20:21 +0000)]
Move dynamic pull groups and pull nthreads

Moved dynamic pull groups into their respective coordinates.
Set the number of threads per pull group instead of globally.
Now all thread parallel regions run on 1 thread with less than 100
local atoms.

3 years agoUse default constructor for the device buffers that can be uninitialized
Artem Zhmurov [Tue, 30 Mar 2021 14:44:12 +0000 (17:44 +0300)]
Use default constructor for the device buffers that can be uninitialized

Some buffers in NBNXM are initialized conditionally, which posseses
a problem for the OpenCL kernel jit compilation, where these buffers
are used as arguments.

Refs #2608

3 years agoFix some include guards in gmx ana
Paul Bauer [Tue, 30 Mar 2021 12:43:24 +0000 (14:43 +0200)]
Fix some include guards in gmx ana

Clang tidy would complain about the defines starting with _.

3 years agoAllow the use of only one backend at a time with SYCL-DPCPP
Andrey Alekseenko [Tue, 30 Mar 2021 12:39:45 +0000 (12:39 +0000)]
Allow the use of only one backend at a time with SYCL-DPCPP

This is not a hard requirement; multiple backends can be used together
just fine.

But in DPCPP, the same physical device can appear as different virtual
devices provided by different backends (e.g., the same GPU can be accessible
via both OpenCL and L0).
Thus, using devices from two backends is more likely to be a user error than
the desired behavior. In this function, we choose the backend with the most compatible
devices. In case of a tie, we choose OpenCL (if present), or some arbitrary backend
among those with the most devices.

In hipSYCL, the problem of using the same device twice is unlikely to manifest.
It has (as of 2021-03-03) another issues: D2D copy between different backends
is not allowed. We don't use D2D in SYCL yet. Additionally, hipSYCL does not implement
the `sycl::platform::get_backend()` function.

Thus, we only do the backend filtering with DPCPP to keep the code
simple.

If needed, the `GMX_GPU_DISABLE_COMPATIBILITY_CHECK` might be used to
disable this limitation, or a backend-specific device filtering (e.g.,
`SYCL_BE` and `SYCL_DEVICE_FILTER`) can be used to only
provide the desired backend.

3 years agoTurn t_forcerec.shift_vec into an std::vector of gmx::RVec
kanduri [Tue, 30 Mar 2021 11:53:51 +0000 (11:53 +0000)]
Turn t_forcerec.shift_vec into an std::vector of gmx::RVec

Change function signatures so that call sites have minimal changes

3 years agoAdd coordIndex to t_pull_coord
Berk Hess [Tue, 30 Mar 2021 10:15:43 +0000 (10:15 +0000)]
Add coordIndex to t_pull_coord

The pull coordinate index is an integral part of a pull coordinate
and can not be changed. Thus it can be part of t_pull_coord which
allows avoiding index passing in several functions.

3 years agoMove responsibility for checking bondeds in reverse topology
Mark Abraham [Tue, 30 Mar 2021 09:44:29 +0000 (09:44 +0000)]
Move responsibility for checking bondeds in reverse topology

The reverse topology is a data structure distributed across all
domains that should refer exactly once to all bonded interactions
present in the global topology. We check that this is true at run
time, but need a complex implementation to avoid doing extra
collective communication that supports running what is effectively an
assertion that the reverse topology construction is correct.

Past attempts to improve this (e.g. 8b6c99a1) left the code in an
intermediate state where the responsibility for this check was mostly
implemented in do_md rather than compute_globals. That gave the
impression of compute_globals() returning an integer
parameter. However as above it's really an implementation detail of a
check of the reverse topology, and so the logic and memory for that
check should be in the domain decomposition module and object.

This change move the details of that check to the rest of the code
that handles the reverse topology. It renames several variables and
adds documentation for them.

This simplifies parts of the implementation of the modular simulator,
and prepares for implementing the proposal for #3887 by making all
outputs from global reduction local to the module that consumes them.

Refs #3421
Refs #3887

3 years agoAdd tests for calcvir
Joe Jordan [Mon, 29 Mar 2021 13:03:56 +0000 (13:03 +0000)]
Add tests for calcvir

3 years agoFix webpage build
Andrey Alekseenko [Mon, 29 Mar 2021 10:43:47 +0000 (13:43 +0300)]
Fix webpage build

MR !1235 (dff1d7e309eb751b6b7585853501c544919db59f) had a missing empty
line, which upset Sphinx.

3 years agoAvoid unnecessary CPU force buffer clearing
Alan Gray [Mon, 29 Mar 2021 11:12:25 +0000 (11:12 +0000)]
Avoid unnecessary CPU force buffer clearing

Only clear CPU force buffers on steps that actually use the buffers.

Partly addresses #3970

3 years agoMove nsgrid header/source from mdlib to domdec
Joe Jordan [Mon, 29 Mar 2021 08:35:17 +0000 (08:35 +0000)]
Move nsgrid header/source from mdlib to domdec

The function get_nsgrid_boundaries is only called in domdec module
so it should live there. Removed an unused constant and moved another
to the source which is the only consumer. Also removed a todo which
no longer makes sense.