alexxy/gromacs.git
3 years agoReduce code duplication between Berendsen and c-rescale pressure coupling
Pascal Merz [Thu, 7 Jan 2021 08:59:03 +0000 (08:59 +0000)]
Reduce code duplication between Berendsen and c-rescale pressure coupling

The Berendsen and C-Rescale pressure coupling algorithms are very similar,
yet duplicate a lot of functionality. This unifies the functions using
template parameters to reduce code duplication. This is pure refactoring.

3 years agoRespect user input for nstcomm
Pascal Merz [Thu, 7 Jan 2021 08:39:05 +0000 (08:39 +0000)]
Respect user input for nstcomm

This replaces do_md overwriting ir->nstcomm by a warning at grompp
time. Until now, nstcomm was set to the computed global communication
frequency if nstcomm was smaller. The user is now informed at grompp
time that their choice is not optimal, but the set value is respected.
The criterion for the warning now also encompasses any value for
nstcomm that is not a multiple of the global communication frequency.

Resolves a TODO, and refs #3854.

3 years agoRemove misleading const qualifier for inputrec in expanded ensemble
Pascal Merz [Wed, 6 Jan 2021 15:30:16 +0000 (15:30 +0000)]
Remove misleading const qualifier for inputrec in expanded ensemble

The expanded ensemble functionality took a const pointer to the
inputrec, but might change its references temperature. This is (at the
very least) misleading, so removed the const qualifier.

Refs #3854

3 years agoFix lambda printing const qualifier
Pascal Merz [Sun, 6 Dec 2020 01:39:03 +0000 (18:39 -0700)]
Fix lambda printing const qualifier

Use ArrayRef<const real> instead of const ArrayRef<real>.

3 years agoMerge branch release-2021
Mark Abraham [Fri, 18 Dec 2020 07:23:07 +0000 (08:23 +0100)]
Merge branch release-2021

Some reformatting changes needed for the difference in
.clang-format in the two branches

3 years agoUpdate CI image to OneAPI 2021.1.1, add ICC tests.
Mark Abraham [Thu, 17 Dec 2020 11:10:35 +0000 (11:10 +0000)]
Update CI image to OneAPI 2021.1.1, add ICC tests.

Also, backport a change from MR !796 that silences the false-positive ICC
compiler warning.

3 years agoApply re-formatting to C++ in src/ tree.
M. Eric Irrgang [Wed, 16 Dec 2020 17:45:40 +0000 (20:45 +0300)]
Apply re-formatting to C++ in src/ tree.

Apply formatting changes in bulk to reduce noise in subsequent
functional changes.

Will likely need to be repeated if clang-format version is updated
per #3708.

The formatting is sensitive to differences even between llvm tools
versions 7.1.0.2 and 8.0.1.3. Here, I used 7.1.

Refs #3833

3 years agoUpdate deprecation statuses
Mark Abraham [Tue, 15 Dec 2020 17:01:19 +0000 (17:01 +0000)]
Update deprecation statuses

Various functionality has been agreed as deprecated at #3818 and
elsewhere. Those are now noted in the release notes, documentation,
and CMake status messages. The changes are all minor so there is
little need to make mdrun report when such configurations are used.

The deprecation content for release  2020 (and 2021) series is updated
to include  the relevant  content from  release 2019  series. Comments
have been added to help us to this better in future.

Fixes #3818

3 years agoCorrect signs of lj and coulomb forces
Simon Christ [Mon, 30 Nov 2020 10:37:00 +0000 (10:37 +0000)]
Correct signs of lj and coulomb forces

3 years agoUpdate instructions in containers.rst
Andrey Alekseenko [Fri, 11 Dec 2020 14:55:41 +0000 (14:55 +0000)]
Update instructions in containers.rst

3 years agoRestrict force frame comparison for FEP tests
Pascal Merz [Fri, 11 Dec 2020 13:07:23 +0000 (13:07 +0000)]
Restrict force frame comparison for FEP tests

Closes #3741.

3 years agoFix trx frame reading from modular simulator checkpoint files
Pascal Merz [Fri, 11 Dec 2020 12:22:44 +0000 (12:22 +0000)]
Fix trx frame reading from modular simulator checkpoint files

trx frames from checkpoints written by modular simulator could be
slightly off depending on the algorithms used (always up-to-date with
domain decomposition only). The global state is still written to
modular checkpoints (as there is a significant amount of setup work at
runner time that needs to be refactored before modular simulator can
get spawned completely without a global state). It is, however, not
guaranteed to be absolutely up to date, as it's not used in the
simulation continuation.

The trx frame reading is now handled by modular simulator if the
checkpoint was written by modular simulator. A test was added to
ensure that the final frame of the simulation is equivalent to the
checkpointed configuration.

Note that this was not affecting simulation restart (exact
continuation is tested also for modular simulator). It would, however,
affect other tools accessing the configuration from the checkpoint
file. The error was only present in master and 2021 beta, so it was
never in a released version.

trx frame reading by modular simulator required some refactoring of
the StatePropagatorData and FreeEnergyPerturbationData
checkpointing. The main read and write function was moved to the data
object itself rather than being owned by its element. This is likely a
better design decision anyway: The element orchestrates the
checkpointing during the simulations, but the data object is handling
the actual data reading / writing. This allows to create a dummy data
object, restore it from checkpoint, and read out the quantities
relevant for the trx frame.

Closes #3838

3 years agoA check for perturbed listed pairs beyond rlist
Berk Hess [Thu, 10 Dec 2020 13:34:59 +0000 (13:34 +0000)]
A check for perturbed listed pairs beyond rlist

Excluded atoms pairs should be within the pairlist cut-off, as
otherwise long-range corrections are not applied. This is problematic
for free-energy calculations where intra-molecular interactions are
not coupled and replaced by pair interactions. Now a fatal error
is generated when perturbed pair interactions are beyond rlist.

Also added PME grid correction for LJ excluded pairs beyond rvdw,
which was missing from #3403.

Added missing release note for the fix of #3403.

Fixes #3403
Fixes #3809

3 years agoImproved variable names in FEP nonbonded kernel
Magnus Lundborg [Thu, 10 Dec 2020 08:30:46 +0000 (08:30 +0000)]
Improved variable names in FEP nonbonded kernel

This is mainly to improve the readability of the FEP SIMD patch.
There are more variables to rename, but preferably as a follow-up
to the SIMD patch.

3 years agoFix defining of EXCLUSION_FORCES in CUDA/OpenCL kernels
Andrey Alekseenko [Wed, 9 Dec 2020 11:24:13 +0000 (11:24 +0000)]
Fix defining of EXCLUSION_FORCES in CUDA/OpenCL kernels

For the case of cut-off electrostatics + Ewald LJ + no energy calculation,
the EXCLUSION_FORCES macro should be active.
However, LJ_EWALD macro is (conditionally) set only later, and so is
always undefined when it is being checked for EXCLUSION_FORCES.

3 years agoFix compilation and tests with icc 19.1.2
Mark Abraham [Wed, 9 Dec 2020 10:14:01 +0000 (10:14 +0000)]
Fix compilation and tests with icc 19.1.2

Closes #3822

3 years agoFix and activate tests for kv-tree checkpoint functions
Pascal Merz [Wed, 9 Dec 2020 09:51:32 +0000 (09:51 +0000)]
Fix and activate tests for kv-tree checkpoint functions

The tests in src/gromacs/fileio/tests/checkpoint.cpp were introduced
in 64bee06aa, but the file was never added to the CMakeLists.txt,
meaning they were never executed (or even compiled).

Added the file to the CMake target and fixed a few compilation
errors and warning to activate the tests.

3 years agoFix dump of checkpoint files
Pascal Merz [Wed, 9 Dec 2020 09:23:13 +0000 (09:23 +0000)]
Fix dump of checkpoint files

With the addition of the MdModules and the modular checkpointing,
`gmx dump -cp` would end with an error when either of the two was
written to checkpoint. Reason was that the function dumping
checkpoint files was not aware of the additional blocks present.
As the new functionality checkpoints at the end of the files, the
remainder of the information was printed anyway, but the call ended
with an error.

This adds the two new checkpointing blocks to the function used
by gmx dump, and prints the kv-tree they are based on. To achieve
this, the kv-tree printing functionality had to be expanded to
allow for arrays of objects.

Finally, this change also fixes a wrong comment in the modular
simulator checkpoint helper - checkpointing happens on top of the
integration step, so _before_ the last step.

3 years agoClarify checkpoint mismatch error, and enable in release
Pascal Merz [Sat, 5 Dec 2020 01:07:13 +0000 (18:07 -0700)]
Clarify checkpoint mismatch error, and enable in release

As of GROMACS 2021, checkpoint files written with the modular and the
legacy codepath need to be continued with the same code path. The
respective check was not executed in release mode, which would lead
to less descriptive errors.

Also reworded the error to guide users how they can solve the problem.

3 years agoAdd CI jobs for gmxapi 0.3
M. Eric Irrgang [Fri, 27 Nov 2020 16:11:05 +0000 (19:11 +0300)]
Add CI jobs for gmxapi 0.3

3 years agoUpdate rules for release-2021.
M. Eric Irrgang [Fri, 27 Nov 2020 16:16:54 +0000 (19:16 +0300)]
Update rules for release-2021.

Add .rules:merge-requests:release-2021.

Update gmxapi 0.2 MR pipeline jobs not to trigger for `master`.

3 years agoSeparate job script files for gmxapi package versions.
M. Eric Irrgang [Fri, 27 Nov 2020 16:10:13 +0000 (19:10 +0300)]
Separate job script files for gmxapi package versions.

This should help minimize confusion or merge conflicts across GROMACS
release branches.

3 years agoAdded scalar functions cbrt as well as masked Rcp
Magnus Lundborg [Thu, 19 Nov 2020 16:49:57 +0000 (17:49 +0100)]
Added scalar functions cbrt as well as masked Rcp

These functions as useful for nonbonded FE SIMD kernels.

3 years agoFix mdrun-only build
Mark Abraham [Wed, 25 Nov 2020 09:04:34 +0000 (10:04 +0100)]
Fix mdrun-only build

Recent changes to include path setup didn't handle the mdrun-only
build. The name clash between the new src/gromacs/mdrun interface
library and the former src/programs/mdrun executable is fixed. When
doing a shared-library mdrun-only build, the dependencies of
libgromacs also need to be limited in the same way as the set of
modules added to libgromacs.

3 years agoRelax simulator comparison tests
Pascal Merz [Fri, 4 Dec 2020 05:29:12 +0000 (22:29 -0700)]
Relax simulator comparison tests

The simulator comparison tests have proven to be too strict when running
them on more diverse hardware / compiler / parallelization combinations.

This doubles the tolerances for the energies of tests containing
constraints. Note that at 160 double precision ULPs, these are still
very tight for end-to-end tests, so the danger of relaxing them a bit
is low.

Closes #3836

3 years agoImprove gmxapi C++ test coverage for failed mdrun.
M. Eric Irrgang [Tue, 1 Dec 2020 14:11:48 +0000 (17:11 +0300)]
Improve gmxapi C++ test coverage for failed mdrun.

Make sure that we test the C++ API to confirm that non-zero mdrun exit
codes are detected when using SIGINT. No additional test execution is
needed. We just add a little more rigor to an existing test.

Ref #3394

3 years agoPrint energy conservation in modular simulator
Pascal Merz [Wed, 2 Dec 2020 21:38:48 +0000 (14:38 -0700)]
Print energy conservation in modular simulator

3 years agoThird GROMACS 2021 beta release
Paul Bauer [Wed, 2 Dec 2020 14:39:57 +0000 (14:39 +0000)]
Third GROMACS 2021 beta release

All features should now be stable before the release.

3 years agoOne argument per line for long function signatures.
M. Eric Irrgang [Sun, 15 Nov 2020 19:00:00 +0000 (22:00 +0300)]
One argument per line for long function signatures.

Fixes #3833

3 years agoFixes post submit broken by 05f02ab82
Pascal Merz [Wed, 2 Dec 2020 08:52:40 +0000 (01:52 -0700)]
Fixes post submit broken by 05f02ab82

3 years agoSeparate simulator comparison tests
Pascal Merz [Wed, 2 Dec 2020 00:30:34 +0000 (17:30 -0700)]
Separate simulator comparison tests

The simulator comparison tests ensure that legacy and modular
simulator code paths don't diverge while both exist. They are
currently part of the mdrun tests. Separating them has two
advantages:

* As the feature set of modular simulator grew, the run time
  of these tests became the largest contributor to the run time of
  mdrun-test. Keeping it separate makes it easy to keep the
  run time in check and to disable the tests if necessary.
* It is useful to run the simulator comparison tests on
  multiple ranks (at least locally). Not all other tests
  in mdrun-test support more than one rank. Having a separate
  binary simplifies running it with different parallelization schemes.

3 years agoFix error when using simulator test with pre-defined environment variable
Pascal Merz [Wed, 11 Nov 2020 23:38:46 +0000 (16:38 -0700)]
Fix error when using simulator test with pre-defined environment variable

The simulator test compares the results of functionality implemented in
both the legacy and the modular simulator by running two simulations using
the environment variables GMX_DISABLE_MODULAR_SIMULATOR and
GMX_USE_MODULAR_SIMULATOR to cover both code paths. If one of these
variables was already present in the test sytem, the tests would fail with
an error.

This change backs up the current state of both variables, disables them,
runs the tests, and resets them to their previous state (if any).

3 years agoModular simulator: Disable invalid code paths
Pascal Merz [Wed, 11 Nov 2020 22:52:22 +0000 (15:52 -0700)]
Modular simulator: Disable invalid code paths

This explicitly disables two invalid code paths for modular simulator:
* The new MTS is not implemented for modular simulator. It is only
  implemented for integrator = md, which by default uses the legacy
  code path. This default can however be overwritten by setting
  the environment variable GMX_USE_MODULAR_SIMULATOR=ON, which would
  result in errors due to the MTS data structures not being properly
  initialized.
* The non-MTTK Parrinello-Rahman barostat is available in modular
  simulator, but not in the legacy simulator. The case that this
  barostat is chosen in combination with other options not compatible
  with modular simulator needs to be caught explicitly.

3 years agoAdd tests for newer GCC versions
Paul Bauer [Mon, 30 Nov 2020 16:07:42 +0000 (16:07 +0000)]
Add tests for newer GCC versions

Added gcc-9 + OpenCL (in release builds) and gcc-10 + OpenCL
during merge pipelines to replace previous gcc-7 + OpenCL builds.
Shuffled around previous gcc-8 + CUDA builds to now have
gcc-7 + CUDA 10.2 and gcc-8 + CUDA 11.0 instead.

Test OpenCL with internal clFFT during release builds.

3 years agoExplicitly use xunit2 schema for pytest output.
M. Eric Irrgang [Fri, 27 Nov 2020 14:12:07 +0000 (17:12 +0300)]
Explicitly use xunit2 schema for pytest output.

Resolves #3717

3 years agoImprove accessibility of pytest documentation.
M. Eric Irrgang [Sun, 29 Nov 2020 19:54:39 +0000 (19:54 +0000)]
Improve accessibility of pytest documentation.

* Update gmxapi install.rst.
* Consolidate (and prune) some README.md content in
  python_packaging subdirectory.

Also ref #3706

Fixes #3702

3 years agoFix build on CentOS 7
Paul Bauer [Fri, 27 Nov 2020 14:37:28 +0000 (15:37 +0100)]
Fix build on CentOS 7

The compiler toolset coming with devtoolset-7 on CentOS still suffers
from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58265. The workaround
for this has been removed before because other gcc-7 compilers are not
affected by this, but it is obviously still needed for CentOS.

Fixes #3826

3 years agoImport setuptools early to suppress distutils warning.
M. Eric Irrgang [Fri, 27 Nov 2020 14:24:01 +0000 (17:24 +0300)]
Import setuptools early to suppress distutils warning.

Also apply PEP-8 formatting corrections.

Fixes #3715

3 years agoFix cyclecounters on x32
Paul Bauer [Wed, 25 Nov 2020 10:30:08 +0000 (11:30 +0100)]
Fix cyclecounters on x32

A missing check meant that the code wouldn't compile due to an asm block
that is not compatible with 32 bit datatype ABI and x86_64 registers.

Fix provided by Nicholas Breen.

Fixes #3816

3 years agoFix error with links in docs
Paul Bauer [Wed, 25 Nov 2020 08:30:08 +0000 (09:30 +0100)]
Fix error with links in docs

Linkchecker complained about issues that I didn't fix correctly during
the latest merge.

3 years agoFix frexp() for ARM SVE SIMD
Gilles Gouaillardet [Wed, 25 Nov 2020 07:06:46 +0000 (16:06 +0900)]
Fix frexp() for ARM SVE SIMD

3 years agoStop GoogleTest requiring ancient CMake minimum versions
Mark Abraham [Tue, 24 Nov 2020 15:26:49 +0000 (16:26 +0100)]
Stop GoogleTest requiring ancient CMake minimum versions

In practice the version is always new enough, and avoiding the
redundant minimum specifications means GROMACS developers will not be
spammed with useless warnings.

3 years agoMerge branch 'origin/release-2021' into merge-2021-into-master
Paul Bauer [Tue, 24 Nov 2020 15:58:43 +0000 (16:58 +0100)]
Merge branch 'origin/release-2021' into merge-2021-into-master

Resolved Conflicts:
cmake/gmxVersionInfo.cmake
docs/release-notes/index.rst
src/gromacs/mdlib/CMakeLists.txt
src/gromacs/mdrun/md.cpp

3 years agoFix frexp() for ARM neon SIMD.
Erik Lindahl [Tue, 24 Nov 2020 11:48:54 +0000 (12:48 +0100)]
Fix frexp() for ARM neon SIMD.

Implements the same fix for arguments +-0 as previously done
for x86 and power implementations. After this, the only
remaining architecture is ARM SVE.

Refs #3773.

3 years agoMerge branch 'origin/release-2020' into merge-2020-into-2021
Paul Bauer [Tue, 24 Nov 2020 13:38:39 +0000 (14:38 +0100)]
Merge branch 'origin/release-2020' into merge-2020-into-2021

Resolved Conflicts:
admin/containers/scripted_gmx_docker_builds.py
docs/conf.cmakein.py
docs/dev-manual/change-management.rst
docs/dev-manual/contribute.rst
docs/dev-manual/releng/index.rst
docs/dev-manual/tools.rst
docs/install-guide/index.rst
docs/reference-manual/preface.rst
docs/release-notes/index.rst
scripts/GMXRC.bash.cmakein
src/gromacs/gmxana/gmx_covar.cpp
src/gromacs/gmxana/gmx_do_dssp.cpp
src/gromacs/gmxana/gmx_h2order.cpp
src/gromacs/gmxana/nsfactor.cpp
src/gromacs/hardware/detecthardware.cpp
src/gromacs/mdlib/coupling.cpp
src/gromacs/mdrun/md.cpp
src/gromacs/mdtypes/state.h
src/gromacs/trajectoryanalysis/modules/pairdist.cpp
src/gromacs/utility/basedefinitions.h

3 years agoFix gmx h2order -d option
Paul Bauer [Tue, 24 Nov 2020 10:22:47 +0000 (11:22 +0100)]
Fix gmx h2order -d option

The code to implement this was never added.

Fixes #3820

3 years agoMake sure frexp() returns correct for argument 0.0
Erik Lindahl [Tue, 24 Nov 2020 08:23:37 +0000 (08:23 +0000)]
Make sure frexp() returns correct for argument 0.0

Previous functions in gromacs have never called frexp
with argument 0.0, but cbrt() needs this. This will not
have caused any bugs, but since it results in FP
exceptions in debug builds we want to have it fixed
so our unit tests work.

This change adds the correct behavior for all x86
SIMD instruction sets, and it has also been tested
on all of them in both single and double, with the
exception for MIC (which should be correct, but we
cannot test it).

The ARM SIMD flavors have not yet been fixed yet
since the ARM build fails due to an apparent nblib
error. Once that is fixed, I will add it in a separate
change and close the issue.

Refs #3773.

3 years agoImprove handling of CUDA API errors
Artem Zhmurov [Tue, 24 Nov 2020 08:02:48 +0000 (08:02 +0000)]
Improve handling of CUDA API errors

Consolidate the construction of the printed error message in one
place and make sure that the CUDA API information on error is
printed when the error is detected.

3 years agoFixes for Intel and container build fixes
Paul Bauer [Mon, 23 Nov 2020 20:51:28 +0000 (20:51 +0000)]
Fixes for Intel and container build fixes

Generalizes the TSAN build stage to a compiler build stage, and uses
it for containing the installation process for the free Intel tools

Fixed or worked around several bugs

Updated install guide section on tested platforms to describe
what we actually do

Refs #3459, #3620

Change-Id: I28e4b816923395edead9d425cec5d85581e22b5e

3 years agoProperly check if there are perturbed constraints or masses
Magnus Lundborg [Mon, 23 Nov 2020 06:55:13 +0000 (07:55 +0100)]
Properly check if there are perturbed constraints or masses

Instead of just checking, when running updates on GPU, if
there are lambda states that involve constraints or masses
(e.g. if using fep-lambdas) check if any constraints or masses
are actually perturbed.

3 years agoMake corresponding device active before each TestDevice is created
Artem Zhmurov [Tue, 17 Nov 2020 14:22:41 +0000 (17:22 +0300)]
Make corresponding device active before each TestDevice is created

When populating the list of GPU devices for tests, the DeviceContext and
DeviceStream objects are created for each TestDevice. In CUDA, the
active device has to be explicitly set by the API since the DeviceStream
is created for the active device. Otherwise, all the streams are created
for the first device. When these streams are later used for the devices
other than first, CUDA API returns an invalid argument error. The bug only
affects unit tests in CUDA builds for systems with more than one GPU.
Does not affect OpenCL/SYCL builds, because they use DeviceContext to
attach the device to the stream (queue).

Fixes #3781, #3782 and #3805.

3 years agoLook for the various possible names of the gromacs package.
M. Eric Irrgang [Thu, 29 Oct 2020 21:07:19 +0000 (22:07 +0100)]
Look for the various possible names of the gromacs package.

Refs #3777

3 years agoSeparate VV first and second steps from MD loop
Artem Zhmurov [Fri, 6 Nov 2020 07:14:13 +0000 (10:14 +0300)]
Separate VV first and second steps from MD loop

This combines code blocks that are only active for VV
integrators, and moves them into a separate source file.
Makes logic in the do_md(..) more clear and prepares for
the removal of VV from the legacy integrator.

3 years agoRemove coolquote that sounds offensive without context
Artem Zhmurov [Mon, 23 Nov 2020 13:52:57 +0000 (16:52 +0300)]
Remove coolquote that sounds offensive without context

3 years agocmake: add trxio.h to legacy api interface
Christoph Junghans [Sun, 22 Nov 2020 22:50:59 +0000 (22:50 +0000)]
cmake: add trxio.h to legacy api interface

3 years agoFix missing copyright changes
Paul Bauer [Fri, 20 Nov 2020 15:20:49 +0000 (16:20 +0100)]
Fix missing copyright changes

Was overlooked during previous changes.

Refs #3288

3 years agoCreate CMake targets for each of the modules.
M. Eric Irrgang [Fri, 20 Nov 2020 14:47:10 +0000 (14:47 +0000)]
Create CMake targets for each of the modules.

Establish a template for further work towards using
CMake to manage module dependencies through targets
and the include directories they provide.

There should be no significant behavioral differences.
Actual relocation of the headers is deferred.

Refs #3288

3 years agoReplace gmxapi `erroroutput` with `stderr` and `stdout`
M. Eric Irrgang [Wed, 18 Nov 2020 16:58:03 +0000 (16:58 +0000)]
Replace gmxapi `erroroutput` with `stderr` and `stdout`

3 years agoUse lambdas to get the list of PBC names from the map of PBCs in constraints tests
Artem Zhmurov [Tue, 17 Nov 2020 18:42:48 +0000 (18:42 +0000)]
Use lambdas to get the list of PBC names from the map of PBCs in constraints tests

Extracting the names directly from the map allows to avoid repeating
and matching the names when the list is created to when the parametrized
test is called.

3 years agoSeparate the testutils module.
M. Eric Irrgang [Tue, 17 Nov 2020 16:53:02 +0000 (16:53 +0000)]
Separate the testutils module.

Create `testutils` target and separate public/private headers.
Remove `src/` from global build tree include path.

Apply some tidying demanded by clang-tidy.

Ref #3288

3 years agoRemove some extraneous compiler flags from nblib
Joe Jordan [Tue, 17 Nov 2020 13:53:46 +0000 (13:53 +0000)]
Remove some extraneous compiler flags from nblib

Closes #3798

3 years agogmxapi versioning updates.
M. Eric Irrgang [Mon, 16 Nov 2020 12:16:16 +0000 (15:16 +0300)]
gmxapi versioning updates.

Begin development for gmxapi 0.3

3 years agoBe more explicit about build-tree-only dependencies.
M. Eric Irrgang [Fri, 13 Nov 2020 11:37:55 +0000 (14:37 +0300)]
Be more explicit about build-tree-only dependencies.

Use the BUILD_INTERFACE CMake generator expression to improve
self-documentation and to prevent build-tree-only dependencies from
propagating to exported targets. When libgromacs is a STATIC target,
even private dependencies can affect the exported target through
transitive usage requirements (e.g. compiler/linker flags). However,
we currently only use the `common` and `legacy_modules` targets for
build time header paths.

Ref #3288

3 years agoDetect ARM SVE Vector length if possible
Gilles Gouaillardet [Fri, 13 Nov 2020 09:14:37 +0000 (09:14 +0000)]
Detect ARM SVE Vector length if possible

arm_sve: unless the SVE vector length is explicitly set via the
GMX_SIMD_ARM_SVE_LENGTH macro, detect the default vector length
and aborts if it cannot be found.

Thanks Olly Perks for the pointer.

3 years agoProvide a catch-all target for library modules.
M. Eric Irrgang [Fri, 13 Nov 2020 07:39:20 +0000 (07:39 +0000)]
Provide a catch-all target for library modules.

Prepare to remove `src/` from global build tree include path.
Existing module headers are accessible through the new `legacy_modules`
target.

Ref #3288

3 years agoFix thread mpi linking for mdrun only build
Paul Bauer [Thu, 12 Nov 2020 10:45:27 +0000 (11:45 +0100)]
Fix thread mpi linking for mdrun only build

The linking would fail because the library include directory was not
added properly.

Fixes #3807

3 years agoProvide common library headers through new CMake target.
M. Eric Irrgang [Thu, 12 Nov 2020 13:13:20 +0000 (13:13 +0000)]
Provide common library headers through new CMake target.

Prepare to remove `src/` from global build tree include path.
Create `src/include` and `common` target for library-level headers.

Ref #3288

3 years agoRestore correct dynamics linking behaviour
Paul Bauer [Thu, 12 Nov 2020 08:56:08 +0000 (09:56 +0100)]
Restore correct dynamics linking behaviour

Recent changes to the way shared libraries are managed introduced a bug
in setting up static linking by default when building mdrun only.

Fixes #3806

3 years agoFix gmx do_dssp CHARMM support
Paul Bauer [Wed, 11 Nov 2020 14:36:20 +0000 (15:36 +0100)]
Fix gmx do_dssp CHARMM support

The tool would not work correctly due to issues with detecting some
oxygen molecules.

Fixes #3568

3 years agoFix gcc 9 "warning: ‘unused’ attribute ignored"
Szilárd Páll [Wed, 11 Nov 2020 14:28:14 +0000 (14:28 +0000)]
Fix gcc 9 "warning: ‘unused’ attribute ignored"

gcc 9 seems to not like the unused because it would never warn anyway
about members, but clang does require it.

3 years agoFix segmentation fault in gmx pairdist
Paul Bauer [Wed, 11 Nov 2020 13:56:29 +0000 (13:56 +0000)]
Fix segmentation fault in gmx pairdist

When using the pairdist tool with a coordinate in space as selection,
the tool would overwrite the selection group of the selection by default
to implement reference grouping. This would change the selection type of
the coordinate from INDEX_UNKNOWN to INDEX_ALL by default (or to any
other user supplied reference grouping). The change of the selection
type would then later cause a segmentation fault, as the underlying
machinery would try to access the non-existing atoms belonging to the
selection.

This changes the mechanism to no longer overwrite the selection group
type if the current one is INDEX_UNKNOWN.

Introduces test case with command line selection that would crash
without the fix.

Fixes #3762

3 years agoMake eelType and evdwType scoped enums, + cleanup
Andrey Alekseenko [Wed, 11 Nov 2020 12:36:21 +0000 (12:36 +0000)]
Make eelType and evdwType scoped enums, + cleanup

- Make enums eelType and evdwType scoped, explicitly type relevant arguments.
- Remove code duplication between OpenCL and CUDA related to choosing the proper value of these enums.
- Remove declarations of two never defined functions from `src/gromacs/nbnxm/nbnxm.h`.
- Add names for ljcr (LJ comb. rules) enum values.

3 years agoSecond GROMACS 2021 beta release
Paul Bauer [Wed, 11 Nov 2020 10:30:50 +0000 (10:30 +0000)]
Second GROMACS 2021 beta release

Feature freeze for 2021 branch.

3 years agoUpdate gmx msd documentation
Berk Hess [Wed, 11 Nov 2020 07:42:53 +0000 (08:42 +0100)]
Update gmx msd documentation

Removed comment on weighted fitting for determining the diffusion
coefficients. This weighting had been removed at some point, but
the documentation had not been updated.

3 years agoFix "GMX_CUDA|OCL_NB_EWALD_TWINCUT is disabling twin cut-off"
Andrey Alekseenko [Tue, 10 Nov 2020 15:21:45 +0000 (16:21 +0100)]
Fix "GMX_CUDA|OCL_NB_EWALD_TWINCUT is disabling twin cut-off"

3 years agoDisable failing NB-LIB listed forces tests
Paul Bauer [Tue, 10 Nov 2020 16:45:03 +0000 (17:45 +0100)]
Disable failing NB-LIB listed forces tests

Tests are not stable enough to be run in all configurations and need
some more digging into for a proper solution.

Refs #3795

3 years agoNBLIB: Fix build warning from uninitialized array
kanduri [Tue, 10 Nov 2020 16:54:53 +0000 (16:54 +0000)]
NBLIB: Fix build warning from uninitialized array

3 years agoGPU codepath cycle counting fixes
Szilárd Páll [Tue, 10 Nov 2020 12:33:23 +0000 (12:33 +0000)]
GPU codepath cycle counting fixes

* eliminated double-counting in bonded module initialization
* moved the bonded kernel launch counting into the gpuBoned module
* avoid counting ~0 CPU update work on the GPU path by conditionally
starting the ewcUPDATE counter
* also added some minimal improvements to the wallcycle debugging
tooling which should facilitate finding invalid nesting and missing
stop calls.

Refs #3764

3 years agoAdd move operations to GpuHaloExchange
Mark Abraham [Mon, 9 Nov 2020 15:16:01 +0000 (16:16 +0100)]
Add move operations to GpuHaloExchange

This avoids needing to put the objects in a unique_ptr to put them in
a container. Also made a collection of them use std::array for
clarity.

3 years agoFix dHdl and foreign energy clearing at checkpointing
Berk Hess [Mon, 9 Nov 2020 20:37:31 +0000 (21:37 +0100)]
Fix dHdl and foreign energy clearing at checkpointing

The code copying dH/dl and foreign lambda energies to the checkpoint
data structures copied the wrong way around leading to zero values
being written to energy file for steps in between the last energy
frame and the checkpoint.

Fixes #3763

3 years agoFix MTTK constant energy bugs
Pascal Merz [Tue, 10 Nov 2020 03:01:39 +0000 (20:01 -0700)]
Fix MTTK constant energy bugs

Fixes #3796

This also fixes an unclear comment relating to the barostat
Nose-Hoover chain variables in t_state.

3 years agoAdd SYCL implementation of LeapFrogGpu
Andrey Alekseenko [Mon, 9 Nov 2020 17:57:21 +0000 (17:57 +0000)]
Add SYCL implementation of LeapFrogGpu

An implementation of LeapFrogGpu integrator using SYCL. Also, some additions to SYCL's DeviceBuffer.

Code pretty much follows CUDA version.

For float3, I had to use gmx::RVec instead of SYCL's built-in cl::sycl::float3, since latter is 16 bytes.

3 years agoAdd backend for nblib listed forces API
Joe Jordan [Mon, 9 Nov 2020 14:55:16 +0000 (14:55 +0000)]
Add backend for nblib listed forces API

This adds the back-end for the nblib API defined in
listed_forces/bondtypes.h and listed_forces/definitions.h.
Additionally, header and source are added for the private
implementations of these files. These are implementation details,
and are not visible to or interactable with by the user, so they
are not part of the public API. This backend is a ground up refactoring
 of gromacs, copying the force and energy kernels but rewriting the disipatch.
There are tests that compare forces and energies to gromacs.

Each function in this commit has at least one test for correctness,
though in most cases there are many more since the functionality is
cumulative. All of this functionality has undergone extensive design
review and code review already, so it should not be necessary to go
through the whole change with a fine-tooth comb. Suggestions on how
implementations could be improved are welcome. However, they will
likely need to be addressed as follow-up issues unless they are
trivial to fix.

3 years agoUse images from GitLab docker repository
Paul Bauer [Mon, 9 Nov 2020 12:38:18 +0000 (12:38 +0000)]
Use images from GitLab docker repository

Docker is reducing the maximum number of pulls from their storage, and
we are already now hitting the limit with heavy CI activity.

Now uses images from GitLab Docker Repository instead.

Fixes #3788

3 years agoFix intemittent MdrunIOTests segfault
Andrey Alekseenko [Mon, 9 Nov 2020 11:30:10 +0000 (11:30 +0000)]
Fix intemittent MdrunIOTests segfault

In Modular Simulator, we wish to have two copies of
ComputeGlobalsElement<ComputeGlobalsAlgorithm::VelocityVerlet>. To avoid
making two separate objects, a `static thread_local` singleton was
introduced. However, it caused issues when the ModularSimulator was
built repeatedly in the same process, due to stale pointer persisting in
a static variable.

This commit adds a key-value storage to
ModularSimulatorAlgorithmBuilderHelper, and makes ComputeGlobalsElement
use it instead of static variables. This ensures proper lifetime of
cached pointers and can be used by other Elements for similar goals.

Closes #3791

3 years agoRemove source file that is no longer in use
Artem Zhmurov [Mon, 9 Nov 2020 06:20:17 +0000 (09:20 +0300)]
Remove source file that is no longer in use

All CUDA data transfer calls now use the same wrappers, the
NBNXM-specific wrapers can be removed.

3 years agoFix cycle counting in StatePropagatorDataGpu
Szilárd Páll [Mon, 9 Nov 2020 10:33:38 +0000 (10:33 +0000)]
Fix cycle counting in StatePropagatorDataGpu

Double-counting resulted in broken/truncated performance acounting
table.

Fixes #3764

3 years agoMove implementation to cpp file
Berk Hess [Mon, 9 Nov 2020 10:10:29 +0000 (10:10 +0000)]
Move implementation to cpp file

Fixes issue with missing GMX_ASSERT as well.

3 years agoUse dynamically allocated unique pointers for GPU halo tests
Alan Gray [Mon, 9 Nov 2020 09:48:34 +0000 (09:48 +0000)]
Use dynamically allocated unique pointers for GPU halo tests

The tests were intermittently failing in the enqueuing of a remote
GPU's event to a local GPU's stream because the remote object
(allocated on the stack in the innermost loop) was already destroyed (due
to the asynchronicity of the operation). This change allows the objects
to persist, and is the same way we already do it in the main code.

Fixes intermittent failures appearing in !773 and eleswhere.

3 years agoHelp clients find dependencies of imported CMake targets.
M. Eric Irrgang [Thu, 29 Oct 2020 20:48:06 +0000 (21:48 +0100)]
Help clients find dependencies of imported CMake targets.

Refs #3776

3 years agoSuggest environment variable to limit visible SYCL devices
Andrey Alekseenko [Fri, 6 Nov 2020 12:19:56 +0000 (13:19 +0100)]
Suggest environment variable to limit visible SYCL devices

As with OpenCL, there is no portable way to do it, so we suggest the
currently working Intel option.

3 years agoFix doxygen comments formattig in update.h
Artem Zhmurov [Fri, 6 Nov 2020 07:26:26 +0000 (10:26 +0300)]
Fix doxygen comments formattig in update.h

3 years agoSlightly refactor AmdZen1 detection code
Andrey Alekseenko [Thu, 22 Oct 2020 14:33:58 +0000 (16:33 +0200)]
Slightly refactor AmdZen1 detection code

3 years agoAllow pdb2gmx to handle cyclic molecules
Paul Bauer [Thu, 5 Nov 2020 16:18:24 +0000 (16:18 +0000)]
Allow pdb2gmx to handle cyclic molecules

This has been a long outstanding issue with the code not being able to
do this.

Cyclic molecules are detected by checking if chain ends are within bonding
distance from each other. This does not detect cyclic molecules over PBC
boundaries.

Initial patch proposed by Boris Timofeev.

Resolves #3571

Change-Id: Ic25e46a12fef5fb46748dc0497f469b5834d4886

3 years agoAllow CUDA build tests to succeed without GPU
Paul Bauer [Thu, 5 Nov 2020 11:35:58 +0000 (12:35 +0100)]
Allow CUDA build tests to succeed without GPU

Added early return to haloexchange GPU pathway test to not try to run
the tests without a GPU (i.e. device list is empty).

Refs #3789

3 years agoMerge branch 'origin/release-2021' into merge-2021-into-master
Paul Bauer [Thu, 5 Nov 2020 10:53:20 +0000 (11:53 +0100)]
Merge branch 'origin/release-2021' into merge-2021-into-master

Resolved Conflicts:
src/gromacs/gmxpreprocess/readir.cpp
        admin/gitlab/archive.gitlab-ci-yml

3 years agoStop showing wrong README on GitHub front page
Mark Abraham [Thu, 5 Nov 2020 09:10:34 +0000 (10:10 +0100)]
Stop showing wrong README on GitHub front page

3 years agoLimit parallelism in Github CI
Paul Bauer [Thu, 5 Nov 2020 10:27:15 +0000 (10:27 +0000)]
Limit parallelism in Github CI

Remove the -j option from CTest, avoiding issues with trying to run the
test binaries in parallel.

Set environment variable so that the build knows it is under CI, and
limits the number of thread-MPI and if needed OpenMP threads.

Activate regressiontest testing.

3 years agoDisable MTS with SD integrator
Berk Hess [Thu, 5 Nov 2020 09:57:25 +0000 (09:57 +0000)]
Disable MTS with SD integrator

The SD integrator requires different damping coefficients for
the different MTS forces and we currently don't have the different
MTS forces available separately in the integrator.

Fixes #3775

3 years agoSet pbcatom_input in order to pass later checks
Magnus Lundborg [Tue, 3 Nov 2020 20:35:14 +0000 (21:35 +0100)]
Set pbcatom_input in order to pass later checks

pbcatom_input was not set. This meant that pbcatom checks in
set_pull_init() failed for large pull groups.

Fixes: #3786