alexxy/gromacs.git
4 years agoAdd haveFreeEnergyWork to DomainLifetimeWorkload flags
Berk Hess [Thu, 19 Sep 2019 08:11:58 +0000 (10:11 +0200)]
Add haveFreeEnergyWork to DomainLifetimeWorkload flags

Change-Id: Ic0a09e2acafedc8c2caefb6935da88177d4c87ee

4 years agoSplit up do_tpx_body functions
Paul Bauer [Wed, 18 Sep 2019 13:34:34 +0000 (15:34 +0200)]
Split up do_tpx_body functions

Will facilitate only communicating the parts of the TPR file needed on
ranks other than master.

Refs #2971

Change-Id: Ia5a5fe4f1c9bda1340e0776a0a2d9e96a90d4d07

4 years agoRemove note about cutoff-scheme from mdrun docs
Kevin Boyd [Thu, 19 Sep 2019 02:52:41 +0000 (19:52 -0700)]
Remove note about cutoff-scheme from mdrun docs

Change-Id: Ie7c6cd8fb5855cf7af1dd3fdd99586e133625cd2

4 years agoConsistently change densityfitting spreading weight to charge
Christian Blau [Wed, 18 Sep 2019 10:11:43 +0000 (12:11 +0200)]
Consistently change densityfitting spreading weight to charge

In the mdp options, the density-guided-simulation-atom-spreading weight
has been changed from charges to "charge" but within the code and in an
.mdp file comment the plural charges was still used. Changed now all
over to make this consistent.

refs #2282

Change-Id: I055743c8301e4ad18ceed5670c62be0a93c2d5f1

4 years agoAdded free-energy kernel performance note
Berk Hess [Wed, 18 Sep 2019 12:52:49 +0000 (14:52 +0200)]
Added free-energy kernel performance note

Change-Id: Iea5d2b124633c4188753c7b1ebb6f964edb2f644

4 years agoFix incorrect DD ndim assertion
Berk Hess [Wed, 18 Sep 2019 12:35:17 +0000 (14:35 +0200)]
Fix incorrect DD ndim assertion

An incorrect assertion was introduced in recent commit ed91e159.

Merged that assertion with a similar one nearby

Change-Id: Idff2a0d8a1985a19019233d29c4804294824297c

4 years agov-rescale thermostat for modular simulator
Pascal Merz [Fri, 16 Aug 2019 20:39:09 +0000 (14:39 -0600)]
v-rescale thermostat for modular simulator

This commit introduces the v-rescale thermostat for the modular
simulator. It also implements general velocity scaling in the
propagators.

Note that since the modular simulator is the default code path for
all supported input using md-vv as an integrator, this automatically
moves over some of the test coverage from the legacy simulator to
the modular simulator. This does, however, also extend equivalence
testing between the modular and the legacy code paths to v-rescale
thermostatted simulations.

Change-Id: Ia22931ccc3f9340f7f6272e395df149bd73d9b21

4 years agoRead TPR file body in buffer
Paul Bauer [Thu, 13 Jun 2019 09:52:36 +0000 (11:52 +0200)]
Read TPR file body in buffer

For now only reads the buffer and uses it to write new files.

Refs #2971

Change-Id: I77a18ca50e96486d688db8b0d7acdbedf29d613d

4 years agoSet up workload data structures
Szilárd Páll [Fri, 13 Sep 2019 00:02:45 +0000 (02:02 +0200)]
Set up workload data structures

This change estabilishes three data structures for describing the
computational workload within a run. Flags related to the workload are
categorized in three groups based on their lifetime:
- per-step flags in the StepWorkload class
- domain liftime / nslist steps in DomainLifetimeWorkload
- constant over the entire simulation in SimulationWorkload

The present change only introduces naming by: renaming of the
former ForceFlags to StepWorkload and PpForceWorkload to
DomainLifetimeWorkload.

Moving flags from e.g. the force schedule into these will follow.

Change-Id: I2bcc911091e2dd8ca0bcbf53a40dfcda09ba368b

4 years agoGPU Force Halo Exchange
Alan Gray [Tue, 3 Sep 2019 08:00:13 +0000 (01:00 -0700)]
GPU Force Halo Exchange

Activate with GMX_GPU_DD_COMMS environment variable.

Extends GPU Halo exchange feature to provide GPU Force halo exchange
functionality. Does not yet support virial steps, which require an
extra shift force reduction - these are currently performed on the
non-buffer ops / non direct-comm path. Also has same limitations as
coordinate halo exchange.

Performs part of #2890. Future work to improve synchronization towards
a more one-sided scheme (#3092) and to make depenencies more
explicit (#3093)

Change-Id: Ifc23cc8db2655f7258e68b34e7cdc7b71994e1e8

4 years agoFix MSVC warning
Paul Bauer [Tue, 17 Sep 2019 12:21:56 +0000 (14:21 +0200)]
Fix MSVC warning

Should fix:
cl : Command line warning D9014

Change-Id: I24501ee27308df8abdbe3526d4035e74eb248286

4 years agoAdd mdp option documentation for density fitting.
Christian Blau [Fri, 13 Sep 2019 11:29:00 +0000 (13:29 +0200)]
Add mdp option documentation for density fitting.

Documents the .mdp options for the density fitting module.

refs #2282

Change-Id: Ic2cb616ca13627553a36d739d86192b0fcb0e239

4 years agoMinor tweaks to sum_dhdl and setCurrentLambdasLocal
Pascal Merz [Tue, 17 Sep 2019 02:32:57 +0000 (20:32 -0600)]
Minor tweaks to sum_dhdl and setCurrentLambdasLocal

setCurrentLambdasLocal() is taking the entire t_state as input,
but only uses the lambda vector and the free energy state. The
function arguments were changed to reflect that. This facilitates
rewriting the state data structure.

This change also adds a trivial const qualifier to sum_dhdl.

Change-Id: I50cb2b77711c13c1d77f6d55cfd32a324f94f76e

4 years agoFix position pinning for modular simulator
Pascal Merz [Tue, 17 Sep 2019 15:53:53 +0000 (09:53 -0600)]
Fix position pinning for modular simulator

This replicates Ia2b97d22 for the modular simulator, pinning the
position also in the non-DD case.

Fixes #3091

Change-Id: Ifb4b5a8897099152b7086fe700faa9a048c110a3

4 years agoRemove spurious newline from log file
Berk Hess [Tue, 17 Sep 2019 14:14:35 +0000 (16:14 +0200)]
Remove spurious newline from log file

The annealing print function always added a newline.
Made calls to annealing and energy/log print conditional,
as they create needless overhead.

Change-Id: I63c0c6c9f1803aa8d42f59b40d7e2bff6fb6ac10

4 years agoAdd deprecation note for 32 bit
Paul Bauer [Tue, 17 Sep 2019 09:52:14 +0000 (11:52 +0200)]
Add deprecation note for 32 bit

Refs #3080

Change-Id: I033350ce0de76f30d11c44b5a73bf9b41ae91e97

4 years agoFix todos for update groups
Berk Hess [Tue, 17 Sep 2019 12:57:40 +0000 (14:57 +0200)]
Fix todos for update groups

Update groups allow for less PBC operations with domain decomposition
and allow Ewald dipole correction to work propely for small molecules.
Added checks and an assertion for Ewald dipole correction in grompp
and mdrun.

Change-Id: If072c6b0fe5afd591c3e01b1238d28820128c7af

4 years agoFix modular simulator MPI bugs
Pascal Merz [Tue, 17 Sep 2019 10:00:53 +0000 (04:00 -0600)]
Fix modular simulator MPI bugs

This fixes two small errors which are not directly related to MPI, but
only show up in MPI runs:

* The checkpoint helper now receives the global number of atoms from the
  global topology rather than the global state. This is identical to the
  legacy implementation, and has the advantage that the global topology
  is defined on every rank
* The state flags of the legacy state were not written correctly, or,
  in some cases, not at all. This lead to errors using DD where the local
  state was not properly allocated.

Change-Id: I6b6a48550065f16f415f46f20f16ee9c49da3dbe

4 years agoMake modular simulator the default code path for md-vv NVE
Pascal Merz [Wed, 11 Sep 2019 18:44:14 +0000 (12:44 -0600)]
Make modular simulator the default code path for md-vv NVE

This change makes the modular simulator the default code path for
md-vv, if the options chosen are implemented. Effectively, this
means that currently, modular simulator will be chosen for md-vv
with NVE. The testing suite will hence use the new code path by
default for any applicable system.

Change-Id: I2635d58f8fc777a8efa04e216a5c612b7ef3a96b

4 years agoFix force element
Pascal Merz [Tue, 17 Sep 2019 03:05:30 +0000 (21:05 -0600)]
Fix force element

As FEP is currently turned off for the modular simulator, the force
element was using an empty ArrayRef as an argument for the lambda
vector in the call to the legacy do_force(). Further tests revealed,
however, that some force calculations use the lambda vector without
checking if FEP is needed. To avoid problems related to this, an
allocated array is used. Note that this change gets superseeded
by Iee12697a, so this is just a temporary fix.

Change-Id: Ibd09e83a8ee61f6da8c7f6ab8989777218407d94

4 years agoEnable checkpointing for modular simulator
Pascal Merz [Thu, 12 Sep 2019 09:57:12 +0000 (03:57 -0600)]
Enable checkpointing for modular simulator

This introduces the checkpoint helper and checkpoint helper clients.

The `CheckpointHelper` is responsible to write checkpoints. In the
longer term, it will also be responsible to read checkpoints, but this
is not yet implemented.

Writing checkpoints is done just before neighbor-searching (NS) steps,
or before the last step. Checkpointing occurs periodically (by default,
every 15 minutes), and needs two NS steps to take effect - on the first
NS step, the checkpoint helper on master rank signals to all other ranks
that checkpointing is about to occur. At the next NS step, the checkpoint
is written. On the last step, checkpointing happens immediately before the
step (no signalling).  To be able to react to last step being signalled,
the CheckpointHelper does also implement the `ISimulatorElement` interface,
but does only register a function if the last step has been called.

Checkpointing happens at the top of a simulation step, which gives a
straightforward re-entry point at the top of the simulator loop. Moving
the checkpointing position requires to sum the kinetic energy (in
compute globals) a step earlier for md-vv.

In the current implementation, the clients of CheckpointHelper fill a
legacy t_state object (passed via pointer) with whatever data they need
to store. The CheckpointHelper then writes the t_state object to file.
This is an intermediate state of the code, as the long-term plan is for
modules to read and write from a checkpoint file directly, without the
need for a central object. The current implementation allows, however,
to define clearly which modules take part in checkpointing, while using
the current infrastructure for reading and writing to checkpoint.

This change also adds a lambda vector to the force element, since in
some cases, the force routine access the lambda vector even if FEP is
off, which leads to segmentation faults. It also moves the ownership
of needToSumEkinhOld_ from the compute globals element to the energy
element. It reintroduces the observablesHistory, which is owned by
the energy element. It also allows the CheckpointHelper to access
the outf private variable of TrajectoryElement.

Finally, this change also fixes a bug in the NeighborSearchSignaller
which would fail to signal the first step of the simulation run as a
NS step if it didn't fulfill do_per_step(step, nstlist). This was
not a problem as long as we only allowed new simulations but may
cause errors on restarts from checkpoints.

Change-Id: I15066fa66d653567f680a1c616a13ccfb7e3e955

4 years agoRemove obsolete mdp option ns-type
Berk Hess [Thu, 12 Sep 2019 07:56:27 +0000 (09:56 +0200)]
Remove obsolete mdp option ns-type

Also removed unused member ndelta from t_inputrec.

Change-Id: Idde132176582001bdffafa6fa64af2eed9d0c242

4 years agoAdd some cool quotes
ejjordan [Fri, 13 Sep 2019 08:55:11 +0000 (10:55 +0200)]
Add some cool quotes

Change-Id: Ib6a1565fb8cacf65523ec05e9fda52645d85a3de

4 years agoFormatting fixes for reference manual
Paul Bauer [Mon, 16 Sep 2019 11:14:45 +0000 (13:14 +0200)]
Formatting fixes for reference manual

Fixes #3090

Change-Id: I477e7422e29bc3dbccc91ba5a02f5bc90354d9fa

4 years agoAdd gmxapi release notes.
M. Eric Irrgang [Wed, 11 Sep 2019 08:50:06 +0000 (11:50 +0300)]
Add gmxapi release notes.

Change-Id: I12ee7c5707dcb17282aa29c30ec42271242b2a37

4 years agoRefactor GPU buf ops-related launches in do_force()
Szilárd Páll [Wed, 11 Sep 2019 17:07:00 +0000 (19:07 +0200)]
Refactor GPU buf ops-related launches in do_force()

- Consolidate branchy-ness into better organized code;
- Rename and clarify conditionals related to CPU force contributions:
  for non-local forces only the presence of bonded interactions should
  be a dependency, while for locals, the presence of any local force
  contribtion from the CPU.

Change-Id: I91921d5d7425206b5980ec2b96032790a5d54408

4 years agoGPU halo exchange
Alan Gray [Tue, 26 Feb 2019 12:43:22 +0000 (04:43 -0800)]
GPU halo exchange

Activate with GMX_GPU_DD_COMMS and GMX_USE_GPU_BUFFER_OPS environment
variable.

Class to initialize and apply coordinate buffer halo exchange
functionality directly on GPU memory space.

Currently only supports direct cuda memcpy, and relies on thread MPI
being in use.

Updated gpucomm testing matrices to cover non-GPU case.

Limitation: still only supports thread MPI, 1D data decomposition and
only coordinate halo exchange

Implements part of #2890
Associated with #2915

Change-Id: I8e6473481ad4d943df78d7019681bfa821bd5798

4 years agoAdd virtual site type 2FD
Berk Hess [Sun, 15 Sep 2019 21:01:43 +0000 (23:01 +0200)]
Add virtual site type 2FD

Fixes #2451

Change-Id: Ide9dcd829284567010435ed5cfb55194aed12dcf

4 years agoAvoid short-range GPU operations with no work
Mark Abraham [Fri, 13 Sep 2019 08:03:55 +0000 (10:03 +0200)]
Avoid short-range GPU operations with no work

Also moved some assertions until after the checks that there is work
because when there are no atoms in a locality the pointer (even from
the ArrayRef) can be nullptr.

Used more consistent naming for numAtoms and numCopyAtoms variables

Noted some TODOs for outstanding questions

Change-Id: I965832765a57486b632f5e3b17c2c91107a29070

4 years agoRemove cut-off schemes from manual
Berk Hess [Thu, 12 Sep 2019 08:15:55 +0000 (10:15 +0200)]
Remove cut-off schemes from manual

Removed the group cut-off scheme and references to cut-off schemes
from the reference manual and user guide.

Change-Id: I54e2a4977f2f9cfe40069f613211cb82175dce59

4 years agoEliminate unnecessary GPU stream dependency call
Szilárd Páll [Fri, 13 Sep 2019 12:00:05 +0000 (14:00 +0200)]
Eliminate unnecessary GPU stream dependency call

The dependency insetion is not needed because the nonbonded
task itself should be made depndent on the producer of the nbnxm
layout cordinates rather than the buffer ops task.

Also added clarifying comment on the nbnxnInsertNonlocalGpuDependency
call.

Change-Id: I976280d3b6cdd6b808cd4e54f750b2031f962f6c

4 years agoAdd option request 1D DD with 1 pulse
Berk Hess [Fri, 13 Sep 2019 13:45:17 +0000 (15:45 +0200)]
Add option request 1D DD with 1 pulse

The option is currently controlled by an (undocumented) environment
variable GMX_DD_1D_1PULSE, but is intended to be used when requesting
GPU DD halo communication.
Note that requesting 1D DD and 1 pulse increases the lower limit
on the system size. We should consider automatically relaxing the DLB
scale limit to allow GPU DD halo communication.

Refs #3089

Change-Id: I6152c859072765c803fb99ca45ace15ae10dcfba

4 years agoRemove group scheme from deprecated release notes
Kevin Boyd [Sat, 14 Sep 2019 18:05:33 +0000 (11:05 -0700)]
Remove group scheme from deprecated release notes

Change-Id: I642046066b7292836008cd89903ea93e33e4e12f

4 years agoIntroduce the modular simulator
Pascal Merz [Thu, 12 Sep 2019 00:50:28 +0000 (18:50 -0600)]
Introduce the modular simulator

The modular simulator  builds independent elements and signallers based on
the input and stores them in a respective vector. It then calls the setup function
of all elements. It then repeats the following loop until a stop condition is met:
* Perform domdec and load balancing if necessary
* Until the next neighbor-searching step:
  - Call signallers in order
  - Call elements in order, allow them to register run function in queue
  - increase step number
* Once the next neighbor-searching step is reached, run through the entire queue
  of function pointers
* Repeat

Supressed some warnings about redundant std::move necessary for legacy
compilers.

Increased default trajectory tolerance for force comparisons, which
were chosen arbitrarily originally.

Change-Id: Iaae1e20581df464090979da9b05d04829f267300

4 years agoImport gmxapi docs to main GROMACS docs directory.
M. Eric Irrgang [Wed, 11 Sep 2019 07:45:22 +0000 (10:45 +0300)]
Import gmxapi docs to main GROMACS docs directory.

This change defers removal of the documentation staged in
python_packaging so to allow rearrangement of the docs in the new
location without risking loss of content or the ability to generate
the previous documentation.

Refs #2698

Change-Id: Ie64585fe519aa37ada9d353f1eccd2daafcdbceb

4 years agoPatch gmxapi for Python 3.7
Peter Kasson [Sat, 14 Sep 2019 08:43:20 +0000 (08:43 +0000)]
Patch gmxapi for Python 3.7

This is a minimal patch to fix gmxapi typing on Python 3.7.

Change-Id: I2beab4d5c642bb1ae235a7248f1334097fe252c2

4 years agoAdd rounding correction to unsafe simd exp tests too
Erik Lindahl [Fri, 13 Sep 2019 20:43:05 +0000 (22:43 +0200)]
Add rounding correction to unsafe simd exp tests too

This was already present for the safe-version tests,
but when modifying the test limits of the unsafe version
we need it there too to fix the ARMv7 tests.

Change-Id: I4dbab9655a9405bb17a8007a065aea3f4b991ed5

4 years agoFix clang tidy warnings in SIMD code
Erik Lindahl [Fri, 13 Sep 2019 18:25:16 +0000 (20:25 +0200)]
Fix clang tidy warnings in SIMD code

Replace integer division and asserting it is
evenly divisible with using the divided constant
and multiplication to avoid warnings about
fragile integer division.
Second, we no longer need to use relaxed-range
checking for exp() with our new polynomial fix
that does not depend on FMA hardware.

Change-Id: Ifbc996ca1f0383897b38769474fc733ad5aaa592

4 years agoFix nonbonded-bench compilation issue
Berk Hess [Fri, 13 Sep 2019 11:55:12 +0000 (13:55 +0200)]
Fix nonbonded-bench compilation issue

Gerrit fast-forward merge caused compilation issues.

Change-Id: I2a7813304fae5444b9f70bfa7e71737043076d97

4 years agoFix nightly failures
Paul Bauer [Fri, 13 Sep 2019 08:51:48 +0000 (10:51 +0200)]
Fix nightly failures

Also fixed extra warnings from clang-tidy in simd_math tests.

Change-Id: I7a47a9b8d5e8b276bab82467274d2d23367d805f

4 years agoAdd list of unsupported functions in 2020
Paul Bauer [Thu, 12 Sep 2019 08:38:06 +0000 (10:38 +0200)]
Add list of unsupported functions in 2020

All of those are caused by the removal of the group-scheme.

Change-Id: Ib38757568889a7f84569547eb2f5a5fc644c98a3

4 years agoAdd nbnxm kernel benchmark tool
Berk Hess [Mon, 17 Jun 2019 07:49:56 +0000 (09:49 +0200)]
Add nbnxm kernel benchmark tool

This change adds a tool for benchmarking nearly all different
flavors of the Nbnxm non-bonded kernels. The tools uses prepared
coordinate input, to minimize the dependencies on the GROMACS
code base. Currently some there are some minor mdlib and ewald
dependencies beyond the Nbnxm dependency.

Also adds basic end-to-end test.

TODO: Make this tool a separate target with minimal dependencies
      on the rest of GROMACS.

Change-Id: Id9b31ccf9f372af873e08c5dd2b97fb8e5df6eef

4 years agocmake: add option to install legacy headers
Christoph Junghans [Thu, 12 Sep 2019 17:50:51 +0000 (17:50 +0000)]
cmake: add option to install legacy headers

This is needed for package like VOTCA to use the C-API until
a real GMX API got established.

Refs #988

Change-Id: I87b6f81641cb5bcac5ceb6ff6fb3dbd9e6650ea5

4 years agoNormalize usage of GMXTOOLCHAINDIR in gmxapi setup.py
M. Eric Irrgang [Thu, 12 Sep 2019 15:59:58 +0000 (18:59 +0300)]
Normalize usage of GMXTOOLCHAINDIR in gmxapi setup.py

GMXRC references the tool chain just by its directory using the
environment variable GMXTOOLCHAINDIR. Assuming that the toolchain
directory name has the same suffix as the toolchain file, it is
sufficient and more consistent for the gmxapi setup.py to use
GMXTOOLCHAINDIR as its hint. Also, doing so allows additional
convenience to users who have already sourced their GMXRC.

Change-Id: I433cdb1215e5fcb1ae893e2f29cb23c4c59f7727

4 years agoDo not use gromacs-toolchain in darwin gmxapi builds.
M. Eric Irrgang [Thu, 12 Sep 2019 09:56:35 +0000 (12:56 +0300)]
Do not use gromacs-toolchain in darwin gmxapi builds.

Add workaround for toolchain issue on OS X.

Refs #3085

Change-Id: I96a8242b14c86abd4926b6abf5a401c37953b9bc

4 years agoUpdate gmxapi setup.py
M. Eric Irrgang [Thu, 12 Sep 2019 07:28:38 +0000 (10:28 +0300)]
Update gmxapi setup.py

* Rearrange for tidyness and readability.
* Add usage hints.

Change-Id: Ic5d47a9aebfe8c7c83de2b4b24bb163bdce8cc1b

4 years agoFix GPU X buffer ops with empty domain
Szilárd Páll [Fri, 13 Sep 2019 01:28:44 +0000 (03:28 +0200)]
Fix GPU X buffer ops with empty domain

The early return that ensured no kernel gets launched with empty domain
got dropped with recent refactoring. This change adds back the
conditional and fixes assertion errors triggered with empty domains.

Change-Id: I508fdc2179877080dec512695e96310b52698b81

4 years agoUpdated mdp documentation for group scheme removal
Berk Hess [Thu, 12 Sep 2019 10:06:25 +0000 (12:06 +0200)]
Updated mdp documentation for group scheme removal

Change-Id: Id30204f9795bb4424af1738ec70d205c84ce18b7

4 years agoManual entry for density guided simulations
Christian Blau [Thu, 12 Sep 2019 14:14:11 +0000 (16:14 +0200)]
Manual entry for density guided simulations

Extends the reference manual with a section for density guided
simulations.

refs #2282

Change-Id: Ie3017fa5e75fcd2c809c20782300f759182486a8

4 years agoDisable report-methods end-to-end test
Mark Abraham [Thu, 12 Sep 2019 12:12:51 +0000 (14:12 +0200)]
Disable report-methods end-to-end test

Refs #3804

Change-Id: Id20edbb3495360136f1988e2338c172596a4e58d

4 years agoReorganize on-GPU PME force reduction flag handling
Szilárd Páll [Tue, 10 Sep 2019 15:24:18 +0000 (17:24 +0200)]
Reorganize on-GPU PME force reduction flag handling

Instead of passing around a flag everywhere that tells PME whether
forces are reduced on GPU or CPU (and whether transfer needs to happen
for the latter), we pass the flag once when configuring PME for
the next step and store it internally.

Refs #3029

Change-Id: I81fa2dc93dd979e2b85b4d7fe8cf266a3fde9b8f

4 years agoChange PaddedVector to PaddedHostVector for force CPU buffer
Artem Zhmurov [Mon, 9 Sep 2019 16:44:38 +0000 (18:44 +0200)]
Change PaddedVector to PaddedHostVector for force CPU buffer

The difference between PaddedVector and PaddedHostVector is that
in the builds where CUDA is available, cudaMalloc is used instead
of malloc. This enables one to pin the vector for asynchronous
H2D and D2H copies. Other than that and on the CPU-only builds this
change essentially only renames the data type.

Change-Id: I446ef037a8013f666a78762d37ed44e59f9548c2

4 years agoAdd release note for density fitting.
Christian Blau [Thu, 12 Sep 2019 13:15:12 +0000 (15:15 +0200)]
Add release note for density fitting.

Adds a release note that density-guided simulations are now available.

refs #2282

Change-Id: I2ae6896ba32cadfb2029a5c923db6fd76ddbf620

4 years agoAdjust test range and fix singleaccuracy tests
Erik Lindahl [Thu, 12 Sep 2019 11:20:52 +0000 (13:20 +0200)]
Adjust test range and fix singleaccuracy tests

This changes the limit of exp() tests by one ulp
to account for rounding that leads to tests failing
for a single value when the CPU uses different
denormals-to-zero modes for SIMD and non-SIMD (ARMv7).

It also fixes the singleaccuracy tests to
check the correct functions for log2/exp2/pow2/cbrt
instead of the double-precision flavors, and the
implementation of powSingleAccuracy has been
copied from the (faster) single precision type
instead of just calling the double precision version.

Change-Id: I67d027cb916c4f78f36719f9ff554e9957879763

4 years agoUpdate modular simulator tests
Pascal Merz [Thu, 12 Sep 2019 00:40:59 +0000 (18:40 -0600)]
Update modular simulator tests

This addresses a number of issues with the modular simulator tests:

1.  Relaxes the tolerance for energy tests slightly
2.  Switches the pressure test from ULP-based tolerance to relative
    tolerance
2a. Introduce relativeToleranceAsPrecisionDependentFloatingPoint()
    to define relative tolerances depending on floating point
    precision
3.  Relax the tolerance for velocity testing, allowing to remove the
    second version of the velocity propagator (differing from the
    first version only by the operation order)
3a. Introduce TrajectoryComparison argument to the simulator
    comparison test class, adapt rerun and simulator tests accordingly

Change-Id: I30fffcabf8d6e658dab6f71b407fbe162121df2e

4 years agoFix master not compiling
Berk Hess [Thu, 12 Sep 2019 10:03:49 +0000 (12:03 +0200)]
Fix master not compiling

A fast-forward merge broke compilation of tpi.cpp.

Change-Id: I067042a6e02b272e7503ae3f876418dc0a114b91

4 years agoEnable TPI with the Verlet cut-off scheme
Berk Hess [Tue, 10 Sep 2019 09:01:19 +0000 (11:01 +0200)]
Enable TPI with the Verlet cut-off scheme

This requires a special treatment for the nbnxm gridding and search,
with one grid for the system to insert in and one grid for
the molecule to insert.
Also reenabled the TPI tests.

Change-Id: Ia3888daf4b06a94b0a7a03ec17b7bbe27084ac3d

4 years agoAdded SIMD cbrt and invcbrt functions
Erik Lindahl [Wed, 11 Sep 2019 12:36:00 +0000 (14:36 +0200)]
Added SIMD cbrt and invcbrt functions

To be used in free energy kernels.

Change-Id: I074e27f7b050b37f273dbf703ff915c9c20e8c97

4 years agoAdded SIMD log2 and pow math functions
Erik Lindahl [Wed, 4 Sep 2019 23:29:44 +0000 (17:29 -0600)]
Added SIMD log2 and pow math functions

To be used in SIMD free energy kernels

Change-Id: I3c05dcc01ec56ed790cfedc543a75c17468ca284

4 years agoUpdate SIMD math tests and improve accuracy
Erik Lindahl [Sun, 1 Sep 2019 12:28:36 +0000 (14:28 +0200)]
Update SIMD math tests and improve accuracy

Improve the SIMD math function test by selecting
points to be equidistant in IEEE754 bit-space, and
specify test ranges by explcitly constructing the
threshold points used to select ranges.

This significantly extends the ranges over which
some functions are tested, and could lead to some
failed tests that were previously hidden, although they
are likely benign. With these tests, errors were found
in a few of the double-precision functions where 1/x
was evaluated for intermediate values smaller than the
lowest-magnitude single precision number, which have
now been fixed with additional masking.

Second, a fragile construct when evaluating exp() in
single precision without FMA support has been replaced
to improve precision when very small intermediate values
were flushed to zero by the intel compiler, in particular
icc19.

Change-Id: I3e4b1e5799f748b02f592398df762e1e318887e6

4 years agoMake gmx_multisim_t a C++ object
Mark Abraham [Wed, 11 Sep 2019 05:14:15 +0000 (07:14 +0200)]
Make gmx_multisim_t a C++ object

Change-Id: I1fe46090cdda44db5b5e7cc1198c6f679f7bd5a7

4 years agoRemove -sub option from trjconv
Paul Bauer [Wed, 11 Sep 2019 08:55:28 +0000 (10:55 +0200)]
Remove -sub option from trjconv

This functionality is now in gmx extract-cluster.

Change-Id: I5c74ce346f2e422f1b494663f0eb3206083c05be

4 years agoFix for the post-submit failure
Artem Zhmurov [Wed, 11 Sep 2019 18:55:25 +0000 (20:55 +0200)]
Fix for the post-submit failure

Commit 21abdb3 introduced several "unused variable" warning
in the post-submit matrix. This fixes the issue.

Change-Id: I8ba6ad16573dd7d8ca06fdd957882b4dc8486396

4 years agoDecouple GPU force buffer management from buffer ops in NBNXM
Artem Zhmurov [Wed, 11 Sep 2019 12:19:31 +0000 (14:19 +0200)]
Decouple GPU force buffer management from buffer ops in NBNXM

When GPU-side buffer operations are used, the total forces on the
device are accumulated in NBNXM module in the local GPU buffer.
By decoupling the CPU and GPU buffer operations and making the
force buffer into an argument for the reduction function, this
commit allows to take the responsibility of the GPU forces
management from the NBNXM module to the third-party instance.

This commit is refactoring of the code in preparation for the
introduction of the GPU-side PropagatorStateData object.

TODO: Use DeviceBuffer when passing the PME GPU forces buffer.

Refs. #2816

Change-Id: I2a1f9d12fad3fb5b2ce37ca3ed3d0cb91777c468

4 years agoAdd missing gmxapi requirements
Paul Bauer [Wed, 11 Sep 2019 09:35:56 +0000 (11:35 +0200)]
Add missing gmxapi requirements

Those where missing while trying to use the package. Please advise on
recommended minimum version numbers.

Change-Id: I65f4bf7b6892a74667b1fa2c641b7b97be923656

4 years agoUse GROMACS CMake toolchain file for gmxapi Python package build.
M. Eric Irrgang [Tue, 10 Sep 2019 18:15:51 +0000 (21:15 +0300)]
Use GROMACS CMake toolchain file for gmxapi Python package build.

Refs #2961

Change-Id: If085425879f00a8a8573627dbec197afa39c2ab0

4 years agoBasic toolchain to facilitate GMXAPI build
Paul Bauer [Thu, 5 Sep 2019 12:28:11 +0000 (14:28 +0200)]
Basic toolchain to facilitate GMXAPI build

Adds a basic toolchain file and install directives for it.
This is aimed at having one point for the API to look up how
a native GROMACS installation was build and allow the bindings for the
API to be build in the same way.

Added hint for directory to GMXRC so that it will be easier to find.

Refs #2961

Change-Id: Icefe89e97009110be55dc8e1f3db5726ec1fe53a

4 years agoDecouple coordinates buffer management from buffer ops in NBNXM
Artem Zhmurov [Tue, 10 Sep 2019 20:52:37 +0000 (22:52 +0200)]
Decouple coordinates buffer management from buffer ops in NBNXM

To make transition to the new device-side state propagator data
manager easier, the copy and plain buffers management have to be
decoupled from the actual operations on data in the buffers.
This commit splits the corresponding functions into two, and
decouples CPU- and GPU-based coordinate buffer ops one from
another. Since the coordinates are now clearly communicated
between PME and NBNXM, the plain pointer on the CPU-side code is
replaced with the DeviceBuffer<float>. The getters for the device-
side buffer now never return nullptr, but exit with the assertion
if the corresponding data is not intialized.

Change-Id: Ic793f815870a8b4f414a9b7ca0a5001e58f49c7a

4 years agoReorganize PME code:
Artem Zhmurov [Tue, 10 Sep 2019 11:42:06 +0000 (13:42 +0200)]
Reorganize PME code:

1. Split H2D copy and spread launch
2. Add getter for the padding, required in coordinates buffer
3. Add the getter for the GPU stream

TODO: Make use of DeviceBuffer

This is a part of preparation for the GPU version of the
StatePropagatorData, needed to connect all GPU routines.

Refs. #2816.

Change-Id: Icf0d621ce931f8fa66e948b5240afbddef7bfb0d

4 years agoAdd gmxapi.modify_input operation.
M. Eric Irrgang [Mon, 9 Sep 2019 16:29:06 +0000 (19:29 +0300)]
Add gmxapi.modify_input operation.

modify_input can consume and produce simulation input data in the
manner of gmxapi.simulation module operations.

Change-Id: I2639022801b5c72a8fad9fb68f1990c87444cbca

4 years agoProvide a gmxapi.read_tpr operation.
M. Eric Irrgang [Mon, 9 Sep 2019 15:17:34 +0000 (18:17 +0300)]
Provide a gmxapi.read_tpr operation.

Convert a simulation input file to a data flow stream that can be
consumed by other operations in gmxapi.simulation in a standard way.

Change-Id: Ic6339317956f248712a3038eab583fbca517ba16

4 years agoUpdate gmxapi.simulation.context details.
M. Eric Irrgang [Mon, 9 Sep 2019 14:44:33 +0000 (17:44 +0300)]
Update gmxapi.simulation.context details.

Combine and improve the implementation detail from gmxapi 0.0.7 handling
of trivial ensembles (single-trajectory).

This simplifies the 0.1 implementation of gmxapi.mdrun as a dispatcher
to the gmxapi 0.0.7 implementation.

Change-Id: I17fe722ee7509e8bc402c6d5848d01a2c04b18fd

4 years agoAllow gmxapi.mdrun to properly dispatch simulation ensembles.
M. Eric Irrgang [Mon, 9 Sep 2019 15:08:52 +0000 (18:08 +0300)]
Allow gmxapi.mdrun to properly dispatch simulation ensembles.

Update the gmxapi.simulation.mdrun implementation to be more normative.
Dispatch the simulation work to the gmxapi 0.0.7 implementation in
gmxapi.simulation.workflow and gmxapi.simulation.context.

Change-Id: Id223507fc064e178992bc87d6fcf89bdd4029523

4 years agoAdd comments to grompp generated .mdp output for densityfitting
Christian Blau [Mon, 9 Sep 2019 15:45:53 +0000 (17:45 +0200)]
Add comments to grompp generated .mdp output for densityfitting

Adds additional explanatory comments to the grompp generated mdout.mdp
file for densityfitting.

refs #2282

Change-Id: I496cccced2cc87cb2434f877c0caf04cb29c1903

4 years agoUpdate gmxapi Python package infrastructure for new operations.
M. Eric Irrgang [Mon, 9 Sep 2019 14:38:00 +0000 (17:38 +0300)]
Update gmxapi Python package infrastructure for new operations.

* Improve support for stand-alone operation implementations.
* Create a registry of operation implementations for use by the
  gmxapi.operation module Contexts.
* Flesh out the data model and add more modularity to the execution
  model.
* Clean up various output.

Change-Id: Id63c7883e3ed7e4d0172a7a18672b950afc4c25d

4 years agoNormalize some testing resources for the Python packages.
M. Eric Irrgang [Thu, 5 Sep 2019 12:05:16 +0000 (15:05 +0300)]
Normalize some testing resources for the Python packages.

* Add a gmxapi.testsupport submodule.
  Move the pytesthelpers.py test support module to the new
  gmxapi.testsupport module.
* Remove unused details in sample_restraint/tests. mpi4py was imported
  unnecessarily, and some directories created, but that was left over
  from older versions of the test.
* Remove pytest.ini for gmxapi Python package tests.
  These values can be set on the command line, and having them in the
  pytest.ini adds developer overhead when trying to determine default
  behavior or get custom behavior. In the future, consider per-test
  configuration through the caplog pytest fixture, or various command
  line options.

gmxapi and sample_restraint Python packages can now use essentially
identical pytest testing framework. This change synchronizes the
testing frameworks. Future changes can combine some of the facilities
for simplification and ease of maintenance.

Future changes could address the following.
* Move some pytest scripting to gmxapi package resources.
* Combine the Python and C++ resources for the test input file in
  sample_restraint.
* Retrieve test data directly from the GROMACS installation.
* gmxapi.testsupport could alternatively be a separate optional package.
* More facilities can be provided, such as the test input file.

Change-Id: Ia745c75aecd97e3a8fc3053b424aa40d4c89de32

4 years agoEnd to end test for density fitting
Christian Blau [Wed, 11 Sep 2019 06:49:48 +0000 (08:49 +0200)]
End to end test for density fitting

Implement an end to end test for the density fitting module.

refs #2282

Change-Id: Ic94013cae6820ccf6fa7415887b280daff25d83c

4 years agoDensityfitting write int64_t indices instead of gmx::index
Christian Blau [Wed, 11 Sep 2019 06:50:42 +0000 (08:50 +0200)]
Densityfitting write int64_t indices instead of gmx::index

When serializing atom indices to a key-value-tree that is subsequently
written to file, the type of the indices needs to be independent of
gmx::index (aka ptrdiff_t) type definition.

This patch introduces this behaviour.

refs #2282

Change-Id: I1384158204354e2267674c266f91c133a01bc5f7

4 years agoFix multi-sim restart handling in corner cases
Mark Abraham [Tue, 10 Sep 2019 12:02:06 +0000 (14:02 +0200)]
Fix multi-sim restart handling in corner cases

If different simulations would have different starting behaviour,
e.g. some checkpoint files are found and some are not, then we should
not allow a restart, and do so with a useful error message.

Refs #2375

Change-Id: I8845784e8310ab6ca81db189e4a42754add03def

4 years agoDisable false positive warning in ICC and MSVC
Paul Bauer [Tue, 10 Sep 2019 13:09:15 +0000 (15:09 +0200)]
Disable false positive warning in ICC and MSVC

Post submit was warning about constant selector expression in the
modularsimulator code when building with ICC. The warning
looked like a false positive so I added the flag to exclude it for ICC
both in native mode and with MSVC.

Change-Id: Ic0a9f2935b07d72d46940d0d5a165eb1b417a1ad

4 years agoTidy up the FE kernel
Magnus Lundborg [Thu, 5 Sep 2019 15:09:30 +0000 (17:09 +0200)]
Tidy up the FE kernel

Mainly moving variable declaration to where they are used and
making them const where appropriate.

Change-Id: I006092c39d40d0e4124cd443a16fa814e896ce93

4 years agoFix gpucomm matrix
Szilárd Páll [Wed, 11 Sep 2019 00:06:13 +0000 (02:06 +0200)]
Fix gpucomm matrix

While switching a config to thread-MPI, the "mpi" tag as not been
removed which took precedence rendering commti 3820ad ineffective.

Change-Id: I0a6f79d24dda157e15d2e26bba3e3fca4e16d60d

4 years agoAvoid warning in no-mpi build
Mark Abraham [Tue, 10 Sep 2019 13:16:47 +0000 (15:16 +0200)]
Avoid warning in no-mpi build

clang 8 with no MPI warns about this.

Change-Id: I65afd07d3d6dacbf67c309e5a62f0720efd66485

4 years agoMaking DeviceBuffer availible in non-GPU builds
Artem Zhmurov [Tue, 10 Sep 2019 11:12:09 +0000 (13:12 +0200)]
Making DeviceBuffer availible in non-GPU builds

Having DeviceBuffer availible in host-side code in all builds
allows to avoid passing the void-pointers for the device-side
buffers.

This is a part of preparation for the GPU version of the
StatePropagatorData, needed to connect all GPU routines.

Refs. #2816.

Change-Id: I174754de72999ff5299b3ddb8c8a0d05494f7f4c

4 years agoAdd indication on how to enable ImageMagick convert
Paul Bauer [Tue, 10 Sep 2019 14:33:43 +0000 (16:33 +0200)]
Add indication on how to enable ImageMagick convert

Change-Id: Ief6136f1218b11fdf28ce3c3028e8d6dbdf11913

4 years agoFix nightly build
Paul Bauer [Tue, 10 Sep 2019 08:28:30 +0000 (10:28 +0200)]
Fix nightly build

Fixes the clang-tidy error in the OpenCL build and disables the listed
forces tests when compiling with intel to avoid the test failures only
showing up there.

Refs #3083

Change-Id: Ie8d437b00cb9376d9eb7f8ac2d3402dee2152948

4 years agoAdd method to extract clusters from trajectory
Paul Bauer [Tue, 16 Apr 2019 10:01:25 +0000 (12:01 +0200)]
Add method to extract clusters from trajectory

Ported the -sub functionality of gmx trjconv to independent method based
on the new output manager functionality.

Added simple test to show that the routine can run.

Change-Id: I33bc056f8c44b795728ae15218a9211652b40772

4 years agoFix parameter key look-up in gmxapi TPR reader.
M. Eric Irrgang [Tue, 10 Sep 2019 12:07:59 +0000 (15:07 +0300)]
Fix parameter key look-up in gmxapi TPR reader.

A copy-paste error caused one member to be initialized twice and another
to be uninitialized.

Also, rename an inappropriate overload to indicate what it really does.

Change-Id: I35790e6de868303bd398aa21619841c8c5844e4e

4 years agoMake gmxcli pytest fixture more robust.
M. Eric Irrgang [Mon, 9 Sep 2019 13:23:04 +0000 (16:23 +0300)]
Make gmxcli pytest fixture more robust.

Look for multiple possible `gmx` command line executables.

This change may be followed up, amended, replaced, or superseded by
change Icefe89e97009110be55dc8e1f3db5726ec1fe53a but is necessary
now to support child changes under review.

Refs #2961

Change-Id: I7d9d830c1b16fbd2af86aded3f1fea5f3a63307f

4 years agoMore templating of gmx_nb_free_energy_kernel()
Magnus Lundborg [Tue, 27 Aug 2019 07:40:59 +0000 (09:40 +0200)]
More templating of gmx_nb_free_energy_kernel()

Kernel templated on interaction types.

Refs #2997.

Change-Id: Id02a6daab817705bdaca2ef610b793f1ddab6829

4 years agoEliminate raw force flags in do_force_lowlevel()
Szilárd Páll [Tue, 3 Sep 2019 10:20:28 +0000 (12:20 +0200)]
Eliminate raw force flags in do_force_lowlevel()

Change-Id: I4c54810a9130aaad0514738cc1026bc2d9f2fe5e

4 years agoUse more RAII semantics with t_commrec
Mark Abraham [Mon, 9 Sep 2019 15:06:41 +0000 (17:06 +0200)]
Use more RAII semantics with t_commrec

This permitted simplifying building the Mdrunner

Fixes #3081

Change-Id: I4ac5fb2017d960d3d0cfd0103e1d7232da9f1c3a

4 years agoUse the current mass instead of massA in density fitting code.
Christian Blau [Tue, 10 Sep 2019 09:35:10 +0000 (11:35 +0200)]
Use the current mass instead of massA in density fitting code.

When using masses to determine the weights of the spread amplitudes,
massA instead of the correct massT was used. This commit fixes this
behavior.

refs #2282

Change-Id: I58deb14b4b45c122ab3c9caf3f6b76c89f9ae739

4 years agoAccount for reference density origin shift in pbc correction
Christian Blau [Mon, 9 Sep 2019 13:41:48 +0000 (15:41 +0200)]
Account for reference density origin shift in pbc correction

When the refernce density is shifted from the origin, this shift has to
be added to the reference density center. This patch fixes incorrect pbc
correction behaviour, due to not taking this shift into account.

refs #2282

Change-Id: I953f717ecf6ab53985a59195eab896d50965039e

4 years agoUse thread-MPI in the gpucomm matrix
Szilárd Páll [Fri, 6 Sep 2019 21:54:52 +0000 (23:54 +0200)]
Use thread-MPI in the gpucomm matrix

Initial versions of the direct communication do not support MPI and do
not implement graceful fallback to staged communication. Until they do
so we need to avoid library MPI in these matrices.

Change-Id: Ie7ab579f6058831229596fd6ba09a185d3a0685f

4 years agoCompositeSimulatorElement for the modular simulator
Pascal Merz [Tue, 9 Jul 2019 04:35:48 +0000 (22:35 -0600)]
CompositeSimulatorElement for the modular simulator

This element allows to have a list of elements act as a single one.
This will simplify building algorithms.

This commit is part of the commit chain introducing the new modular
simulator. Please see docs/doxygen/lib/modularsimulator.md for details
on the chosen approach. As the elements of the new simulator cannot all
be introduced in one commit, it might be worth to view Iaae1e205 to see
a working prototype of the approach.

Change-Id: If2153923dd9421288ad57337c7255000bb7c1d91

4 years agoCoordinate Propagators
Pascal Merz [Tue, 9 Jul 2019 04:34:25 +0000 (22:34 -0600)]
Coordinate Propagators

This change introduces the propagator element, which, thanks to templating,
can cover the different propagation types used in NVE MD. The combination
of templating, static functions, and having only the inner-most operations in
the static functions allows to have performance comparable to fused update
elements while keeping easily reordable single instructions.

Note that the two velocity update functions are only necessary to allow
exact replication of the legacy do_md code for both md and md-vv. The
parentheses or the lack thereof lead to numerical errors which build up very
rapidly to make the (very strict) integrator comparison test fail. Relaxing this
condition will make getting rid of one of the two variants possible.

An interesting further development would be to unify the OpenMP loops for
coordinate propagation and constraining by using loops over constraint
groups in both cases.

Change-Id: I1a1f66f1efe63c791ef3fe51ce2f99da3367adca

4 years agoStatePropagatorData: Introduced const box accessor and fixed legacy flags
Pascal Merz [Sat, 7 Sep 2019 05:48:16 +0000 (23:48 -0600)]
StatePropagatorData: Introduced const box accessor and fixed legacy flags

Two improvements for the StatePropagatorData:

The current implementation only gave access to the non-const box
matrix. This introduces a const version of it, and changes the elements
using the simulation box to use the const version where appropriate.

The current implementation also kept using the legacy flags it got
from the global_state in all further usages. This is not correct -
when StatePropagatorData creates a deep copy as a t_state object, it
only populates certain fields. This commit fixes this.

Change-Id: I783491d9f8a0825b169880b7ab8ef7e677623d50

4 years agoAdd trivial const qualifiers to shellfc and EnergyOutput
Pascal Merz [Sat, 7 Sep 2019 05:40:31 +0000 (23:40 -0600)]
Add trivial const qualifiers to shellfc and EnergyOutput

Change-Id: I2ce3ef7c777aa6f7b93706553c44545fc5962b4f

4 years agoConstraint element for the modular simulator
Pascal Merz [Tue, 9 Jul 2019 04:33:10 +0000 (22:33 -0600)]
Constraint element for the modular simulator

This change introduces a constraint element, which is implemented for the
position-and-velocity and the velocity-only case. This change does not change
the constraint implementation itself, but replaces the `constrain_coordinates`
and `constrain_velocities` calls from update.h by elements implementing the
ISimulatorElement interface and using the new data management.

This commit is part of the commit chain introducing the new modular
simulator. Please see docs/doxygen/lib/modularsimulator.md for details
on the chosen approach. As the elements of the new simulator cannot all
be introduced in one commit, it might be worth to view Iaae1e205 to see
a working prototype of the approach.

Change-Id: Ie04b995fc34801967427825bb2842411a448a677