alexxy/gromacs.git
4 years agoAdd function calls to MdModules to sign up for notifications
Christian Blau [Tue, 21 Jan 2020 10:05:03 +0000 (11:05 +0100)]
Add function calls to MdModules to sign up for notifications

Allow MdModules to sign up to notifications after they know their own
options. This makes it possible that modules only get called back when
they need to and not by default and skips the if(active) logic in
functions that are called back in favour of not subscribing to the
notifications to begin with.

refs #3076

Change-Id: Ib95c1f734f919805c661ac6f6451af5da8187eec

4 years agoSplit off implementation details of MdModuleNotification
Christian Blau [Wed, 4 Mar 2020 11:22:34 +0000 (12:22 +0100)]
Split off implementation details of MdModuleNotification

For better readability and testing, moved the MdModuleNotification and
MdModulesNotifier into separate files, hiding away the implementation
details of the complex general callback-infrastructure and exposing more
clearly the callbacks that MdModules can sign up to.

Moved tests into correct directory.

Moved life-line explaining the notification machinery in MDModules from
MdModulesNotification to MdModuleNotifier, where it is better suited.

Change-Id: I0a73f99e450873903a888bcc04228737d0b814f3

4 years agoFinalize renaming of bEnerVir to computeEnergyAndVirial
Artem Zhmurov [Thu, 5 Mar 2020 08:29:12 +0000 (09:29 +0100)]
Finalize renaming of bEnerVir to computeEnergyAndVirial

This finishes the renaming started in parent. Also fixes the
function comment, messed up by clang-format.

Change-Id: I74ce276227182364d05b62d1f89166cc2748f6fc

4 years agoSimplify PME step workload management
Mark Abraham [Sun, 23 Feb 2020 14:13:01 +0000 (15:13 +0100)]
Simplify PME step workload management

Used StepWorkload further down into the PME code, rather than the
custom GMX_PME_* flags.

GMX_PME_CALC_POT was unused, so removed.

Spread, solve, and backFFT were always performed, so removed GMX_PME_*
flags and related booleans for them. Re-indented code that was behind
these branches that were always taken. Note that we don't always
calculate forces in PME (currently TPI, but perhaps soon also MC).

Change-Id: Ia7019a0042bde9ac04c3beacbf05f7af41c7ed3c

4 years agoAdd InteractionDefinitions
Berk Hess [Mon, 2 Dec 2019 20:11:02 +0000 (21:11 +0100)]
Add InteractionDefinitions

This replaces t_idef in gmx_localtop_t.
Note that t_idef is still used in t_topology.

Extends InteractList with functionality to add entries
in a simple and clean way.

Change-Id: Ib59012332b6ba09df1de5dc696438c9aba4e2f2d

4 years agoImprove TPI handling
Mark Abraham [Fri, 21 Feb 2020 16:30:38 +0000 (17:30 +0100)]
Improve TPI handling

These errors are best given in TPI-specific code, not general code.

That TPI-specific code already sets GMX_FORCE_ENERGY, which sets
GMX_PME_CALC_POT, so this should not be managed in two places.

Change-Id: I6415634b5ba63d2dc71f6db1e52daac3d15cd8f0

4 years agoSeparate AWH parameter reading and checking
Magnus Lundborg [Tue, 3 Mar 2020 10:06:27 +0000 (11:06 +0100)]
Separate AWH parameter reading and checking

To avoid dependency on order of parameter reading (pulling
before AWH) AWH now reads parameters before checking them.

Change-Id: I11ac76f1def61eac577ef8083698d76f6aac3dd4

4 years agoDo not count PME only rank when initializing NBNXM
Artem Zhmurov [Wed, 4 Mar 2020 10:26:12 +0000 (11:26 +0100)]
Do not count PME only rank when initializing NBNXM

Non-local particles should only exist when there is are more than one PP rank.

Change-Id: Ife99786652dc634039c59f530d2489bf3976c476

4 years agoMerge "Merge branch release-2020 into master"
Paul Bauer [Wed, 4 Mar 2020 11:01:37 +0000 (12:01 +0100)]
Merge "Merge branch release-2020 into master"

4 years agoSave excluded non-bonded interactions in .tpr file
Christian Blau [Tue, 18 Feb 2020 12:47:41 +0000 (13:47 +0100)]
Save excluded non-bonded interactions in .tpr file

The intermolecularExclusionGroup of the molecular topology (mtop) has
not been saved in the tpr file before, which lead to the unexpected
behviour that an mtop as set up in grompp was not available in the same
state when the simulation was started.

Excluding non-bonded interactions of a group with the rest of the system
is currently needed for the QM/MM implementation. This change will allow
to complete system setup for simulations that need to exclude non-bonded
interactions at grompp time instead when starting the simulation.

refs #3172

Change-Id: Ia0e3f0571fa467337664bedec2e91a5a008507ca

4 years agoAdd classhelper macro to forbid copy, move and any assigment
Christian Blau [Wed, 4 Mar 2020 08:04:29 +0000 (09:04 +0100)]
Add classhelper macro to forbid copy, move and any assigment

The current macro only deletes the copying and copy-assignemnt, but for
most cases also the move equivalent of these operations should be
deleted. This patch introduces a new macro to forbid copying and moving.

Change-Id: I6f2f8591b289322cf7e79003a50507cdc9d6b5b9

4 years agoMerge branch release-2020 into master
Paul Bauer [Wed, 4 Mar 2020 07:05:31 +0000 (08:05 +0100)]
Merge branch release-2020 into master

Resolved Conflicts:
.gitlab-ci.yml
admin/builds/gromacs.py
cmake/gmxVersionInfo.cmake
src/gromacs/ewald/pme.cpp
src/gromacs/gmxana/gmx_disre.cpp
src/gromacs/gpu_utils/cudautils.cu
src/gromacs/gpu_utils/gpu_utils.cu
src/gromacs/hardware/gpu_hw_info.h
src/gromacs/listed_forces/orires.cpp
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/forcerec.h
src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/md_support.h
src/gromacs/mdlib/mdoutf.cpp
src/gromacs/mdlib/mdoutf.h
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/vsite.cpp
src/gromacs/mdlib/vsite.h
src/gromacs/mdrun/minimize.cpp
src/gromacs/modularsimulator/forceelement.cpp
src/gromacs/modularsimulator/shellfcelement.cpp
src/gromacs/nbnxm/kernels_reference/kernel_ref.h
src/programs/mdrun/tests/CMakeLists.txt

Change-Id: Ic95c6b35c8a7b7bd0b9c3fa0833136d32bb74242

4 years agoMove the PmePPCommGpu initialization from forcerec to runner
Artem Zhmurov [Fri, 21 Feb 2020 16:53:26 +0000 (17:53 +0100)]
Move the PmePPCommGpu initialization from forcerec to runner

Change-Id: I955c7c53bcee571c560b1efd8a4eed7bde4d42fc

4 years agoPrepare for 2020.2
Paul Bauer [Mon, 24 Feb 2020 14:49:29 +0000 (15:49 +0100)]
Prepare for 2020.2

Reset DOI strings

Change-Id: I8a269a8537595d1070c50cfc31c610f2133618b2

4 years agoVersion 2020.1
Paul Bauer [Mon, 24 Feb 2020 14:46:14 +0000 (15:46 +0100)]
Version 2020.1

Set DOI strings.
Updated regressiontest hash.

Change-Id: I2fa83321688bf052516bab3301336d8b3145e458

4 years agoAlways hash files when building from release tarball
Paul Bauer [Thu, 16 Jan 2020 13:25:37 +0000 (14:25 +0100)]
Always hash files when building from release tarball

The CMake logic to check if the source files in a release tarball have
not been modified has not been robust enough in cases where people first
run cmake to generate the build directory and then later change files in
the source tree.

The build has now been changed to be more in line with the development
builds, where checking for modifications is happening in all cases.

Fixes #3302

Change-Id: Id54c529bfbe51191ed5262d8da05897b2f53c057

4 years agoAllow PME coordinate send before H2D coordinate transfer
Alan Gray [Sun, 5 Jan 2020 20:14:39 +0000 (12:14 -0800)]
Allow PME coordinate send before H2D coordinate transfer

The introduction of the GPU PME-PP communication functionality had the
side effect of delaying the PME coordinate send until after the H2D
coordinate transfer, even on the default code path. This patch allows
the PME transfer to occur in its original location when the send is
not originating from GPU memory. This is a lightweight solution,
without any new functionality, suitable for the release branch. (There
will be a more comprehensive change in the master branch which also
extends the GPU PME-PP communication functionality.)

Implements #3159

Change-Id: Ic30c154e04bb4c2846bbad3de603f879a71b9133

4 years agoStore dHdL for all neighbor lambdas
Magnus Lundborg [Sun, 23 Feb 2020 16:57:56 +0000 (17:57 +0100)]
Store dHdL for all neighbor lambdas

This is required for calculating forces along a lambda dimension
in AWH.

Change-Id: Ic5247a53998b1e733858419d20338b5419dd7ae4

4 years agoAdd Cuda build to gitlab CI
Paul Bauer [Mon, 3 Feb 2020 16:05:42 +0000 (17:05 +0100)]
Add Cuda build to gitlab CI

Change-Id: I7e5917fd26c0e22107fb6d9ade4ca69959737df4

4 years agoFix center of mass motion removal with frozen atoms
Berk Hess [Mon, 2 Mar 2020 14:14:21 +0000 (15:14 +0100)]
Fix center of mass motion removal with frozen atoms

When frozen atoms were part of center of mass motion removal groups,
they would still contribute to the mass of those groups. This meant
that the COM velocity correction was (slightly) too small. Now
completely frozen atoms are removed from COM removal groups by grompp.
When atoms are only frozen along one or two dimensions and part of
a COM removal group, grompp now issues a warning.

Also fixed an nullptr or incorrect string buffer passed to warning()
with invalid freeze group dimension user input.

Fixes #2553

Change-Id: I20a03fea511e75a131cb27880acc1f4ee4a2bfb8

4 years agoUpdate the message on whether update and constraints are offloaded
Artem Zhmurov [Mon, 2 Mar 2020 15:14:32 +0000 (16:14 +0100)]
Update the message on whether update and constraints are offloaded

Update and constraints are done in PP task, which is now indicated
in the printed message.

Refs #3292

Change-Id: Id3ad64c424cca6ab5e678a90db767a1c3d43b014

4 years agoFix grompp unbound atom check
Berk Hess [Mon, 2 Mar 2020 16:42:03 +0000 (17:42 +0100)]
Fix grompp unbound atom check

The check in grompp for unbound atoms would check for any
potential (and constraints) instead of only potentials involving
two atoms. This enabled false negatives.

Change-Id: I677b86a4e4bbe8cd0c6a8a0bf43983be622edfa6

4 years agoFix nrdf with partial COMM removal
Berk Hess [Mon, 2 Mar 2020 10:15:51 +0000 (11:15 +0100)]
Fix nrdf with partial COMM removal

In the uncommon case where the center of mass motion is removed for
part of the system but not the whole system, the number of degrees
of freedom for the part without COMM removal would be incorrectly
lowered by 3.

Fixes #3406

Change-Id: I371bcfbbd6cf7ddddccb9234752128239bad356f

4 years agoFix too small pairlist buffer on Intel GPUs
Berk Hess [Mon, 2 Mar 2020 15:20:26 +0000 (16:20 +0100)]
Fix too small pairlist buffer on Intel GPUs

The pairlist buffer generated for Intel GPUs was slightly too small,
because it assumed a 4x4 atom-cluster pair kernel instead of 4x2.
This also fixes incorrect kernel setup messages in the log file.

Fixes #3407

Change-Id: I744f98a934b5d9f60e0708cb064571aa6e389c44

4 years agoRevert "Remove frozen atoms from VCM groups"
Paul Bauer [Mon, 2 Mar 2020 08:37:08 +0000 (09:37 +0100)]
Revert "Remove frozen atoms from VCM groups"

This reverts commit 3a93c3a8ed49d20b47aed181d98f64921b864a3d.

Reason for revert: Change is incorrect

Change-Id: I808655e109e1da7ce37a59c1d55dabd059a32bb7

4 years agoRemove frozen atoms from VCM groups
Paul Bauer [Thu, 27 Feb 2020 10:47:26 +0000 (11:47 +0100)]
Remove frozen atoms from VCM groups

Atoms are removed during preprocessing.

Also add release note missing for previous patch.

Fixes #2553

Change-Id: I4fd52d50a9ef3af4ed11f9b507902d4ac59ed487

4 years agoRemove unused variable from nbnxm headers.
Gilles Gouaillardet [Mon, 2 Mar 2020 04:33:52 +0000 (13:33 +0900)]
Remove unused variable from nbnxm headers.

Since the (SimdFloat) mone_S variable is set but never used,
this commit simply removes it.

Change-Id: Id374da57d1fb33a269c1c39eb80c064fc40de8e8

4 years agoMerge branch release-2019 into release-2020
Paul Bauer [Fri, 28 Feb 2020 09:56:27 +0000 (10:56 +0100)]
Merge branch release-2019 into release-2020

Resolved Conflicts:
cmake/gmxVersionInfo.cmake
src/gromacs/ewald/pme.cpp
src/gromacs/gmxana/gmx_disre.cpp
src/gromacs/gpu_utils/gpu_utils.cu
src/gromacs/hardware/gpu_hw_info.cpp
src/gromacs/hardware/gpu_hw_info.h
src/gromacs/mdrun/rerun.cpp

Change-Id: I2a89270a1321a51e0bc25e2b6890245f562945a2

4 years agoDefine all CPU NB kernels
Paul Bauer [Thu, 27 Feb 2020 14:00:12 +0000 (15:00 +0100)]
Define all CPU NB kernels

Access to kernels that where not defined could otherwise lead to
undefined behaviour.

Fixes #2728

Change-Id: Ib014cfd0dbc46961eb4e6a81acb3e06d57c3df73

4 years agoMoves call to choose best performaing kernels to pme_gpu_reinit_atoms
Jonathan Vincent [Mon, 24 Feb 2020 14:26:20 +0000 (06:26 -0800)]
Moves call to choose best performaing kernels to pme_gpu_reinit_atoms

atoms.nAtoms is zero when pme_gpu_reinit is called, resulting in
the useOrderThreadsPerAtom and recalculateSplines always being set to false.

Refs #3189

Change-Id: I36d4be71565cfe8cd8e50fbe6cfe1035f3e15c8e

4 years agoVersion 2019.6
Paul Bauer [Mon, 24 Feb 2020 14:54:18 +0000 (15:54 +0100)]
Version 2019.6

Set DOI strings.
Updated regressiontest hash.

Change-Id: If7c04fbd26756275daea1c252ef977a367669b42

4 years agoLoosen gmxapi stopsignaler test
Pascal Merz [Tue, 25 Feb 2020 07:15:45 +0000 (00:15 -0700)]
Loosen gmxapi stopsignaler test

Gmxapi stopsignaler test was checking whether simulations were stopped
on the step after a stop signal was set. This is true for the legacy
implementation, but only due to the exact order of instructions. The
StopSignalHandler does not guarantee to stop simulations at the next
NS step after a signal has been set, it promises to stop a simulation
at the next NS step after a signal has been communicated. This change
loosens the criterion to reflect this.

Further, this change
* Changes the numberOfTimesCalled() function to timeElapsedSinceStart(),
  also including a different treatment of the call before the restraint
  is ever called, to avoid misunderstandings.
* Adds a comment to explain the expectations validated by this test.

Fixes #3397

Change-Id: I2a3805a14c03d0ee12ebd21b5863c5243b1c3671

4 years agoResolve a Python linting error.
M. Eric Irrgang [Thu, 27 Feb 2020 12:05:58 +0000 (15:05 +0300)]
Resolve a Python linting error.

Remove an unnecessary compatibility check that otherwise causes lint
errors.

Change-Id: If6b79c9cc4b7b4adf37a0bad291ce421a23564c9

4 years agoFix broken Python error check.
M. Eric Irrgang [Thu, 27 Feb 2020 12:04:38 +0000 (15:04 +0300)]
Fix broken Python error check.

A check in the physical validation utilities referenced a constant in a
module that does not exist, but the intended module was clear.

Additionally, the constant is not guaranteed to be defined, so we check
for it to avoid producing unrelated exceptions.

Change-Id: Ied614c4d94616420b9321cd28d8f8958cce31627

4 years agoUse legacy code path for t_graph (modular simulator)
Pascal Merz [Fri, 21 Feb 2020 01:11:13 +0000 (18:11 -0700)]
Use legacy code path for t_graph (modular simulator)

This change redirects simulations which will require a t_graph object
to the legacy code path. It also adds an assert to catch cases in which
the redirection would fail in a more graceful way.

Fixes #3389

Change-Id: I17a70e504c206b2798cd2439c0c0ff5d5cd112e3

4 years agoExtract and expose function to determine whether molecules are broken over PBC
Pascal Merz [Wed, 26 Feb 2020 23:19:29 +0000 (16:19 -0700)]
Extract and expose function to determine whether molecules are broken over PBC

This prevents code duplication in the child change I17a70e50. This
is pure refactoring with two exceptions:
* Checking for orientation restraints is changed from
    fcd->orires.nr
  to
    gmx_mtop_ftype_count(mtop, F_ORIRES)
  This allows to use this function before the force constant struct
  is built. An assert is added to make sure this never get out of
  sync (which would hint to something going very wrong somewhere else...)
* A `if(fplog){}` around a single GMX_LOG(mdlog.warning) was removed.

Change-Id: I6303c6b1cab86c57971a1486c892a1b122a446c6

4 years agoFix constraint contribution to dhdl (modular simulator)
Pascal Merz [Thu, 16 Jan 2020 08:13:05 +0000 (09:13 +0100)]
Fix constraint contribution to dhdl (modular simulator)

The contribution to dhdl from the constraints was not added under
modular simulator.

Refs #1255

Change-Id: I804f52eeb97a17ae0d233700203da1db33a54d54

4 years agoAvoid mdrun terminate due to GPU sanity check errors
Szilárd Páll [Fri, 25 Oct 2019 23:24:23 +0000 (01:24 +0200)]
Avoid mdrun terminate due to GPU sanity check errors

When a GPU is a exclusive or prohibited mode, early detection calls can
fail and as a result an mdrun run abort with an error, even if all GPU
offload is explicitly disabled by the user.
This change adds a status code to handle the case of devices being
unavailable.

Additionally, other errors may be encountered during the dummy kernel
sanity check (e.g. out of memory), but since the change that switches
to using launchGpuKernel() wrapper did not handle the exception in the
sanity checking, this can also abort a run even if the GPU in question
is not selected to be used.
This change adds code to catch the exception this and report the error
and avoid abort the run.

Fixes #3178 #3399

Change-Id: I0cdedbc02769084c172e4a42fe5c1af192007cec

4 years agoDocument NVIDIA OpenCL broken on Volta and Turing
Szilárd Páll [Wed, 26 Feb 2020 15:07:25 +0000 (16:07 +0100)]
Document NVIDIA OpenCL broken on Volta and Turing

Refs #3125

Change-Id: Id200c1092b279d45a97b98c6fe1d03c2ffb14fb0

4 years agoRemove outdated PME-GPU limitation in user guide
Szilárd Páll [Thu, 20 Feb 2020 18:20:26 +0000 (19:20 +0100)]
Remove outdated PME-GPU limitation in user guide

PME GPU is supported on all compatible GPU platforms and vendors.

Change-Id: I8b054825d4c6a2d030b87fe4b6a9be759911c9f6

4 years agoFix calculation of reciprocal terms in rerun
Pascal Merz [Tue, 25 Feb 2020 23:58:02 +0000 (16:58 -0700)]
Fix calculation of reciprocal terms in rerun

This at least temporarily fixes #3400.

Change-Id: I04d67d9bb3edbd66049573de71940e4bb7fa1ad4

4 years agoFix out of sync checkpoint files in simulations sharing state
Magnus Lundborg [Wed, 19 Feb 2020 12:17:14 +0000 (13:17 +0100)]
Fix out of sync checkpoint files in simulations sharing state

When multidir simulations share the state, the checkpoint files
of the different simulations should all be from the same step.
To ensure this, MPI barriers have been added before renaming
the checkpoint files from their temporary to their final names.
So now the contents can never be out of sync. In the worst, and
rather unlikely, case that something going wrong during renaming,
some checkpoint files could have temporary and some final names.

Refs #2440.

Change-Id: I88088abb726a36dbf9a9db2fa2eb4a46c3bf2cd7

4 years agoFix the RVec to float3 conversion test
Artem Zhmurov [Mon, 24 Feb 2020 17:56:44 +0000 (18:56 +0100)]
Fix the RVec to float3 conversion test

The test was not running when there were no GPUs availible,
but the code was compiled with CUDA.

Refs. #3372.

Change-Id: I8dd51eafe9a17d880ce8f8b126c7de692e061e81

4 years agoImprove GPU update tasks assignment consistency
Szilárd Páll [Fri, 24 Jan 2020 13:12:28 +0000 (14:12 +0100)]
Improve GPU update tasks assignment consistency

GPU update task assignment was not consistent with the assumptions and
supported features of the 2020 release and did not implement the correct
checks and fallback in cases where GPU update was decided to not be
supported. Specifically, this change makes sure that when separate PME
ranks are used, without direct GPU communication for PP-PME, GPU update
falls back to the CPU.

Fixes #3354

Change-Id: I7c9dd67cd8cf61f0201b626b8b7674917e3365a5

4 years agoRemove cruft and resolve deprecation warnings.
M. Eric Irrgang [Thu, 12 Dec 2019 17:22:07 +0000 (20:22 +0300)]
Remove cruft and resolve deprecation warnings.

Feature checks for gmxapi 0.1 are no longer necessary in the acceptance
tests, and cause deprecation warnings since the gmxapi version has been
incremented.

Change-Id: I98d4df5789c6156304efe27394a2bde20b390234

4 years agoAvoid integer overflow in dispersion correction
Paul Bauer [Fri, 21 Feb 2020 14:49:21 +0000 (15:49 +0100)]
Avoid integer overflow in dispersion correction

Index could become out of range and turn negative.

Fixes #3391

Change-Id: I91a8ea0ab01370fb972c02994e2b996284e1d06a

4 years agoDocument density-fit cross-correlation in .mdp options
Christian Blau [Tue, 25 Feb 2020 09:25:02 +0000 (10:25 +0100)]
Document density-fit cross-correlation in .mdp options

Add missing documentation about cross-correlation as
similarity measure for density-guided simulations.

Though documented in the reference manual, it was until now
not mentioned in the .mdp options.

Change-Id: I2a5a13ca6fb0a15e8c2ff1cba6a6edbe0182053d

4 years agoRevert "Expose vsite counting"
Paul Bauer [Mon, 24 Feb 2020 12:29:21 +0000 (13:29 +0100)]
Revert "Expose vsite counting"

This reverts commit 2078fd0619459bd533a94550d5754477dbbaabaa.

Not needed in fact.

Change-Id: I238d33e23e3b508ec0c77a5c43f67e5838950f34

4 years agoFix docstring bugs.
M. Eric Irrgang [Mon, 24 Feb 2020 21:11:43 +0000 (00:11 +0300)]
Fix docstring bugs.

Resolve sphinx errors for gmxapi.commandling_operation docstring.

Change-Id: Ib4ed2228912a180dee8d56850e95cac20d0a9635

4 years agoFix sphinx-build option typo.
M. Eric Irrgang [Mon, 17 Feb 2020 10:41:58 +0000 (13:41 +0300)]
Fix sphinx-build option typo.

A space between `-D` and the configuration key causes a warning about
an unknown option.

Change-Id: I2279663004216b4af098d025431fe02de51b4a78

4 years agoFix clang-6 image template
Paul Bauer [Sat, 22 Feb 2020 12:31:41 +0000 (13:31 +0100)]
Fix clang-6 image template

Overlooked this when merging 1093dfa9ba24329162179a3fcbcbb8c491ab9543.

Change-Id: I85d5b852ab5d565289d64dd21ade09dabd4115c4

4 years agoLet commandline_operation accept stdin.
M. Eric Irrgang [Mon, 24 Feb 2020 10:01:55 +0000 (13:01 +0300)]
Let commandline_operation accept stdin.

Add a *stdin* key word to gmxapi.commandline.cli() and
gmxapi.commandline_operation(). Optionally accept a string object to
pass to the subprocess standard input pipe.

Fixes #3393

Change-Id: I563aeb19e944e7e9e755a72b1956b61ff7789c22

4 years agoMake gmxapi.version.has_feature warning more useful.
M. Eric Irrgang [Thu, 12 Dec 2019 17:14:45 +0000 (20:14 +0300)]
Make gmxapi.version.has_feature warning more useful.

When issuing a warning about misuse of a utility, use `stacklevel=2`
instead of the default (stacklevel=1) to report the context of the call
to the utility, rather than that of the call to `warnings.warn()`,
so that the warning can actually direct a developer to the source of the
problem.

Change-Id: I86cedaf8863e589fed385199b573bb1a420655e2

4 years agoUse subprocess.run instead of subprocess.check
M. Eric Irrgang [Mon, 24 Feb 2020 09:22:27 +0000 (12:22 +0300)]
Use subprocess.run instead of subprocess.check

Resolve a TODO in commandline.py to use more robust subprocess facility
in Python >=3.5.

Change-Id: I4e87fbf94c52a18ce21c9f26a800f297deb3f512

4 years agoImprove gmxapi.operation error handling.
M. Eric Irrgang [Fri, 21 Feb 2020 15:42:38 +0000 (18:42 +0300)]
Improve gmxapi.operation error handling.

Improve error handling logic and documentation for operation execution.
Make the exception messages more useful.

Fixes #3376

Change-Id: Ie16fd814faff0d0565a2c7a271b2bed9d2c1939b

4 years agoClarify annotation about GitLab CI Docker images.
M. Eric Irrgang [Fri, 14 Feb 2020 15:35:09 +0000 (18:35 +0300)]
Clarify annotation about GitLab CI Docker images.

Change-Id: I17f49885f423942ff47cf790ff5f895f56a63259

4 years agoUse ArrayRef in compute_globals
Pascal Merz [Fri, 24 Jan 2020 23:10:22 +0000 (23:10 +0000)]
Use ArrayRef in compute_globals

This refactors compute_globals to use ArrayRef instead of rvec
pointers.

Change-Id: I0e16b7bcee0583326180c6c93a7feddbb7213bfe

4 years agoUse more forward declarations to removed header dependencies
ejjordan [Fri, 21 Feb 2020 17:10:02 +0000 (18:10 +0100)]
Use more forward declarations to removed header dependencies

Change-Id: I6a5706c8380c8d630ccc854f617206f6b66e7907

4 years agoRemoved unused PME gather functionality
Mark Abraham [Mon, 17 Feb 2020 07:51:51 +0000 (08:51 +0100)]
Removed unused PME gather functionality

This code path has never been used since being introduced in
2747fc481b7110a, so we should simplify. It also avoids compiling extra
GPU kernels that were also never used.

Updated reference data now that there's half as many cases to cover.

Change-Id: Ia6bc7d1161fb76dad5715234ff820759bde0d81c

4 years agoFixed bug in gmx disre due to inconsistency in input.
David van der Spoel [Mon, 17 Feb 2020 22:20:24 +0000 (23:20 +0100)]
Fixed bug in gmx disre due to inconsistency in input.

The gmx disre program used the labels in the distance restraint entries
(see manual) as an index in internal arrays. This might lead to either
memory errors or the program stopping due to uninitialized variables.

Fixes #3384

Change-Id: Ic2d77c3fd81547e030bf7ce21860a71e3adbb2b3

4 years agoAdd missing header and disable failing test
Artem Zhmurov [Fri, 21 Feb 2020 20:14:55 +0000 (21:14 +0100)]
Add missing header and disable failing test

Fixes the issues, introduced in dd0439e0a189e0c28e738afe283ce3a71513aaa6.

Refs. #3372.

Change-Id: Ibced28fef1057598793b81142d555016208db424

4 years agoUse legacy code path for NMR restraints (modular simulator)
Pascal Merz [Fri, 21 Feb 2020 00:34:04 +0000 (17:34 -0700)]
Use legacy code path for NMR restraints (modular simulator)

Fixes #3388

Change-Id: I03db8af35d71c7405716e73516c4235fc089334c

4 years agoCorrect for skewed box in non-DD modular simulator
Pascal Merz [Thu, 20 Feb 2020 21:15:56 +0000 (14:15 -0700)]
Correct for skewed box in non-DD modular simulator

In modular simulator, the correction for skewed boxes was only performed
when DD was active. This change makes sure it happens in all cases.
Also left a TODO to think about unifying the approach for the two cases
moving forward.

Fixes #3383
Refs #3392

Change-Id: I897dbc9e490bb1a1e465e711c66b47a29e214fd1

4 years agoAdd fatal error when multisim runs sharing state have different init_step
Berk Hess [Fri, 21 Feb 2020 10:36:04 +0000 (11:36 +0100)]
Add fatal error when multisim runs sharing state have different init_step

Refs #2440
Fixes #3990

Change-Id: I052cd53dc9517a3df53663e52720ee5a80ea65c0

4 years agoSimplify GitLab CI Dockerfiles.
M. Eric Irrgang [Wed, 25 Dec 2019 15:55:34 +0000 (18:55 +0300)]
Simplify GitLab CI Dockerfiles.

Consolidate some docker build instructions into distinct images for
the base dependencies, the various toolchains, and the docs build
environment. Combine Dockerfiles that only differ in toolchain version.

Total image size is prioritized over total build time by making all
apt-get layers include update, install, and cleaning in single RUN
commands, where intermediate layers are part of the tagged images.

Made images both for clang and gcc builds of the documentation.

Refs #3263

Change-Id: I55d6a128067f78214193223756db94a1964c491d

4 years agoFix Gitlab doc build
Paul Bauer [Fri, 21 Feb 2020 08:01:14 +0000 (09:01 +0100)]
Fix Gitlab doc build

Change-Id: I058008a1df5ec2fc3406aeb51b52611eaa16a496

4 years agoRefactor and enable RVec to float conversion test
Artem Zhmurov [Thu, 6 Feb 2020 11:39:39 +0000 (12:39 +0100)]
Refactor and enable RVec to float conversion test

Since using CUDA directly in Google tests is not always possible,
this patch moves the cuda-specific code into separate runner file.
Also the RVec->float3 casting function is moved into new header,
thus eliminating inclusion of the cuda runtime in the tests. The
test file is renamed to reflect what is actually tested.

Fixes the post submit failure introduced in
c5c220a03663d975e31e8573c1849247ce3f8ad0, which was first avoided
by disabling the test in e91b744e8cbf2038a4dddce0609a33f396902bb5.

Fixes #3372.

Change-Id: Ie6423876e7725766109f74fdd3e76a24188b0b18

4 years agoDo not call PME GPU builder in CPU code paths
Artem Zhmurov [Thu, 20 Feb 2020 08:09:09 +0000 (09:09 +0100)]
Do not call PME GPU builder in CPU code paths

Currently, the logic of whether or not to execute the PME GPU builder
in tests relies on passing nullptr in CPU code paths. This patch
replaces this conditional with assert and removes the builder call in
CPU code paths.

Change-Id: I9fa93146091754df1bbc8f142a16fc1936ae53ea

4 years agoUse GROMACS wrappers for EXPECT_THROW/NO_THROW in PME tests
Artem Zhmurov [Thu, 20 Feb 2020 13:29:34 +0000 (14:29 +0100)]
Use GROMACS wrappers for EXPECT_THROW/NO_THROW in PME tests

The EXPECT_THROW_GMX and EXPECT_NO_THROW_GMX wrappers provide more
information in case of test failure.

Change-Id: Ib935425ff3c0436fcefb88ea54c9e5c0501c0084

4 years agoUse CUDA float3 vector type instead of fvec in GPU bonded kernels
Artem Zhmurov [Wed, 5 Feb 2020 16:11:37 +0000 (17:11 +0100)]
Use CUDA float3 vector type instead of fvec in GPU bonded kernels

Using fvec in CUDA can be inneficient and requires re-definition
of vector operations. This commit switches the GPU bonded kernels
to using float3 instead of fvec.

Change-Id: Ib3bfa3e20501cdd22fc6e599b749c750fa468e80

4 years agoFixed bug in orires code that was checking too strict.
David van der Spoel [Wed, 12 Feb 2020 13:53:33 +0000 (14:53 +0100)]
Fixed bug in orires code that was checking too strict.

Fixes #3375

Change-Id: I0f64b386477b9a72f18c95fd977ac8cf5dbeeccd

4 years agoFixed bug in orires code that was checking too strict.
David van der Spoel [Wed, 12 Feb 2020 13:53:33 +0000 (14:53 +0100)]
Fixed bug in orires code that was checking too strict.

Added one test to see that input is accepted.

Fixes #3375

Change-Id: I0f64b386477b9a72f18c95fd977ac8cf5dbeeccd

4 years agoAdded more docs and tests to EnumerationArray
Mark Abraham [Mon, 17 Feb 2020 07:22:38 +0000 (08:22 +0100)]
Added more docs and tests to EnumerationArray

It is now more clear that there is no risk of a segfault if somehow
Foo::Count was used to look up a value from an EnumerationArray. The
assertion would not be nice for a user to get either, but the positive
aspects that flow from having enumeration helpers that need the Count
field outweighs this downside.

Change-Id: I6111e79042326044a807b9b8ac58f32760a56b82

4 years agoSplit MdModuleNotifications into topics
Christian Blau [Fri, 17 Jan 2020 13:15:14 +0000 (14:15 +0100)]
Split MdModuleNotifications into topics

Use different notifers to distinguish MdModule callbacks to

 - preprocessing
 - simulation setup
 - checkpointing

refs #3076

Change-Id: I08b2ff7e90e42fce44043d7c0f2a9304d404445c

4 years agoFixed typo in GMXRC.csh.cmakein
David van der Spoel [Mon, 17 Feb 2020 15:22:52 +0000 (16:22 +0100)]
Fixed typo in GMXRC.csh.cmakein

A bashism crept into a csh file.

Refs #3381.

Change-Id: I2f11e027db2804ee850f93a2d18de8ad427abc8e

4 years agoAdd simulation workload flag for dipole computation
Szilárd Páll [Mon, 3 Feb 2020 10:38:50 +0000 (11:38 +0100)]
Add simulation workload flag for dipole computation

Change-Id: I4e7828d4dc73fb9caea100e0303779853be80c70

4 years agoEstablish stubs for documenting GitLab configuration.
M. Eric Irrgang [Wed, 12 Feb 2020 15:56:17 +0000 (18:56 +0300)]
Establish stubs for documenting GitLab configuration.

Insert an `infrastructure` document under the `tools` node to own the
`jenkins` doc and a new `gitlab` doc.

Refs #3275

Change-Id: I4aa03949b4216290933716beb88b439a8a0940c4

4 years agoReformat .gitlab-ci.yml
M. Eric Irrgang [Sat, 15 Feb 2020 12:20:32 +0000 (15:20 +0300)]
Reformat .gitlab-ci.yml

Normalize indentation and remove trailing white space.

Change-Id: I41ee8ded2e41edcc05b6dc414524644af9378976

4 years agoFix gpuudpate and gpucomm matrix docs
Szilárd Páll [Fri, 14 Feb 2020 18:12:27 +0000 (19:12 +0100)]
Fix gpuudpate and gpucomm matrix docs

Improves the outdated documentation/description of the matrices
clarifying the use/role of these.

Also removed gpubufferops matrix which is not needed in the release
branch (the feature is automatically triggered when required by some
other features).

Change-Id: I097e1d6b150767a95b9d638b3c6031a24ece995f

4 years agoRemove 1 pulse DD request
Berk Hess [Fri, 24 Jan 2020 13:59:21 +0000 (14:59 +0100)]
Remove 1 pulse DD request

Since the CUDA DD code now supports multiple pulses this is no longer
needed.

Refs #3106

Change-Id: I2db1d3cf45d9b0c814c0897a048bc5efb9f99e79

4 years agoMultiple pulses for GPU Halo Exchange
Alan Gray [Fri, 6 Dec 2019 13:19:43 +0000 (05:19 -0800)]
Multiple pulses for GPU Halo Exchange

Removes restriction on single pulse.

Implements #3106

Change-Id: I5d68258de831d04c14d6c352fc52e51852fccd80

4 years agoExpand test coverage of exact continuation tests
Pascal Merz [Thu, 13 Feb 2020 02:37:57 +0000 (19:37 -0700)]
Expand test coverage of exact continuation tests

The exact continuation tests were not covering the new
Parrinello-Rahman functionality of modular simulator, nor the
berendsen-berendsen NPT case using md-vv. This change fixes this.

Fixes #3377 (fixes point 4, last task on the list)

Change-Id: I3bcd072969259383dd1812d425dd7b3baee5bd85

4 years agoFix reading of checkpoints with Parrinello-Rahman (modular simulator)
Pascal Merz [Thu, 13 Feb 2020 02:32:36 +0000 (19:32 -0700)]
Fix reading of checkpoints with Parrinello-Rahman (modular simulator)

Using modular simulator, simulations using Parrinello-Rahman barostat
could not be read from checkpoint, throwing an error in the checkpoint
loading routine. While the legacy implementation of the P-R barostat
required the pressure at the previous step to be checkpointed, the
modular implementation does not require this. load_checkpoint is,
however, expecting this field to be present and throws an error.

This change fixes this by setting the globalState flags in dependence
of whether the modular simulator will be used, avoiding read_checkpoint
to expect this entry.

Note that tests ensuring this bug not to reappear are introduced in the
child change I3bcd0729.

Refs #3377 (fixes point 3)

Change-Id: If8afd294b8c79ceef66e71293d9d93cf2f7d0df8

4 years agoFix Parrinello-Rahman scaling on initial step (modular simulator)
Pascal Merz [Thu, 13 Feb 2020 02:09:13 +0000 (19:09 -0700)]
Fix Parrinello-Rahman scaling on initial step (modular simulator)

If Parrinello-Rahman scaling was requested on the first step, it was
not properly initialized. The setup routine would have correctly
(although non-obviously so) calculated the scaling matrix, but have
requested the propagator to use the scaling one step too late.

For new simulations, this never happens (since scaling happens on the
second step, not the first). It could, however, lead to slight
errors if restarting from a checkpoint occured exactly on a scaling
step. As restarting from Parrinello-Rahman simulations using modular
simulator was broken anyway, we can be sure that this has never
happened in practice.

This change fixes the bug, adds explanations of what happens on the
initial step, and makes the function calls more explicit (at the cost
of a very small amount of code duplication).

Refs #3377 (fixes point 2)

Change-Id: Ic3ba7ba078260a9d039d506fc0a87353f80d23dd

4 years agoMove modular simulator decision before checkpoint loading
Pascal Merz [Wed, 12 Feb 2020 23:58:57 +0000 (16:58 -0700)]
Move modular simulator decision before checkpoint loading

Currently, the decision on whether to use modular simulator is done
relatively late during the runner stage. This makes it impossible to
allow for different behavior at checkpoint loading time. The current
change therefore moves this decision before checkpoint loading time.
To achieve this, some adaptations were needed:

* Use gmx_mtop_interaction_count to determine whether virtual sites
  will be used before the respective object is created.
* The membrane embedding check via pointer is replaced by a boolean
  set earlier during the runner phase.
* The essential dynamics check was split to catch command line inputs
  during the runner phase, and mismatching checkpointing data during
  the simulator phase (mirroring legacy behavior in do_md()).
* Replace the ensemble restraint check by a low-level alternative
  for the early runner call (mimicking the distance restraint
  initialization), while keeping the current check for the
  simulator-level call. Note that as multi sims are disabled, this
  low-level test will effectively never fail, but the additional
  clarity is helpful in further development. The later test ensures
  that changes to the init_disres() don't make this check invalid -
  if they would ever get out of sync, the simulations would exit with
  a fatal error.

Refs #3377 (fixes point 1)

Change-Id: I635e033db51d6ecc8bf121c72730a121e04586dd

4 years agoFix checkNumberOfBondedInteractions bug
Pascal Merz [Tue, 11 Feb 2020 01:08:17 +0000 (18:08 -0700)]
Fix checkNumberOfBondedInteractions bug

When checkNumberOfBondedInteractions finds a missing interaction, the
program is not exiting because a function enclosed in a logging statement
starts a global reduction, but is only ever reached by master.

Fixes #3373

Change-Id: I9a0faa790595a7ea59db561a20246a76857435a1

4 years agoExpose vsite counting
Pascal Merz [Wed, 12 Feb 2020 22:33:39 +0000 (15:33 -0700)]
Expose vsite counting

This allows to check whether vsites are present before the
respective object is created.

Refs #3377 (prepares point 1)

Change-Id: I8273daf38d46e2f052573f48323b5b6137965e9f

4 years agoIntroduce readXvgData to read xvg data into std::vector
Christian Blau [Fri, 7 Feb 2020 13:47:50 +0000 (14:47 +0100)]
Introduce readXvgData to read xvg data into std::vector

This allows for modernization of table functions, demonstrated
here with read_tables, as well as potentially any other function
that needs to read in xvg data. The legacy read_xvg is now
implemented in terms of readXvgData. There is already a test for
table functions and this change now adds tests for reading in
xvg data.

Change-Id: Iac0b13d7db15f04a8b0b464df9fa136ff4b2a213

4 years agoClean up trivial function and duplicating macroses from NBNXM
Artem Zhmurov [Tue, 4 Feb 2020 10:04:34 +0000 (11:04 +0100)]
Clean up trivial function and duplicating macroses from NBNXM

The getOclPruneKernelJ4Concurrency(..) that used to implement
the concurrency parameter switching depending on vendor is now
a trivial return the same value as defined by macros. Hence,
this patch removes the function and code now uses the macro directly.

Change-Id: I61d4b0a91e9b3256633860165ab0b7f4a34f9687

4 years agoFix incorrect GPU update task assignment fallback
Szilárd Páll [Mon, 10 Feb 2020 18:30:22 +0000 (19:30 +0100)]
Fix incorrect GPU update task assignment fallback

This change fixes the incorrect fallback condition in the GPU update
task assignment. This also eliminates the assertion trigerred in do_md()
where the correct form of the check is asserted on.
Since the fallback path only triggers when the GPU update would be used by
default this only affected runs with GMX_FORCE_UPDATE_DEFAULT_GPU.

Change-Id: I8b2b506fa998b6ed5e6d6d8ae4b78e27006df199

4 years agoFix the nightly failure
Artem Zhmurov [Tue, 11 Feb 2020 09:43:14 +0000 (10:43 +0100)]
Fix the nightly failure

Change-Id: I06a75ba83590d2c6cdf94354e1b8c814db493ef0

4 years agoAvoid dev flags in triggering gpuupdate nightly matrix
Szilárd Páll [Fri, 24 Jan 2020 13:14:53 +0000 (14:14 +0100)]
Avoid dev flags in triggering gpuupdate nightly matrix

The GPU update release feature should be tested independenly from the
experimental features which were all enabled for the "gpuupdate" nightly
job. This change removes the GMX_GPU_DD_COMMS and GMX_GPU_PME_PP_COMMS
as well as the unnecessary buffer ops env var.

Refs #3354

Change-Id: I777f6996ca5b1ae1b3e7f787c18d82f605035e47

4 years agoAvoid (re)initializing GPU update without DD
Szilárd Páll [Tue, 28 Jan 2020 18:24:13 +0000 (19:24 +0100)]
Avoid (re)initializing GPU update without DD

Unless repartitioning happens the GPU update-constraints module's
expensive initialization only neeeds to be called once.

Fixes #3358

Change-Id: Ic2a147985da5907961a3e3277110bbae52e6cadc

4 years agoTemporary disable RVec->float3 conversion test to fix the post-submit
Artem Zhmurov [Thu, 6 Feb 2020 12:53:52 +0000 (13:53 +0100)]
Temporary disable RVec->float3 conversion test to fix the post-submit

This fixes the post-submit matrix by disabling the faulty test. Will
be retracted once the proper soultion is found.

Refs. #3372.

Change-Id: I28031bc4793ce283c42539f4029cfe6bc2651156

4 years agoUse RVec instead of float for x, v and f device buffers
Artem Zhmurov [Mon, 20 Jan 2020 17:32:46 +0000 (18:32 +0100)]
Use RVec instead of float for x, v and f device buffers

Using RVec instead of float for coordinates data-types allows to
remove multiplications by DIM when the adresses, offsets and sizes
are computed. Since the native device types are not used in CPU
part of the code, the type casting remains.

Refs #3312 and #2936

Change-Id: Iaea914a474195f214ca860f7345f6878b9a04813

4 years agoRemove mu_tot from compute_globals()
Szilárd Páll [Fri, 31 Jan 2020 15:40:36 +0000 (16:40 +0100)]
Remove mu_tot from compute_globals()

The total dipole reduction happens in do_force() and the alternative
code-path reduction in compute_globals() was only needed for log
reporting which was removed some time ago.

Change-Id: I49a2608e8c1a47959a5f0f571e38e511367c94b2

4 years agoMove DeviceInfo into GPU traits
Artem Zhmurov [Wed, 29 Jan 2020 14:45:59 +0000 (15:45 +0100)]
Move DeviceInfo into GPU traits

The DeviceInfo is needed upon construction of DeviceContext. To
prepare for opaque DeviceContext type, it is moved to GPU traits
and renamed according to the common naming scheme.

Refs. #3311, needed for #3315.

Change-Id: I2a9f1d932f142d645df75901521a734d208de509

4 years agoMake OpenCL DeviceVendor into enum class and move to GPU traits
Artem Zhmurov [Wed, 29 Jan 2020 13:31:43 +0000 (14:31 +0100)]
Make OpenCL DeviceVendor into enum class and move to GPU traits

The device context in OpenCL requires the information on vendor when
constructed. To prepare for opaque DeviceContext, the vendor
enum was moved into OpenCL traits.

Refs. #3311, needed for #3315.

Change-Id: Iec22ff17543b6a99407048de6e0cd82bb7218fb0

4 years agoMove non-bonded initialization out of the forcerec
Artem Zhmurov [Tue, 4 Feb 2020 10:51:45 +0000 (11:51 +0100)]
Move non-bonded initialization out of the forcerec

Forcerec should not be responsible for initializing modules.

Change-Id: I666075fe03441c815b191f1eb3809e294c62d541

4 years agoTest PaddedVector to ArrayRef conversion
Pascal Merz [Tue, 4 Feb 2020 14:49:54 +0000 (09:49 -0500)]
Test PaddedVector to ArrayRef conversion

This adds a few tests to the PaddedVector tests, making sure that
the various ways to create unpadded ArrayRefs are yielding equivalent
views.

This also fix a small bug in the copy assignment test.

Change-Id: If4317e81a1723739ac3b16fc255987d9f7193489