alexxy/gromacs.git
3 years agoMore const in edsam functions
ejjordan [Wed, 17 Feb 2021 07:52:18 +0000 (08:52 +0100)]
More const in edsam functions

In addition to increasing const correctness in edsam functions,
some additional minor cleanup is also done.

3 years agoUse const ref to mtop in init_forcerec
ejjordan [Tue, 16 Feb 2021 17:01:11 +0000 (18:01 +0100)]
Use const ref to mtop in init_forcerec

Also lower level function, which are currently static, are
refactored to take a const ref to mtop. This will make exposing
those lower level functions safer.

3 years agoSupport checking event status in GpuEventSynchronizer
Szilárd Páll [Thu, 11 Feb 2021 10:57:05 +0000 (11:57 +0100)]
Support checking event status in GpuEventSynchronizer

This commit adds an isReady() method that allows checking whether
the event has been triggered (or in SYCL associated barrier task has
completed).
The primary aim is porting the nbnxm module to the unified GPU layer.

Implements part of #2527

3 years agoFix clang-tidy-11 errors in NBNXM module, part 5
Andrey Alekseenko [Tue, 16 Feb 2021 15:13:56 +0000 (15:13 +0000)]
Fix clang-tidy-11 errors in NBNXM module, part 5

Refs #3897

3 years agoAdd support for Clang-CUDA 11.x and a post-merge CI build
Andrey Alekseenko [Tue, 16 Feb 2021 14:16:02 +0000 (14:16 +0000)]
Add support for Clang-CUDA 11.x and a post-merge CI build

Tested mostly with Clang-11 and CUDA-11.2

While Clang does not officially support CUDA after 10.1, it appears to
work fine with newer versions.

Caveat: Clang fails to properly detect CUDA versions past 10.2

This can be worked around by creating `/usr/local/cuda/version.txt`
file with the single line `CUDA Version X.Y.Z`.

Despite the workaround above, Clang:
- does not recognize sm_86.
- recognizes sm_80, but believes that the installed CUDA version
  is too old to support it.

3 years agoUse const ref to inputrec in do_force
Joe Jordan [Tue, 16 Feb 2021 13:43:14 +0000 (13:43 +0000)]
Use const ref to inputrec in do_force

Inputrec can be const at the level of do_force and below. This
will make subsequent refactorings in, e.g. setup code called
within do_force, easier.

3 years agoAdd container with LLVM 11, CUDA 11.2.1, hipSYCL
Andrey Alekseenko [Tue, 16 Feb 2021 13:01:05 +0000 (13:01 +0000)]
Add container with LLVM 11, CUDA 11.2.1, hipSYCL

- Introduce the option to add hipSYCL to a CI container.
- - Version is specified by commit SHA, because the latest stable
    release (0.9.0) is too old.
- - hipSYCL requires llvm-dev packages for compilation. This bloats the
    size of the image, but is much easier to manage than installing CUDA
    and ROCm into a temporary container.
- Add workarounds for known Clang limitations when dealing with the latest
  versions of CUDA (11.0-11.2.1) and ROCm (3.9-4.0).
- - Is also allows using cuda-clang build with CUDA 11.
- Add a new image to the admin/containers/buildall.sh:
- - Ubuntu 20.04, Clang 11, CUDA 11.2.1, hipSYCL develop.

3 years agoIntroduce virtual sites test
Pascal Merz [Tue, 16 Feb 2021 08:47:10 +0000 (08:47 +0000)]
Introduce virtual sites test

The virtual site tests contain two parts:

1. A reference implementation. The virtual sites code in mdrun is
   difficult to unit-test, since the function calls require data
   structures which are not available in our current testing
   framework. To circumvent that problem, a reference implementation
   is introduced in the tests. The reference implementation can be
   unit-tested, and can be compared to end-to-end mdrun output,
   which leads to a situation comparable to having unit and end-to-end
   tests for the virtual sites implementation. Additionally, the
   reference implementation is simplified and kept close to the
   analytical formulas, which makes verification by eye easier. The
   current unit tests compare the position calculation to the velocity
   calculation, ensuring that the latter is indeed the derivative of
   the first. Additional unit tests could be addded.

2. End-to-end tests. This ensures that all virtual site types can be
   run, and that the trajectory of the virtual site matches the
   trajectory of the real sites, using the reference implementation.
   These tests check that the mdrun implementation agrees with the
   reference implementation, and that real and virtual site reporting
   does not get out of sync.

Note that the reference implementation also includes virtual velocities,
which are, however, not used to test simulation output yet. This will
be introduced once the new velocity definitions are implemented in
mdrun.

Refs #3866

3 years agoRework SYCL CMake machinery to be compatible with hipSYCL
Andrey Alekseenko [Mon, 15 Feb 2021 19:31:21 +0000 (22:31 +0300)]
Rework SYCL CMake machinery to be compatible with hipSYCL

Unlike DPCPP, hipSYCL (and ComputeCPP) offer its own CMake package.
This package has a nice `add_sycl_to_target` function to indicate which
source files must be compiled with SYCL and which target must be linked
with appropriate libraries.

Such function is rather trivial for DPCPP, so, in the interest of
homogeneity, we add it here.

3 years agoMake the restraint history const during force calculation
Pascal Merz [Sun, 14 Feb 2021 20:19:32 +0000 (13:19 -0700)]
Make the restraint history const during force calculation

The history is updated later, and is read-only within the force
routines. Adds a few const qualifiers to clarify this.

Refs #3430

3 years agoFix clang-tidy-11 for topology module
Paul Bauer [Mon, 15 Feb 2021 09:45:02 +0000 (09:45 +0000)]
Fix clang-tidy-11 for topology module

Part of updates for clang-tidy changes to require variable
initialization.

3 years agoExpose mk_nbfp and make_ljpme_c6grid.
Sebastian Kehl [Mon, 15 Feb 2021 08:42:56 +0000 (09:42 +0100)]
Expose mk_nbfp and make_ljpme_c6grid.

Expose mk_nbfp and make_ljpme_c6grid from 'mdlib/forcerec.cpp'
in 'mdlib/forcerec.h'.

Thereby rename:
mk_nbfp           -> makeNonBondedParameterLists
make_ljpme_c6grid -> makeLJPmeC6GridCorrectionParameters

3 years agoFix release docs build
Paul Bauer [Fri, 12 Feb 2021 09:45:15 +0000 (10:45 +0100)]
Fix release docs build

The change to python handling for the documentation build was not
propagated to the release builds.

3 years agoFix leaked memory created in make_ljpme_c6grid.
Sebastian Kehl [Fri, 12 Feb 2021 19:24:47 +0000 (19:24 +0000)]
Fix leaked memory created in make_ljpme_c6grid.

3 years agoAdd gmx::isPowerOfTwo function
Andrey Alekseenko [Fri, 12 Feb 2021 15:42:10 +0000 (15:42 +0000)]
Add gmx::isPowerOfTwo function

A follow-up from a discussion in !1080.

3 years agoMerge branch release-2021 into master
Mark Abraham [Fri, 12 Feb 2021 14:24:31 +0000 (15:24 +0100)]
Merge branch release-2021 into master

No content, because that was accidentally squashed into commit
a660b04e8d8756ed9c4d.

3 years agoRemove unused function
Paul Bauer [Fri, 12 Feb 2021 09:48:26 +0000 (10:48 +0100)]
Remove unused function

This was leftover from the tree-reduce algorithm removal.

3 years agoImprove CUDA codegen flags
Mark Abraham [Fri, 12 Feb 2021 13:02:37 +0000 (13:02 +0000)]
Improve CUDA codegen flags

- onnly generate PTX for an early and the latest arch (3.5 and 8.0)
- add binary 8.0 and 8.6 targets

3 years agoMove virtual site calculation
Pascal Merz [Fri, 12 Feb 2021 08:02:58 +0000 (08:02 +0000)]
Move virtual site calculation

The previous implementation would lead to slight inaccuracies when
virtual positions were calculated before shifting positions in
pressure coupling algorithms. This change moves the calculation to the
top of the loop, right before DD and force calculation.

This also removes an unnecessary call to the virtual site construction
in rerun. That call was placed after force calculation and trajectory
writing, so had no influence since coordinates for the next step are
read from file. Since virtual sites are constructed when reading
coordinates from file, the results should have been correct anyway, the
call just had no influence.

This also moves the call to the virtual site construction in MiMiC.
Similar to the rerun case, the current call happened after virtual
sites are used. This call has been moved to right after the coordinates
are received. This is likely to have lead to wrong results when using
MiMiC with virtual sites.

Refs #3866

3 years agoUse unique_ptr for tables
Joe Jordan [Thu, 11 Feb 2021 18:21:13 +0000 (18:21 +0000)]
Use unique_ptr for tables

Instead of returning a raw pointer, make_tables now returns a unique_ptr.

3 years agoFix clang-tidy-11 errors in NBNXM module, part 3
Andrey Alekseenko [Thu, 11 Feb 2021 13:49:29 +0000 (13:49 +0000)]
Fix clang-tidy-11 errors in NBNXM module, part 3

Refs #3897

3 years agoDisable cos acceleration for non leap-frog code paths
Pascal Merz [Thu, 11 Feb 2021 06:23:24 +0000 (23:23 -0700)]
Disable cos acceleration for non leap-frog code paths

The cos acceleration is only applied in leap-frog. grompp and mdrun
would, however, happily accept non-zero cos-accel input, and report
viscosity-related quantities without ever applying the acceleration
for all other integrators.

This change adds a check at grompp time (to avoid new tprs with
non-implemented parameter combinations being created), and at
runner time (to catch older tprs). Should probably be backported
to the supported releases.

Refs #3903

3 years agoSafer handling of empty cells in Grid::sortColumnsCpuGeometry
Andrey Alekseenko [Tue, 9 Feb 2021 20:13:01 +0000 (23:13 +0300)]
Safer handling of empty cells in Grid::sortColumnsCpuGeometry

When the number of atoms is low, NBNXM grid can contain empty cells.
Previously, this caused the value of numAtomsCell in
Grid::sortColumnsCpuGeometry to become negative, and we were calling
Grid::fillCell with atomEnd < atomStart.

It did not cause any bugs as far as I observed, but is slightly
dangerous and couterintuitive behavior.

For example, such situation happens in
./bin/mdrunfep-test --gtest_filter=FreeEnergyCalculationsAreEquivalentToReference/FreeEnergyReferenceTest.WithinTolerances/coulandvdwsequential_coul_s

3 years agoFix MPI build
Artem Zhmurov [Thu, 11 Feb 2021 11:19:52 +0000 (11:19 +0000)]
Fix MPI build

In the change that made clang-tidy-11 happy for domdec
(0af8a86a3c9556b2dc8fbd4c9f2a430c5cd58982) the MPI_Comm
were set to nullptr, although they are not pointers.

3 years agoUse GmxManageMPI variables for gmxapi.
M. Eric Irrgang [Mon, 8 Feb 2021 15:55:14 +0000 (18:55 +0300)]
Use GmxManageMPI variables for gmxapi.

For minimal disruption to the release-2021 infrastructure,
let the `gmxapi` CMake target (libgmxapi) use
`${MPI_COMPILE_FLAGS}` and `${MPI_C_LIBRARIES}`
instead of the `MPI::MPI_*` target(s).

Note: This will conflict with the resolution to #3672.
Conflicts arising in a merge from `release-2021` to `master`
should defer to `master`.

Fixes #3896

3 years agoAllow specific diagonostic ignore for GCC only
Pascal Merz [Wed, 10 Feb 2021 21:48:49 +0000 (14:48 -0700)]
Allow specific diagonostic ignore for GCC only

GCC diagonstic pragmas will by default also be read by clang, but clang
and GCC don't always use the same warnings. Example: clang doesn't
understand "-Wunused-but-set-parameter" which GCC uses.

Needed for implementation of #3866.

3 years agoPrepare changes to docker images for python packages
Paul Bauer [Thu, 11 Feb 2021 09:21:32 +0000 (09:21 +0000)]
Prepare changes to docker images for python packages

Python package handling for things currently added manually to the
system python are moved to the virtual environments instead. This
affects the sphinx and gcovr packages.

3 years agoFix gmx_rmpbc_init with InteractionDefinitions
Berk Hess [Wed, 10 Feb 2021 10:38:47 +0000 (11:38 +0100)]
Fix gmx_rmpbc_init with InteractionDefinitions

Molecules were not made whole when gmx_rmpbc_init with
InteractionDefinitions. This caused all trajectoryanalysis tools
not to make molecules whole.

Fixes #3900

3 years agoFix llvm build in docker container
Paul Bauer [Wed, 10 Feb 2021 07:49:31 +0000 (07:49 +0000)]
Fix llvm build in docker container

We still need to be able to rebuild containers if needed.

3 years agoFix clang-tidy-11 errors in NBNXM module, part 4
Andrey Alekseenko [Tue, 9 Feb 2021 16:03:14 +0000 (19:03 +0300)]
Fix clang-tidy-11 errors in NBNXM module, part 4

Refs #3897

3 years agoFix clang-tidy-11 errors in NBNXM module, part 1
Andrey Alekseenko [Wed, 10 Feb 2021 07:42:07 +0000 (07:42 +0000)]
Fix clang-tidy-11 errors in NBNXM module, part 1

In some cases, extracted problematic pieces into static functions to
simplify the logic.

3 years agoRe-fix md-vv Trotter kinetic energy and temperature
Pascal Merz [Mon, 30 Nov 2020 23:37:38 +0000 (16:37 -0700)]
Re-fix md-vv Trotter kinetic energy and temperature

!270 reintroduced bug #3832.

3 years agoSYCL compilation and code compatibility changes
Andrey Alekseenko [Tue, 9 Feb 2021 09:32:47 +0000 (09:32 +0000)]
SYCL compilation and code compatibility changes

- Split SYCL device kernels into separate compilation modules

By default (no split), all the kernels are put into a single compilation unit.
With the upcoming 168 flavors of NBNXM kernel, the JIT compilation
adds 6-10 minutes to each launch of _any_ program using _any_ SYCL kernel, because
all existing kernels (even unused ones) are compiled.

With this change, only actually invoked kernels are JIT-compiled (although not
cached), making the overhead much more manageable.

This cost can be moved to the compile-time by using flags like
`-fsycl-targets=spir64_x86_64-unknown-unknown-sycldevice`.
But it will require having the OpenCL runtime installed on the compilation host.

- Expose Intel SYCL extensions in a manner compatible with SYCL2020.

Intel DPCPP compiler has some of the 2020 features in its sycl::ONEAPI
namespace, and some of them have different names. Meanwhile, hipSYCL has
same functions in cl::sycl proper. Here, we create our own sycl_2020
namespace, and put all these functions there.

- Silence warning from icpx

It seems to be a false positive, not emitted by the manually compiled
llvm from Intel's repo.

- Don't check USM in CMake stage

We don't currently use USM, and, for some reason, this code fails to
compile with hipSYCL. Since we only want to check compilation at the
CMake stage, there is little sense in putting complicated code there.

3 years agoFix SYCL clearDeviceBufferAsync<float3>
Andrey Alekseenko [Mon, 8 Feb 2021 16:29:55 +0000 (19:29 +0300)]
Fix SYCL clearDeviceBufferAsync<float3>

Per SYCL 1.2.1 and 2020 (provisional), cl::sycl::handler::fill only
works for scalars and SYCL vectors, not custom types, like gmx::RVec. It
actually worked fine on OpenCL CPU and host, but not on OpenCL GPU. So,
a simple wrapper that reinterprets the buffer as array of float's is
added.

3 years agoName streams after locality
Artem Zhmurov [Tue, 9 Feb 2021 12:21:03 +0000 (15:21 +0300)]
Name streams after locality

This renames the deviceStream into localStream to be more verbose
in naming.

3 years agoFix clang-tidy-11 errors in NBNXM module, part 2
Andrey Alekseenko [Tue, 9 Feb 2021 13:13:37 +0000 (13:13 +0000)]
Fix clang-tidy-11 errors in NBNXM module, part 2

In some cases, extracted problematic pieces into static functions to
simplify the logic. Maybe a bit too much here, but, I believe, it improves readability.

Also fixed some grammar.

Refs #3897

3 years agoMake temperature and pressure coupling enums enum classes
Pascal Merz [Tue, 9 Feb 2021 10:06:15 +0000 (10:06 +0000)]
Make temperature and pressure coupling enums enum classes

This makes the plain enums denoting the temperature and pressure
coupling enums enum classes. Most of this change is simple renaming,
changing etcXXX into TemperatureCoupling::XXX, and epcXXX into
PressureCoupling::XXX.

As these are the first of many enums in md_enums.h being refactored
into enum classes, this also introduces some reusable functionality,
including a templated function mapping enums to a string representing
the functionality, and helper functions used when reading inputrec
from file or comparing inputrec instances.

This keeps explicit static_casts from / to int in two places: When
serializing the inputrec, and when transferring the values over
multiple simulations.

3 years agoRemove tree-reduce algorithm
Mark Abraham [Tue, 9 Feb 2021 06:08:05 +0000 (07:08 +0100)]
Remove tree-reduce algorithm

This was formerly used only on the now-removed MIC platform. It could
well be useful these days with high core counts on conventional CPU
platforms, but it is likely that something else will prove limiting to
MD step thread scaling before that point. If we ever want it back,
then git will remember it, and we'd probably re-implement it on
different infrastructure anyway.

No need for release notes, as it was not something intended for users
to use.

Renamed the "standard" reduction function now that there is no need to
distinguish it from the tree reduction.

Part of #3982
Fixes #3891

3 years agodispatchTemplatedFunction: dispatch by bool
Andrey Alekseenko [Tue, 9 Feb 2021 06:15:36 +0000 (06:15 +0000)]
dispatchTemplatedFunction: dispatch by bool

Add support of boolean template parameters of the subject function in
dispatchTemplatedFunction.

3 years agoFix clang-format
Artem Zhmurov [Tue, 9 Feb 2021 05:33:13 +0000 (08:33 +0300)]
Fix clang-format

2d567afadf39d215950455d46056745474b850c0 was finalized by applying
suggestion in the GitLab GUI, which did not adhere to clang-format
policy.

3 years agoFix range check bug in gmx covar
Paul Bauer [Tue, 9 Feb 2021 05:14:34 +0000 (05:14 +0000)]
Fix range check bug in gmx covar

Range checking was done the wrong way around.

Fixes #3902

3 years agoTag images on the branch as release-2021
Paul Bauer [Mon, 8 Feb 2021 17:40:49 +0000 (17:40 +0000)]
Tag images on the branch as release-2021

This makes sure we can change images for master without affecting the
stable branch.

Refs #3716

3 years agoDisable FPE for SYCL builds
Andrey Alekseenko [Fri, 18 Dec 2020 13:39:51 +0000 (13:39 +0000)]
Disable FPE for SYCL builds

Intel Graphics Compiler triggers FPEs inside its JIT. We can more
selectively call gmx_fedisableexcept only iff we are running on
Intel's GPU, but, to me, a more predictable approach seems friendlier.

Also, refactored the two complex PP conditions into a separate function.
It's only called once at program launch, so function call overhead
should not be an issue.

3 years agoFix clang-tidy-11 for trajectoryanalysis
Paul Bauer [Mon, 8 Feb 2021 12:23:12 +0000 (12:23 +0000)]
Fix clang-tidy-11 for trajectoryanalysis

Make sure the module conforms to clang-tidy-11.

Refs #3897

3 years agoRemoved "math.h" included from clang-tidy
Paul Bauer [Mon, 8 Feb 2021 07:49:04 +0000 (08:49 +0100)]
Removed "math.h" included from clang-tidy

Version 11 seems to include those in the code without need.

3 years agoParametrize constraints test over the test systems
Artem Zhmurov [Mon, 8 Feb 2021 06:25:49 +0000 (06:25 +0000)]
Parametrize constraints test over the test systems

Use a pre-define set of constant test systems to prevent repetition of logic
in different tests when latter are instintiated.

3 years agoFix clang-tidy 11 warning in nbnxm ocl kernels
Szilárd Páll [Fri, 5 Feb 2021 22:00:07 +0000 (23:00 +0100)]
Fix clang-tidy 11 warning in nbnxm ocl kernels

3 years agoReplace custom implementations of GCD with std::gcd
Andrey Alekseenko [Fri, 5 Feb 2021 16:29:45 +0000 (19:29 +0300)]
Replace custom implementations of GCD with std::gcd

There is a minor implementation difference:
When any of the arguments is 0, old `lgc` functions return 1,
while std::gcd returns max of both arguments.

However, in the two cases changed here, the function is never
called with zeroes.

3 years agoAdd style code for function static variables
Mark Abraham [Sat, 6 Feb 2021 09:15:27 +0000 (09:15 +0000)]
Add style code for function static variables

These should be prefixed with `s_` just like class variables, because
the reason is the same: the reader knows immediately the scope and
lifetime.

3 years agoEnsure GoogleTest builds properly
Mark Abraham [Fri, 5 Feb 2021 14:13:57 +0000 (15:13 +0100)]
Ensure GoogleTest builds properly

Some test targets would not build without this.

Closes #3890

3 years agoClean up domdec again after clang-tidy-11 fixes
Paul Bauer [Fri, 5 Feb 2021 15:37:11 +0000 (16:37 +0100)]
Clean up domdec again after clang-tidy-11 fixes

Previous fixes have been incomplete and introduced a bug.

3 years agoClang-tidy-11 fixes for utility
Paul Bauer [Fri, 5 Feb 2021 15:58:27 +0000 (15:58 +0000)]
Clang-tidy-11 fixes for utility

Fixes have been missing from previous fixes.

Refs #3897

3 years agoUpdated logos
Cathrine Bergh [Fri, 5 Feb 2021 15:43:14 +0000 (15:43 +0000)]
Updated logos

3 years agoFix clang-tidy-11 for domdec and utility
Paul Bauer [Fri, 5 Feb 2021 13:01:43 +0000 (13:01 +0000)]
Fix clang-tidy-11 for domdec and utility

Part of updates needed to conform to clang-tidy-11. Split into several
commits as it is impossible to have all changes together.

Refs #3897

3 years agoUse raw strings instead of format in docker build script
Joe Jordan [Fri, 5 Feb 2021 12:21:29 +0000 (12:21 +0000)]
Use raw strings instead of format in docker build script

Removes all instances of .format() from strings in docker build
script in favor of the more modern raw strings.

3 years agoRemove VMX SIMD
Mark Abraham [Fri, 5 Feb 2021 10:06:20 +0000 (10:06 +0000)]
Remove VMX SIMD

This catered for POWER6 architectures, which are not used in HPC.

Part of #3891

3 years agoDefine M_PI when it is not defined
Mark Abraham [Wed, 3 Feb 2021 16:20:56 +0000 (17:20 +0100)]
Define M_PI when it is not defined

This is a standard work-around (e.g. used in GROMACS) for C++ library
implementations that don't provide POSIX capabilities by default
(e.g. Cygwin).

Closes #3890

3 years agoRemove support for ARMv7 and NEON
Mark Abraham [Tue, 2 Feb 2021 09:52:59 +0000 (10:52 +0100)]
Remove support for ARMv7 and NEON

Note that ARMv8 and NEON ASIMD are unaffected.

The implementation of the SIMD library for NEON ASIMD formerly
included content from that for NEON, and sometimes then overrode it
based on preprocessor defines. This has been consolidated manually so
that there is neither duplication nor additional preprocessing needed.

Part of #3891

3 years agoRemove no longer needed macro define
Paul Bauer [Wed, 3 Feb 2021 15:18:56 +0000 (16:18 +0100)]
Remove no longer needed macro define

The __STDC_LIMIT_MACROS and __STDC_FORMAT_MACROS definitions
should no longer be necessary.

3 years agoFix refactoring issue
Mark Abraham [Wed, 3 Feb 2021 07:56:08 +0000 (08:56 +0100)]
Fix refactoring issue

The former code had short-circuit logic that is now restored. That
could only be a problem if multiple patches for the same atom had the
same name, which sounds unlikely. So probably the problem was benign.

Added doxygen and suggested future clean-up.

Refs #2833

3 years agoMake LJ combination rule enum into an enum class
Artem Zhmurov [Thu, 4 Feb 2021 09:56:25 +0000 (09:56 +0000)]
Make LJ combination rule enum into an enum class

To introduce type-safety, the combination rule for LJ is madde into
enum class. This also fixes:
1. Out-of-order string assignment to enum values
2. Unsafe utilization of the enum for LJ PME combination rule
   (the values of this enum coincided so no bug by luck)

3 years agoEnsure no UB in writing forces
Mark Abraham [Thu, 4 Feb 2021 08:26:29 +0000 (09:26 +0100)]
Ensure no UB in writing forces

UBSan observed that on non-master ranks we added an offset to a null
pointer in of->f_global. That pointer was never used, so there was no
bug, but we can improve the code by expressing that more clearly.

Ref #3897

3 years agoFix handling of tip4p in pdb2gmx
Mark Abraham [Wed, 3 Feb 2021 07:56:08 +0000 (08:56 +0100)]
Fix handling of tip4p in pdb2gmx

The former code wrote an output configuration file with an extra
spurious 'M' particle, as well as the 'MW'.

Added test coverage, which needs the full output configuration to be
checked. Made that configurable so that we have the option to check
the full configuration only when we want to.

Refs #2833
Fixes #3894

3 years agoInitialize rollingPruningNumParts in init_plist
Andrey Alekseenko [Wed, 3 Feb 2021 17:15:31 +0000 (17:15 +0000)]
Initialize rollingPruningNumParts in init_plist

Previously, rollingPruningNumParts and rollingPruningPart were not
initialized, which, in the case of an empty domain, caused access
to uninitialized memory. No particular harm was being done, but it
could trigger an assertion in gpu_launch_kernel_pruneonly during
some of the regression tests.

The whole code in the preamble of gpu_launch_kernel_pruneonly is
probably due for refactoring, but since we initialize all other
plist's fields in init_plist, we better initialize these two as well.

3 years agoUpdate llvm docker build
Paul Bauer [Wed, 3 Feb 2021 16:40:13 +0000 (16:40 +0000)]
Update llvm docker build

The LLVM project changed their repository organisation, so we have to
adjust our docker build script to take that into account.

Container for llvm 11 tested locally.

Refs #3897

3 years agoFix test of not_null
Mark Abraham [Wed, 3 Feb 2021 12:28:19 +0000 (13:28 +0100)]
Fix test of not_null

Inadvertently removed too much code

Refs #3893

3 years agoFix issues found by static analyzer
Paul Bauer [Wed, 3 Feb 2021 12:07:33 +0000 (13:07 +0100)]
Fix issues found by static analyzer

Update to version 11 found a few issues that need fixes.

Refs #3897

3 years agoRemove support for Intel classic compiler
Mark Abraham [Wed, 3 Feb 2021 10:44:20 +0000 (10:44 +0000)]
Remove support for Intel classic compiler

This compiler has sometimes generated the fastest code, but also most
often generated the wrong code of any supported compiler. Since Intel
now has another clang-based compiler that they are targetting for GPU
support in oneAPI, we've chosen to support it. Our resources are
limited so something else has to go.

Minor improvements to the install guide while I was there.

Added a fatal error to CMake as otherwise we will get bug reports that
icc doesn't work.

Added release notes

Fixes #3893

3 years agoRemove deprecated env. vars GMX_OCL_NB_ANA_EWALD etc
Andrey Alekseenko [Tue, 2 Feb 2021 13:33:20 +0000 (14:33 +0100)]
Remove deprecated env. vars GMX_OCL_NB_ANA_EWALD etc

The following environment variables were deprecated in 2021, and are
being removed:

GMX_CUDA_NB_ANA_EWALD
GMX_OCL_NB_ANA_EWALD
GMX_CUDA_NB_TAB_EWALD
GMX_OCL_NB_TAB_EWALD
GMX_CUDA_NB_EWALD_TWINCUT
GMX_OCL_NB_EWALD_TWINCUT

Closes #3803

3 years agoImprove DLB recommendation
Szilárd Páll [Tue, 2 Feb 2021 13:09:58 +0000 (13:09 +0000)]
Improve DLB recommendation

Do not recommend turning on DLB when it was turned off due to a
condition known to make it unsuitable to use in the run.

Fixes #3879

3 years agoUse make_unique instead of reset when private implementations are constructed
Artem Zhmurov [Tue, 2 Feb 2021 05:06:55 +0000 (08:06 +0300)]
Use make_unique instead of reset when private implementations are constructed

Using std::unique_ptr instead of our own implementation in PImpl classes made
compiler more aware of the code and clang-tidy started to complain about
using reset function(...) for PImpl construction.

3 years agoRemove support for Fujitsu Sparc64 HPC-ACE
Mark Abraham [Tue, 2 Feb 2021 09:44:40 +0000 (09:44 +0000)]
Remove support for Fujitsu Sparc64 HPC-ACE

The K computer is turned off, so this architecture is effectively
dead. Note that the NBNXM scheme never supported its SIMD, so even the
SIMD support in other modules was only of modest value.

Part of #3891

3 years agoFix compiler-version checks for C++17 requirements
Mark Abraham [Tue, 2 Feb 2021 09:10:44 +0000 (10:10 +0100)]
Fix compiler-version checks for C++17 requirements

175d3bb67f4 didn't update these parts

Refs #3297

3 years agoRemove x86 MIC support
Mark Abraham [Mon, 1 Feb 2021 12:16:44 +0000 (12:16 +0000)]
Remove x86 MIC support

This platform is basically dead, so code and SIMD layer that supports
it should be removed.

There is no need to preserve a stub in the SIMD support enumeration,
because we never need to be consistent with old code. That's different
for other enums that affect e.g. reading old tpr files.

Note that this does not affect KNL support or
SIMD.

Part of #3891

3 years agoAdd necessary include
Mark Abraham [Mon, 1 Feb 2021 10:30:35 +0000 (10:30 +0000)]
Add necessary include

int64_t needs the right header to be defined. Was broken
on Cygwin

Fixes #3890

3 years agoReplace gmx::Mutex with std::mutex
Mark Abraham [Fri, 29 Jan 2021 15:24:39 +0000 (16:24 +0100)]
Replace gmx::Mutex with std::mutex

We use no mutexes during the MD loop, so performance is not a serious
consideration and we should simplify by using std components.
Eliminated components of thread-MPI that are now unused.

In particular, this reduces the cross-dependencies between the
libgromacs and threadMPI libraries.

Minor style improvements around set_over_alloc_dd.

Part of #3892

3 years agoFix clang-tidy
Paul Bauer [Sun, 31 Jan 2021 09:30:07 +0000 (10:30 +0100)]
Fix clang-tidy

Code used old unique_ptr handling that needed fixing.

3 years agoRequire MPI 2.0
Mark Abraham [Sun, 31 Jan 2021 19:05:44 +0000 (19:05 +0000)]
Require MPI 2.0

Remove MPI_IN_PLACE_EXISTS, since that can now be assumed. We weren't
testing the fallback path in CI, either.

Simplified MPI install guide. We don't need to maintain
recommendations about MPI library versions.

Fixes #3591

3 years agoRmove dependency on Constraints object from compute_globals(...)
Artem Zhmurov [Fri, 29 Jan 2021 18:37:07 +0000 (18:37 +0000)]
Rmove dependency on Constraints object from compute_globals(...)

Compute globals only uses RMSD data from constraints. This replaces
the Constraints object by the optional argument with RMSD data in
compute_globals(...) function signature.

Refs. #3754

3 years agoAllow MdModules to access the topology during simulation setup.
Hubert Santuz [Fri, 29 Jan 2021 18:08:25 +0000 (18:08 +0000)]
Allow MdModules to access the topology during simulation setup.

3 years agoUpdate release note on QM/MM deprication
Christian Blau [Fri, 29 Jan 2021 08:30:13 +0000 (09:30 +0100)]
Update release note on QM/MM deprication

The previous release note made it sound like the ongoing
CP2K interface development is providing code that is
"untested and likely dysfunctional"

This is not the case, it is the best functioning interface
at the moment and while not part of the official GROMACS code
base, has seen more through testing than any other QM/MM
interface.

3 years agoImprove CUDA codegen flags
Szilárd Páll [Fri, 29 Jan 2021 16:36:42 +0000 (16:36 +0000)]
Improve CUDA codegen flags

- onnly generate PTX for an early and the latest arch (3.5 and 8.0)
- add binary 8.0 and 8.6 targets

3 years agoUse cxx mpi
Roland Schulz [Fri, 29 Jan 2021 15:20:25 +0000 (15:20 +0000)]
Use cxx mpi

3 years agoRemove PrivateImplPointer in favour of std::unique_ptr
Mark Abraham [Fri, 29 Jan 2021 12:11:02 +0000 (13:11 +0100)]
Remove PrivateImplPointer in favour of std::unique_ptr

The single remaining advantage (help with const correctness in an
unlikely corner case) is outweighed by the disadvantages of
using a custom solution where a generic one would do.

Fixes #3684

3 years agoAdded functionality that allows MdModules to disable PME-only ranks during simulation...
Dmitry Morozov [Fri, 29 Jan 2021 10:33:16 +0000 (10:33 +0000)]
Added functionality that allows MdModules to disable PME-only ranks during simulation setup

3 years agoMerge branch release-2021
Mark Abraham [Fri, 29 Jan 2021 07:57:31 +0000 (08:57 +0100)]
Merge branch release-2021

Resolved conflicts:

        admin/gitlab-ci/gromacs.gitlab-ci.yml
        admin/gitlab-ci/python-gmxapi01.gitlab-ci.yml
        api/nblib/gmxsetup.cpp
        api/nblib/listed_forces/gmxcalculator.cpp
        api/nblib/listed_forces/tests/calculator.cpp
        api/nblib/molecules.cpp
        api/nblib/molecules.h
        api/nblib/ppmap.h
        api/nblib/tests/integrator.cpp
        api/nblib/topologyhelpers.cpp
        docs/install-guide/index.rst
        python_packaging/src/setup.py
        src/gromacs/gmxpreprocess/pdb2gmx.cpp
        src/gromacs/gmxpreprocess/readir.cpp
        src/gromacs/gmxpreprocess/topdirs.cpp
        src/gromacs/math/densityfit.cpp
        src/gromacs/mdrun/md.cpp
        src/gromacs/mdrunutility/handlerestart.cpp
        src/gromacs/modularsimulator/simulatoralgorithm.cpp
        src/gromacs/nbnxm/cuda/nbnxm_cuda_data_mgmt.cu
        src/gromacs/nbnxm/nbnxm_gpu_data_mgmt.cpp
        src/gromacs/nbnxm/nbnxm_gpu_data_mgmt.h
        src/gromacs/nbnxm/opencl/nbnxm_ocl_data_mgmt.cpp
        src/gromacs/pulling/pull.cpp

Mostly from refactoring in master that clashed with fixes in
release-2021. Preserved the functionality from the latter in the form
of the former.

Some changes are simply due to the change to clang-format
configuration.

One CI configuration change for mdrun-only build is adapted, since
mdrun-only build has been removed.

3 years agoPrepare for first 2021 patch release
Paul Bauer [Fri, 29 Jan 2021 07:34:26 +0000 (07:34 +0000)]
Prepare for first 2021 patch release

Reset DOI strings

3 years agoMove initiation of local CPU force H2D transfer to producer
Alan Gray [Wed, 27 Jan 2021 14:51:06 +0000 (06:51 -0800)]
Move initiation of local CPU force H2D transfer to producer

For GPU DD cases that include CPU force calculations, a host to device
transfer of local force data is required before the GPU halo
exchange. The initiation of the transfer was previously immediately
before the consumer (GPU halo exchange). This change moves the
initiation to immediately after the last possible producer (the
special force calculation, noting that the CPU force contributions can
also come from preceeding bonded or PME calculations).

Addresses #3082

3 years agoGROMACS 2021 release
Paul Bauer [Thu, 28 Jan 2021 13:35:05 +0000 (13:35 +0000)]
GROMACS 2021 release

Updated regressiontest hash.
Set doi strings.
Set correct release date.

3 years agoFix NB-LIB copyright
Paul Bauer [Thu, 28 Jan 2021 12:12:57 +0000 (13:12 +0100)]
Fix NB-LIB copyright

Was missing some updates and had a wrongly formatted header.

3 years agoFix formatting in random/seed.cpp
Paul Bauer [Thu, 28 Jan 2021 11:07:42 +0000 (12:07 +0100)]
Fix formatting in random/seed.cpp

This was left over after merging release-2020 into 2021.

3 years agoFix failing listed-forces test
kanduri [Thu, 28 Jan 2021 11:37:56 +0000 (11:37 +0000)]
Fix failing listed-forces test

3 years agoReintroduce CI job descriptions
Andrey Alekseenko [Thu, 28 Jan 2021 08:48:27 +0000 (08:48 +0000)]
Reintroduce CI job descriptions

GitLab does not allow adding custom fields to YAML files, so comments
were used. I tried to make the descriptions grep'able (not for the
wqhole matrix, but at least for individual settings), human-readable,
and possibly machine-parseable at the same time.

3 years agoRemove constant acceleration groups
Pascal Merz [Wed, 27 Jan 2021 22:06:00 +0000 (22:06 +0000)]
Remove constant acceleration groups

Per Redmine discussion, this has been broken for about 10
years. Simplifying the update and global energy code is nice, and some
integrators will now be a trifle faster.

The value of SimulationAtomGroupType::Count can't change because reading old .tpr files relies
on it, but the enumeration value has a new name so that any relevant
code rebasing over this change can't silently still compile. This does
mean that loops over egcNR are now slightly less efficient than they
could be, and some of those are in the per-step update code. But that
is likely not worth changing in the current form of the code.

Originally authored by Mark Abraham at
https://gerrit.gromacs.org/c/gromacs/+/8944.

Fixes #1354

3 years agoSYCL: fix typo in a test and clean-up non-standard-compliant code
Andrey Alekseenko [Wed, 27 Jan 2021 12:01:07 +0000 (15:01 +0300)]
SYCL: fix typo in a test and clean-up non-standard-compliant code

Discovered when trying to compile with hipSYCL. Although not an issue
for Intel compiler, better keep things clean.

The change of `write` to `read` in the test code is intended. Not sure
how it worked before, but it should be `read` there.

Also fixed namespace qualifiers, implicit ctors.

3 years agoTest python 3.9.1
Mark Abraham [Wed, 27 Jan 2021 07:43:26 +0000 (08:43 +0100)]
Test python 3.9.1

Extends the image-building infrastructure to also include
python 3.9.1 into images.

Fixes #3479

3 years agoClarify lambda vector usage with figure in manual
Christian Blau [Tue, 2 Jun 2020 12:54:33 +0000 (14:54 +0200)]
Clarify lambda vector usage with figure in manual

Add a figure that clarifies the effect of different lambda values.

3 years agoAdd new sample script for listed forces
Paul Bauer [Tue, 26 Jan 2021 18:34:29 +0000 (19:34 +0100)]
Add new sample script for listed forces

Adds a sample script that demonstrated the use of
listed forces calculator.

3 years agoChange default Ewald kernel to tabulated on NVIDIA CC 7.0
Szilárd Páll [Tue, 26 Jan 2021 16:33:16 +0000 (16:33 +0000)]
Change default Ewald kernel to tabulated on NVIDIA CC 7.0

Partially addressed #3845

3 years agoFix default for xpm2gmx tick-mark spacings
Mark Abraham [Tue, 26 Jan 2021 08:52:07 +0000 (09:52 +0100)]
Fix default for xpm2gmx tick-mark spacings

Inadvertently broken ages ago in 027ae34187f8

Fixes #3881