alexxy/gromacs.git
5 years agoMove functionality to mdrunutility
Mark Abraham [Thu, 9 May 2019 21:05:55 +0000 (23:05 +0200)]
Move functionality to mdrunutility

This lower-level module needs to acquire more content from mdrun as we
evolve a more levelised design. This change premptively resolves
several cycles that would be introduced by consolidating restarting
handling into mdrunutility/handlerestart.cpp.

Moved multi-sim related bools to its header, rather than commrec.h.
Several functions did not need to be inlined, as they were only
used during set up and tear down.

Made a few routines in even lower-level modules be passed the
boolean parameter computed from cr and ms, rather than being
passed it themselves.

Change-Id: I4a1721eaf7cbe08155110782a6680785091504db

5 years agoImprove X buffer ops kernel
Szilárd Páll [Mon, 11 Feb 2019 17:07:09 +0000 (18:07 +0100)]
Improve X buffer ops kernel

- Added restrict qualifiers
- Simplified code and converted to vector load/store operations.

Change-Id: I76e4b954b4ef045f299a8496b4975497720f4b89

5 years agoAdded more quotes
Erik Lindahl [Sat, 11 May 2019 11:33:16 +0000 (13:33 +0200)]
Added more quotes

Lazy Friday evening entertainment.

Change-Id: If26bd56b178510224b4c24b63124fcd413e6ee42

5 years agoFix typos regarding GMX_PHYSICAL_VALIDATION CMake variable.
M. Eric Irrgang [Thu, 16 May 2019 14:11:31 +0000 (17:11 +0300)]
Fix typos regarding GMX_PHYSICAL_VALIDATION CMake variable.

Variable was misspelled in CMake messages.

Change-Id: I5cddd249a8d4ee6c32fc89ba01143f068c319af3

5 years agoUse Python 3
Pascal Merz [Thu, 16 Aug 2018 00:29:38 +0000 (18:29 -0600)]
Use Python 3

This updates the Python scripts shipped with GROMACS to use Python 3.5+.
Most changes done are either due to `__cmp__` not being available in py3
(replaced by `functools.total_ordering`), py2-iterators being replaced by
py3-iterators, or print statements being replaced by functions.
Additionaly, some changes in the Cmake files were made to select the
different Python version.

All python scripts having an explicit `#!/usr/bin/env python2` as a first
line were checked and updated. Larger changes were only needed for the
documentation scripts, other scripts did not require any changes. Scripts
not explicitly using shebangs were also checked, but no changes were
needed. The following scripts were not touched:
- all scripts under tests/physicalvalidation/ (already py3 compatible)
- all scripts under python_packaging/
- scripts/make_gromos_rtp.py - this file is not valid py2.7

Refs #2615

Change-Id: I2edbe213bc6401563934ce56f5fd6a39886d3095

5 years agoMake all do_force_lowlevel() input const
Berk Hess [Tue, 14 May 2019 09:21:32 +0000 (11:21 +0200)]
Make all do_force_lowlevel() input const

Change-Id: I6db7dda98c169aed5f253ab48f1ac62bf64a2ea9

5 years agoUpdate infrastructure needed for restart rewrite
Mark Abraham [Thu, 9 May 2019 20:17:14 +0000 (22:17 +0200)]
Update infrastructure needed for restart rewrite

These changes are things that might be generally useful, and are
planned for use in refactoring of handleRestart.

Change-Id: Ic1ac5c2cb7e778808cdc40afbee59d26a6f52792

5 years agoClarify the EnergyOutput I
Artem Zhmurov [Tue, 2 Apr 2019 14:12:47 +0000 (16:12 +0200)]
Clarify the EnergyOutput I

The EnergyOutput::printStepToEnergyFile(...) method is responsible
for printing the current and average thermodynamic quantities as
well as anealing temperatures. The swich between what is printed
is done by passing enum argument to the function. Different
values of this argument lead to diferent, almost non-overlapping
code paths. Hence, it is natural to split the function. The
follow-up patch will make these into separate methods of the
EnergyOutput class, thus eliminating enum argument and making it
more clear what and how often is done.

Change-Id: Ifde9098cdddf85bc663f2943b2ee8778bc72a3ac

5 years agoFix math formatting in reference manual
Paul Bauer [Thu, 9 May 2019 12:50:23 +0000 (14:50 +0200)]
Fix math formatting in reference manual

Change-Id: I87e4d4103e45562ce5395add18dcca8625a64b62

5 years agoCUDA version of Leap-Frog integrator with basic tests
Artem Zhmurov [Thu, 7 Mar 2019 11:09:37 +0000 (12:09 +0100)]
CUDA version of Leap-Frog integrator with basic tests

Part of the GPU-only loop. Curent version is as a stand-alone module,
with its own coordinate, velocities and forces data management.
To activate, set environment variable GMX_INTEGRATE_GPU.

Limitations:

-- Only basic Leap-Frog is implemented.
-- No temperature control.
-- No pressure control.

Refs #2816, #2887

Change-Id: I439d7f5fd4f69a17ca7aaa412e242ce5e3aa5dbd

5 years agoPosition buffer ops in CUDA
Alan Gray [Thu, 24 Jan 2019 15:31:21 +0000 (07:31 -0800)]
Position buffer ops in CUDA

On all but search steps the buffer ops transform can now be done on a
CUDA GPU. If PME runs on the same GPU the already uploaded coordinates
will be used as input.

Activate with GMX_USE_GPU_BUFFER_OPS env variable.

Note:
-  waits for X copy on the PME stream to finish, need to implement sync
   point between PME and NB streams (in follow-up).

Implements part of #2817

Change-Id: Ib87dabd74a02727898681249691ac9786b8ac65c

5 years agoRemove more manual memory management
Paul Bauer [Tue, 12 Mar 2019 11:06:48 +0000 (12:06 +0100)]
Remove more manual memory management

Changed another virtual site preprocessing type to std::container and
added some documentation for types.

Refs #2833

Change-Id: I24e84bdb18e46f2cff710a1ca2cb0e1d4b80e633

5 years agoMore Python testing infrastructure for gmxapi.
M. Eric Irrgang [Tue, 2 Apr 2019 15:57:39 +0000 (18:57 +0300)]
More Python testing infrastructure for gmxapi.

* Add and improve test fixtures.
* Generate MD input files for tests.

Refs: #2756
Refs: #2896

Change-Id: I15ac8e44844cbf699cfe362e2fa443d07a355b3d

5 years agoAdd gmxapi._logging submodule.
M. Eric Irrgang [Wed, 8 May 2019 12:23:50 +0000 (15:23 +0300)]
Add gmxapi._logging submodule.

To rearrange import statements and module initialization code,
a private _logging module is introduced to initialize the
Python logging module and to provide gmxapi.logger.

Change-Id: Ifc13db35df300d10500d4ced80fc84684bea2c0c

5 years agoUpdate I/O handling in gmxapi.commandline.
M. Eric Irrgang [Tue, 2 Apr 2019 11:23:45 +0000 (14:23 +0300)]
Update I/O handling in gmxapi.commandline.

Change-Id: Ic0506ac3df91b7a5e234242fb6dfdd0ce4796027

5 years agoExpand gmxapi.operation tools to support the data flow constraints.
M. Eric Irrgang [Tue, 7 May 2019 20:32:02 +0000 (23:32 +0300)]
Expand gmxapi.operation tools to support the data flow constraints.

Achieves functional requirements 1, 2, and 3 as described
in the documentation submitted under #2893.

Updates some acceptance tests duplicated in a companion change.

Fixes: #2894

Change-Id: I26b1413c83e3ad176f2fd70f93e8b8e1033667ae

5 years agoFix formatting and typos.
M. Eric Irrgang [Wed, 8 May 2019 12:30:58 +0000 (15:30 +0300)]
Fix formatting and typos.

Resolve some typos from earlier rebase.

Rearrange imports, dunders, and white space for better PEP8 compliance.

Change-Id: I14319b7882e17937f92951339a5caf9bc454cf4d

5 years agoSupport basic command line wrapper in gmxapi
M. Eric Irrgang [Wed, 10 Apr 2019 14:32:00 +0000 (17:32 +0300)]
Support basic command line wrapper in gmxapi

Introduces gmxapi.commandline module and updates gmxapi.operation
to support gmxapi.commandline.cli() operation.

Ref: #2894

Change-Id: I9f6c113f21d3a1ce97184a1e48b8bd4856c5c924

5 years agoProvide hook for forks of GROMACS to describe themselves
Mark Abraham [Tue, 7 May 2019 13:20:14 +0000 (15:20 +0200)]
Provide hook for forks of GROMACS to describe themselves

This will help everybody understand which version of GROMACS is being
used because a description ends up in the log file.

Change-Id: I2ddd4def5b2a3768174a6b0ccc284cbc118906a1

5 years agoProvide better help for using libc++
Mark Abraham [Tue, 7 May 2019 08:08:55 +0000 (10:08 +0200)]
Provide better help for using libc++

This is now the actual cmake option required

Refs #2842

Change-Id: I1ab4676b0e01d65ba8df736b78eeb3c676cdc4ea

5 years agoFixing minor memory issues in MDLib
Artem Zhmurov [Fri, 3 May 2019 16:31:31 +0000 (18:31 +0200)]
Fixing minor memory issues in MDLib

1. Changed to PaddedVector in SETTLE test
2. Added GPU memory deallocation in CUDA versions of
   LINCS and SETTLE.

Change-Id: I3dc8207f8e84f52bfde3f99b144cc44f91f65ee5

5 years agoImprove how mdrun -noappend names output files
Mark Abraham [Thu, 2 May 2019 15:39:52 +0000 (17:39 +0200)]
Improve how mdrun -noappend names output files

Fixes a bug that could lead to names like md.part0001.part0002.log

Change-Id: Ic8f16f7f77e98e1506d7eec2dfc336e808c2d00c

5 years agoRemove PME exclusion correction
Berk Hess [Tue, 16 Apr 2019 08:54:54 +0000 (10:54 +0200)]
Remove PME exclusion correction

Now the group scheme has been removed, ewald_LRcorrection() no longer
needs to correct for exclusions, which simplifies the code.
Also restructured the conditionals for the PME calls in
do_force_lowlevel().

Change-Id: I518f7929460e7209780b967bd612e4b83c14831d

5 years agoMore tests for how mdrun -cpi restarts handle files
Mark Abraham [Tue, 30 Apr 2019 15:14:35 +0000 (17:14 +0200)]
More tests for how mdrun -cpi restarts handle files

These tests clarify the behaviour of mdrun -cpi -noappend. It should
append ".partNNNN" to output files, but it is currently possible to
produce output files named like md.part0001.part0002.log

Added some unit tests around the string-handling behaviour that needs
fixing and left TODO comments to show what issues need fixing.

Reduced use of the deprecated mdrun -nsteps option

Refs #2804, #2829

Change-Id: I7e370b835d6fd3512fcaac575d0ff627b33c6e47

5 years agoAdd outputadapters (2/3)
Paul Bauer [Thu, 30 Aug 2018 13:28:27 +0000 (15:28 +0200)]
Add outputadapters (2/3)

Add outputadapters based on IOutputAdapter that can be used to set the
box information in the t_trxframe, and toggle the settings for including
forces and velocities into the t_trxframe.

Change-Id: I13c637ab5e6f7e008a971798a5573f8ee1314667

5 years agoReplace t_grps with std::vector
Paul Bauer [Tue, 2 Apr 2019 10:36:58 +0000 (12:36 +0200)]
Replace t_grps with std::vector

Refs #2833

Change-Id: Ia1f156fec4c6c24f4c29a792e384668d835416f0

5 years agoConvert manage_threading_t and gmx_enerdata_t to C++
Berk Hess [Wed, 17 Apr 2019 16:50:38 +0000 (18:50 +0200)]
Convert manage_threading_t and gmx_enerdata_t to C++

Change-Id: I75fd6e0b8f217461f328690d168f61d5b45239cf

5 years agoAdd outputadapters (1/3)
Paul Bauer [Thu, 30 Aug 2018 13:23:49 +0000 (15:23 +0200)]
Add outputadapters (1/3)

Add outputadapters based on IOutputAdapter that can be used to set the
number of atoms written to disk and control the addition of the t_atoms
information to the processed t_trxframe.

Change-Id: I0084a1566024f0a56f72eab031f927d342f42b30

5 years agoInfrastructure updates for dependent changes.
M. Eric Irrgang [Fri, 29 Mar 2019 12:23:39 +0000 (15:23 +0300)]
Infrastructure updates for dependent changes.

* Introduce gmxapi.exceptions.ProtocolError.
* Add some pytest configuration and helpers.
* Update some comments.

Refs: #2893

Change-Id: I71030c3b552d568df7263115430631208812b9dc

5 years agoUse test with parameters for EnergyOutput
Artem Zhmurov [Mon, 29 Apr 2019 13:33:34 +0000 (15:33 +0200)]
Use test with parameters for EnergyOutput

Some of the energy terms are printed out only if the specific
combination of thermostat/barostat/integrator is enabled. The
output also considerably different if it is from a rerun. This
commit changes the tests so that several possible combinations
of input parameters are tested.

This commit also fixes a possible bug when having more
acceleration groups than temperature coupling groups would
lead to under-allocation of temporary variable tmp_v.

Change-Id: Icc08e49a428b14ffd62d251662eb96184564b2c4

5 years agoAdd builder for TrajectoryFileWriter
Paul Bauer [Tue, 9 Oct 2018 12:52:46 +0000 (14:52 +0200)]
Add builder for TrajectoryFileWriter

Adds builder method and storage for requirements on how to build an
object with its outputadapter methods.

Change-Id: I1b52e0cbb0bc39d8d1a78087a0526dcee8f8c289

5 years agoChange nbnxm FEP pointer to unique_ptr
Berk Hess [Tue, 30 Apr 2019 07:07:24 +0000 (09:07 +0200)]
Change nbnxm FEP pointer to unique_ptr

This fixes an incorrect delete issue in free energy runs.

Change-Id: Ib247c6eaa98807fe3abe2fcefd09d8509d6b8598

5 years agoEnhance path search functions
Mark Abraham [Tue, 30 Apr 2019 15:03:53 +0000 (17:03 +0200)]
Enhance path search functions

Extracted common implementation functions based on compat::string_view
and simplified the uses of them. Some temporary strings are no longer
created. Added, updated, and corrected Doxygen. Removed comments about
dot and dot-dot special directories, as the code does not do anything
about them. Moved some naming in the direction of C++17
std::filesystem::path.

Added new tests to cover the changes. Used namespaces better in the
test file. Used reference data for the tests.

Eliminated getParentPathAndBasename as redundant.

Change-Id: I11a1a25a257da753ca83f5bdd09d06b11c76cec5

5 years agoCUDA version of SETTLE algorithm with basic tests
Artem Zhmurov [Wed, 27 Feb 2019 15:38:42 +0000 (16:38 +0100)]
CUDA version of SETTLE algorithm with basic tests

CUDA-based GPU implementation of SETTLE. This is a part of
all-GPU loop. Can work isolated from other parts of the code
since coordinates are copied to (from) device before (after)
SETTLE kernel call. The velocity update as well as virial
evaluations can be enabled.

To enable, set GMX_SETTLE_GPU environment variable.

Limitations:
1. Does not work when domain decomposition is enabled.
2. Projection of the derivative is not implemented.
3. Not fully integrated/unified with the CPU version.

TODOs:
1. Multi-GPU case.
2. Better virial reduction. This is a more general feature,
   not only related to constraints.
5. More cleanup in constr.cpp needed.
6. Better unit tests.

Refs #2816, #2886

Change-Id: I218e1bf1f86a2351e189e3c27f950f45c06135a4

5 years agoTest the output of "gmx mdrun help"
Mark Abraham [Wed, 17 Apr 2019 06:35:11 +0000 (08:35 +0200)]
Test the output of "gmx mdrun help"

As we migrate mdrun to use the gmx::Options framework, several chunks
of text and many option descriptions will move to their respective
modules. However users would prefer the output of "gmx mdrun help" to
only change in ways that we as developers expect.

This will also provide a stable path towards e.g. implementing gmx
minimize, gmx tpi, gmx rerun, etc. and having the help text relevant
only to that runner. It may also be useful if in future we structure
mdrun modules to write their help via e.g. "gmx help mdrun pulling".

Change-Id: Iccd07f797004d8ff24eb56ca528a3fe9148b6749

5 years agoAdd con/destructor for t_forcetable
Berk Hess [Thu, 28 Feb 2019 12:40:27 +0000 (13:40 +0100)]
Add con/destructor for t_forcetable

This avoids the need for sfree calls in C++ objects that use this.

Change-Id: I21d6867a9e3c84929ecf472e65ee97b3cf7c4846

5 years agoConvert DispersionCorrection to a class
Berk Hess [Wed, 27 Feb 2019 08:58:37 +0000 (09:58 +0100)]
Convert DispersionCorrection to a class

This change is only refactoring.

Change-Id: Ic6d90a26b485ab1546706bf8f419d7a297c7c7b5

5 years agoFix for the CUDA version of LINCS
Artem Zhmurov [Mon, 29 Apr 2019 15:42:48 +0000 (17:42 +0200)]
Fix for the CUDA version of LINCS

This fixes a couple of Jenkins Post-submit failures:
1. Clang warnings in the CUDA portion of code.
2. New CUDA LINCS failure on the host with CUDA, but without
   capable GPU.

Also done is minor renaming and typo correction.

Change-Id: I4f1d89d4bf5a6f3f0083186cb67787cdf6536bb9

5 years agoCUDA version of LINCS constraints.
Artem Zhmurov [Wed, 20 Feb 2019 14:30:29 +0000 (15:30 +0100)]
CUDA version of LINCS constraints.

Implementation of the LINCS constraints for NVIDIA GPUs.
Currently works isolated from the other parts of the code:
coordinates and velocities are copied to and from GPU on
every integration timestep. Part of the GPU-only loop.
Loosely based on change 9162 by Alan Gray. To enable,
set the environmental variable GMX_LINCS_GPU.

Limitations:
1. Works only if the constraints can be split in short
uncoupled groups (currently < 256, designed for H-bonds
constraints).
2. Does not change the matrix inversion order for costraints
   triangles.
3. Does not support free energy computations.
4. Assumes no communications between domains (i.e. assumes that
   there is no constraints connecting atoms from two different
   domains).
5. Number of thread per blocks should be a power of 2 for
   reduction of virial to work.

TODOs:
1. Move more data from the global memory to local.
2. Change .at() to []
3. Add sorting by the number of coupled constraints to decrease
   warp divergencies.
4. numAtoms should be changeable (for multi-GPU case).

Refs #2816, #2885

Change-Id: I3c975cf898053b7467bcd30459e60ce2c8852be6

5 years agomrc density map reading/writing
Christian Blau [Wed, 17 Apr 2019 13:50:35 +0000 (15:50 +0200)]
mrc density map reading/writing

Add a class that combines header and mrc data handling for float values
to enable reading and writing of mrc files.

refs #2282

Change-Id: Idd84ab2628a52a2fcafb6121ad66f62e88235c74

5 years agoThree dimensional coordiante transformation.
Christian Blau [Tue, 23 Apr 2019 13:03:52 +0000 (15:03 +0200)]
Three dimensional coordiante transformation.

Introduce class that transforms three dimensional coordiantes via scaling and translation.

Change-Id: Ic433400cf42c33d7eadd4a17020d0486542b8542

5 years agoAdd C++ coordinate file writing method.
Paul Bauer [Tue, 9 Oct 2018 12:35:12 +0000 (14:35 +0200)]
Add C++ coordinate file writing method.

TrajectoryFileWriter also allows the chaining of modules derived from
IOutputAdapter together to perform actions that modify the meta
information contained in a t_trxframe before writing the information to
disk.

IOutputAdapter can be used to communicate what requirements a specific
file writing method has on the meta information contained in t_trxframe,
with modules being able to proclaim those and TrajectoryFileWriter checking
them against the requested file types before accepting the addition of a
module to the processing chain.

The TrajectoryFileWriter object needs a builder method to construct itself that will
be added in a child change.

Change-Id: I1c29701b4ce788918cb6b3a47ca9277898a7bff4

5 years agoFix clang warning about NULL use
Szilárd Páll [Thu, 25 Apr 2019 12:20:04 +0000 (14:20 +0200)]
Fix clang warning about NULL use

Change-Id: Ia34e401bf04f1743419898fdb60671d3f066992f

5 years agoAvoid using AtomLocality::Count as a valid value
Szilárd Páll [Wed, 24 Apr 2019 10:36:02 +0000 (12:36 +0200)]
Avoid using AtomLocality::Count as a valid value

Change-Id: I740eef01e679f085a9f73c60a67377e0122daba4

5 years agodensity fitting forces
Christian Blau [Tue, 16 Apr 2019 12:04:13 +0000 (14:04 +0200)]
density fitting forces

Evaluate forces on atoms that increase a measure of the goodness of fit to a reference density.

The density fitting forces are evaluated as the gradient of the goodness of fit of a comparison density is generated from atoms by spreading on a grid via a Gaussian kernel to the reference density.

Applying the chain rule for this gradient yields the density fitting force as the inner product of the derivative of the comparison density to reference density goodness-of-fit function at all density values and the gradient of the spreading kernel used to simulate the density.

This patch assumes that the comparison density to reference density goodness of fit derivative density is given, methods that aid the evaluation of this derivative density are part of a child patch.

refs #2282

Change-Id: I4d93fffbdb41753f9a0a4af921011aca02ade69c

5 years agoImprovements for energy output test.
Artem Zhmurov [Fri, 12 Apr 2019 15:49:22 +0000 (17:49 +0200)]
Improvements for energy output test.

EnergyOutput handles outputs to the text log file
as well as to the binary edr file with the number of
the printed energy terms determined by the simulation
setup. This commit adds the tests for the binry output
and increases the number of tested energy terms.

TODO Proper fix for memory leak in energy output.

Change-Id: I670b168a83c0a1883b821a4b317c0df3055183e8

5 years agoAdd Interface to change coordinate file info
Paul Bauer [Tue, 13 Nov 2018 10:36:33 +0000 (11:36 +0100)]
Add Interface to change coordinate file info

Adds the IOutputAdapter interface to organize coordinate output file
writing, as well as enum flags to communicate requirements between output
modules and output filetypes, as well as the outputadaptercontainer storage
object to keep track of modules derived from the IOutputAdapter
interface.

IOutputAdapter can be used to communicate what requirements are specific
file writing method has on the meta information contained in t_trxframe.

Change-Id: I0011c852eb54bd551230dd8c4971292dd4edc7e5

5 years agoUpdate style guide about class enums
Mark Abraham [Thu, 25 Apr 2019 08:04:02 +0000 (10:04 +0200)]
Update style guide about class enums

Change-Id: Icf6ddde8ce030bd5ed737152a8c58daad87ff991

5 years agoFix CUDA fallback shmem gather reduction
Szilárd Páll [Fri, 15 Feb 2019 17:34:52 +0000 (18:34 +0100)]
Fix CUDA fallback shmem gather reduction

Fixed some shmem races and an intra-warp WAR hazard.

Change-Id: Ic02874f147e1c3a0dad1b67a6464ede453f77c47

5 years agoClarify pushing of interaction types
Mark Abraham [Wed, 17 Apr 2019 09:24:00 +0000 (11:24 +0200)]
Clarify pushing of interaction types

gcc was warning about possibly pushing atomNumber to a vector when its
value was not defined.  That was impossible because of the gmx_incons
earlier, but we can express the validity of the code much more clearly
to the reader/compiler.

Fixes CMAP implementation also

Extracted the common code to a function.

Change-Id: I74be61b125e05ff5505162440349fcef4ea50fdb

5 years agoUpdated clang -Weverything checks to clang-7
Mark Abraham [Wed, 17 Apr 2019 12:31:44 +0000 (14:31 +0200)]
Updated clang -Weverything checks to clang-7

This is supposed to be used with the latest tested clang
compiler. That is now clang 7, but the logic is hard-coded to clang 6,
which is why some things only failed in post-submit testing where we
have such a compiler for the clang-cuda build.

Fixed issues only found with clang -Weverything.

Also fixed those found with clang-8, but as we do not yet use that in
Jenkins, they're commented out for now.

Change-Id: I83be1cb770d486cc81a453d4911361f06a056ce3

5 years agoThree dimensional gauss transform
Christian Blau [Wed, 10 Apr 2019 13:58:46 +0000 (15:58 +0200)]
Three dimensional gauss transform

Added class that adds gaussians functions with specified
amplitudes and coordinates onto a three-dimensional scalar field.

Change-Id: I07ea2cdd219b34afc402975a0b0e8a52eb71acaf
refs: #2282

5 years agoOne dimensional Gaussian function on lattice.
Christian Blau [Wed, 10 Apr 2019 13:52:48 +0000 (15:52 +0200)]
One dimensional Gaussian function on lattice.

Evaluate a Gaussian of width sigma in one dimension on lattice points with unit spacing.

refs #2282

Change-Id: I57a513f05af44323e7109c4560438dc023793c4c

5 years agoRemove nbnxm kernel type from pairlist generation
Berk Hess [Thu, 21 Mar 2019 21:09:30 +0000 (22:09 +0100)]
Remove nbnxm kernel type from pairlist generation

The type of kernel for computing distances between atom clusters pairs
is no longer set directly by the non-bonded interaction kernel type.
A new type is added for this, although the actual choice of cluster
distance kernel type has actually not changed.
Also moved the declaration of PairlistType to pairlistparams.h.

Change-Id: Iaf38ca7804eed75295e6cb0e1176a23d620c6f0c

5 years agoRemove charge groups from domdec and localtop
Berk Hess [Tue, 16 Apr 2019 14:19:01 +0000 (16:19 +0200)]
Remove charge groups from domdec and localtop

Code explicitly handling charge groups has been removed in the domdec
module. Removed the charge groups from gmx_localtop_t.
Changed cginfo in forcerec to std::vector, which propagates into
the nbnxm module.
Parts of the TPI code are now commented out until reimplemented.

Change-Id: I9d3bffe26e34ebbb8e31ef97a9a7f1e0bea92306
Todo: Change naming from charge group to atom.
Todo: Remove duplicate counters for atoms and charge groups.

5 years agoFix warnings & consolidate declarations
Szilárd Páll [Mon, 15 Apr 2019 16:24:42 +0000 (18:24 +0200)]
Fix warnings & consolidate declarations

- Unused variables warnings with cuda 10.1
- Early declaration of kernel pointers eliminated

Change-Id: I7c8ca06322a3da9c948cc19d6b0b0f6a53f16beb

5 years agoCreate gmx::compat::optional
Mark Abraham [Fri, 8 Feb 2019 15:55:27 +0000 (16:55 +0100)]
Create gmx::compat::optional

This C++17 std component is an extremely useful vocabulary type that
has a straightforward implementation in C++14. Having it available is
likely to mean we can write simpler, less buggy code in less developer
time. It should be used in cases where the absence of a proper value
has an obvious natural interpretation, e.g. the type of the return
value of a function that parses an integer value from a string, or
searching for a matching element in a range, or optionally naming
a residue type.

Updated developer guide and COPYING file accordingly.

Used compat::optional for some aspects of residue handling. This
simplifies some code, and sometimes avoids needing to make a dummy
residue name string that then needs to be compared with other strings.

Let .clang-tidy file's header management apply to source fields for
test binaries.

Excluded the external code from Doxygen checking. Noted where to go
for documentation in the file Doxygen.

Fixes #2861

Change-Id: Ife34983f234549702902a0ea45dc3592098e377d

5 years agoMove pull work struct out of inputrec
Mark Abraham [Sun, 14 Apr 2019 19:45:53 +0000 (21:45 +0200)]
Move pull work struct out of inputrec

Its lifetime is now managed by runner. This will make high-level
organization more comprehensible, and permit more meaningful
const-correctness of t_inputrec.

Change-Id: I66bf765ad7235d84184227325eb52afd58146b72

5 years agoImprove swapcoords session lifetime management
Mark Abraham [Sat, 13 Apr 2019 14:46:20 +0000 (16:46 +0200)]
Improve swapcoords session lifetime management

This is no longer stored in the inputrec (which is now more
const-correct), and it is also now be cleaned up in one place.

Change-Id: I4d3c3ebb8124849cf7e13334759fda731370c1bc

5 years agoUpdate clang-tidy to check for dangling references
Paul Bauer [Fri, 5 Apr 2019 08:22:49 +0000 (10:22 +0200)]
Update clang-tidy to check for dangling references

Change-Id: I4a720ee29dddcb0778f88aaa3b1057c61d319036

5 years agoFix pdb-related issues
Berk Hess [Sat, 13 Apr 2019 10:00:06 +0000 (12:00 +0200)]
Fix pdb-related issues

In editconf, if a PDB input was read, chain IDs are known, and should
be written if the output is also PDB. This now works again, after
being broken in commit 8dd3c9ae88004054b3.

This required adding missing tpr support to readConfAndAtoms(), which
also fixes that pdb2gmx, insert-molecules, and solvate could not read
tpr files. Those are the only tools that directly or indirectly called
readConfAndAtoms with a .tpr file.

Fix in master also closes memory leaks.

Refs #2900

Change-Id: I883777be945023a7e69260b22e76df54477828ee

5 years agoRemove group scheme search code
Berk Hess [Wed, 17 Apr 2019 09:35:59 +0000 (11:35 +0200)]
Remove group scheme search code

This also required removing the generic group kernel code.
Removed domdec group scheme sorting code.
Also removed the nbnxm grid size call from the domdec module off it
turned out the results were not used.

Change-Id: I1a49967bbeca33dcd62834e8a244aaf02e80a95e

5 years agoSimplify vsite PBC handling
Berk Hess [Tue, 16 Apr 2019 20:59:03 +0000 (22:59 +0200)]
Simplify vsite PBC handling

Since we no longer support charge groups, removed the (complex)
vsite pbc tracking code.
Also changed the inter charge group vsite counting to inter update
groups counting, so we can avoid PBC calculation with update groups.

Change-Id: Iebaee9a25e761d38c571563fd0814b57e15c7e5f

5 years agoMove shellfc code to the mdrun module
Prashanth Kanduri [Fri, 29 Mar 2019 16:15:32 +0000 (17:15 +0100)]
Move shellfc code to the mdrun module

This code was previously in mdlib and made use of the force
calculation routines. The introduction of the forceschedules
module (Patch 9363) introduces a cyclic dependency.

Therefore, this clean up is important to ensure that all
users of the Force Schedules are present in a single module.

Related: #2574, #2774

Change-Id: I19563f0f6e7985d198a2497a799c5377b24a1419

5 years agoEnable printing of known issues in commandline
Paul Bauer [Fri, 5 Apr 2019 15:41:55 +0000 (17:41 +0200)]
Enable printing of known issues in commandline

Showcase in gmx dump.
Added test for it.

Change-Id: If1e70cc3b1a9c73a9483ba643a979edb2838d6a5

5 years agoCreate gmx::compat::string_view
Paul Bauer [Wed, 3 Apr 2019 13:38:44 +0000 (15:38 +0200)]
Create gmx::compat::string_view

This part of the C++-17 std will likely help in cases we want objects to
store views to std::strings instead of performing a copy of them.

Updated COPYING instructions and developer guide.

Excluded the external code from Doxygen checking.
Noted where to go for documentation in the file Doxygen.

Change-Id: Ibc75f32929d385159d27d0b7ba87f2133995e915

5 years agoFix post-submit
Mark Abraham [Wed, 17 Apr 2019 05:06:54 +0000 (07:06 +0200)]
Fix post-submit

Change-Id: I203647ed9ac70c99d188d29223a3a4141d3d4533

5 years agoReduce nbnxm CPU kernel arguments
Berk Hess [Fri, 12 Apr 2019 12:43:34 +0000 (14:43 +0200)]
Reduce nbnxm CPU kernel arguments

The number of output arguments for nbnxm CPU kernel functions
ave been reduced to one.

Change-Id: I4d69d848b490dced6007400f8f8fae0ff0638f63

5 years agoSimplify nbnxm shift force handling
Berk Hess [Fri, 12 Apr 2019 12:17:37 +0000 (14:17 +0200)]
Simplify nbnxm shift force handling

Now thread 0 also stores the shift forces in the out thread buffer
of nbnxn_atomdata_t instead of using the global fshift buffer.

Change-Id: I8c850ffc2d55db1cd7b34c1a18977f73e5cb77b0

5 years agoMove functions operating on enerdata out of force.cpp
Szilárd Páll [Mon, 15 Apr 2019 23:32:27 +0000 (01:32 +0200)]
Move functions operating on enerdata out of force.cpp

Change-Id: I20165ac5b2a34fcb80db8c7624adb57b4b542df6

5 years agoSimplify nbnxm buffer clearing
Berk Hess [Fri, 12 Apr 2019 09:26:33 +0000 (11:26 +0200)]
Simplify nbnxm buffer clearing

We should not pass both the output index and the buffer to the clearing
function.
Also templated the flagged clearing in preparation for use for clearing
other buffers.

Change-Id: I0fdb8eb0ba9ab5766e9d6ba57804783a87163cd4

5 years agoRemove RF_excl_correction()
Berk Hess [Tue, 16 Apr 2019 08:05:59 +0000 (10:05 +0200)]
Remove RF_excl_correction()

Was only used with the group scheme. The RF correction is computed
along with the non-bonded interactions in the nbnxm kernels.

Change-Id: I1451493faa7fafb7cddf508d396b0bd06cf70272

5 years agoRemove "coarse load balancing vars" from forcerec
Szilárd Páll [Mon, 15 Apr 2019 22:23:18 +0000 (00:23 +0200)]
Remove "coarse load balancing vars" from forcerec

Legacy timing code dropped during cleanup.

Change-Id: I4a3d0f69d926973c6269df15eea8b448539c54d4

5 years agoRefactor t_pindex
Paul Bauer [Tue, 12 Mar 2019 11:17:11 +0000 (12:17 +0100)]
Refactor t_pindex

Also change naming of containers for interaction types to better reflect
what is actually stored in the container.

Refs #2833

Change-Id: I581fb2a436528c00770b98ba6e5d45af7c7d9a0c

5 years agoGroup scheme related cleanup
Szilárd Páll [Mon, 15 Apr 2019 19:02:17 +0000 (21:02 +0200)]
Group scheme related cleanup

Removed:
- SR force calculation invocation
- LR correction invocations
- SR free energy component accumulation

Minor cleanup.

Refs #1852

Change-Id: I4e22986279039a0f49a5a8be3c447f4115308492

5 years agoRemoved mdrun -gcom
Mark Abraham [Sat, 13 Apr 2019 14:55:39 +0000 (16:55 +0200)]
Removed mdrun -gcom

This was previously deprecated, and is now removed to make the
behaviour of mdrun simpler to understand and implement.

Renamed a function whose job was previously not to check a thing,
and is now clearly to compute something

Noted several TODOs to clean up behaviour related to nstcomm.

Refs #1925

Change-Id: I0b3a803fb209148e865957f796c871caef2f1fea

5 years agoRemove Group scheme neighbor search wrapper
Szilárd Páll [Mon, 15 Apr 2019 19:15:05 +0000 (21:15 +0200)]
Remove Group scheme neighbor search wrapper

Change-Id: Id89aa1b7b38c918a120385d4f1a2c7bdba82fa7b

5 years agoFix for the memory access error in constraints test.
Artem Zhmurov [Mon, 15 Apr 2019 17:41:56 +0000 (19:41 +0200)]
Fix for the memory access error in constraints test.

When SIMD enabled, some memory accesses can fall outside
the allocated memory space. Hence, padding was added for
coordinates and velocities.

Change-Id: I95fa496d398fef85c62aa0ee7e90ecda4dbb8daf

5 years agoDie with helpful note in case of incorrect input to editconf with -conect
ejjordan [Mon, 15 Apr 2019 19:11:55 +0000 (21:11 +0200)]
Die with helpful note in case of incorrect input to editconf with -conect

Previously editconf would give a cryptic error message
Assertion failed:
Condition: fio->xdr != nullptr
Implementation error: NULL XDR pointers
if -conect was specified and a tpr was not supplied.
This is now replaced by a fatal error

Change-Id: I69efc6d36c8dd8314b2656e88407e8ba00915fd7

5 years agofix formatting of editconf note
ejjordan [Mon, 15 Apr 2019 18:34:08 +0000 (20:34 +0200)]
fix formatting of editconf note

Change-Id: I628fc820a176fdc4b019e5819e6fa650842024d4

5 years agoStart making IMD and swap model IMDModule
Mark Abraham [Sun, 31 Mar 2019 16:42:04 +0000 (18:42 +0200)]
Start making IMD and swap model IMDModule

Moved MDModules to mdrun code module (to relieve cyclic dependency
that would otherwise result), because it is a very high level thing
that is intended to be aware of very many components.

Refs #2877

Change-Id: Ia7d1422bab887f768f8abed01edcbc4fb290dfeb

5 years agoAdd GROMACS library dependency to gmxapi package.
M. Eric Irrgang [Fri, 15 Mar 2019 11:24:53 +0000 (14:24 +0300)]
Add GROMACS library dependency to gmxapi package.

The `gmxapi` Python package has a C++ extension module configured and
built through CMake. This change links the C++ extension module to the
GROMACS library external interface.

No new code is introduced. This change just establishes that a Python
package can be built, installed, and imported with dynamic linking to
an installed GROMACS library.

Ref: #2912

Change-Id: I1c992c30132df25cf6a91902611cb201962649af

5 years agoUse pybind11 to make a minimal C++ Python extension.
M. Eric Irrgang [Wed, 27 Feb 2019 07:46:51 +0000 (10:46 +0300)]
Use pybind11 to make a minimal C++ Python extension.

* Bundle pybind11 2.2.4 headers
* Create the `gmxapi._gmxapi` submodule as a C++ extension module.

Ref: #2912

Change-Id: Iadc8645906c2b89d98fae57b891deac80793b050

5 years agoReuse rvecs_differ in InteractiveMD module
Mark Abraham [Wed, 10 Apr 2019 05:51:00 +0000 (07:51 +0200)]
Reuse rvecs_differ in InteractiveMD module

Change-Id: I5dfbfc0c0934dc734045f41db8075ad5f1a0b635

5 years agoMake ImdSession into a Pimpl-ed class with factory function
Mark Abraham [Sun, 31 Mar 2019 12:29:20 +0000 (14:29 +0200)]
Make ImdSession into a Pimpl-ed class with factory function

This prepares to make IMD into a proper module. No
functionality changes in this commit.

Replaced gmx_bool with bool

Used fast returns when IMD is inactive, for better
readability of code.

Refs #2877

Change-Id: Ibbe8c452f6f480e9a357fe1b87da3ab0ae166317

5 years agoReform IMD module
Mark Abraham [Fri, 29 Mar 2019 13:54:36 +0000 (14:54 +0100)]
Reform IMD module

Remove GMX_HAVE_WINSOCK which was synonymous with Windows
support. Because that is somewhat risky, introduced CMake variable to
turn off IMD support. Reduced a lot of config.h dependency in
headers. Moved portability constructs to imdsocket source file.

Expanded testing coverage to be of both a minimizer and a dynamical
integrator. Switched the test case to be one that has some
interactions (because steep segfaults otherwise), and updated the mdp
settings to continue to work given the likely future directions of
mdrun.

Removed an unused method

Moved the ownership of the IMD session data structure out of inputrec
and its point of construction out of minimizers and do_md. This is now
done in runner.cpp, alongside other such construction. This prepares
for more use of MDModules. Set up the default period between IMD steps
in a different but equivalent way (since it works differently for
minimization).

Separated the inputrec boolean for whether IMD connections are
supported by the input from the run-time boolean of whether the mdrun
command-line arguments require IMD connections to be possible. Now the
inputrec is logically const with IMD.

Used logging framework for reporting, and noted future improvements as
TOD items.  Improved reporting in some cases where IMD sessions are
impossible.

Note TODOs for future improvements for renaming and restructuring.

Removed some useless inclusion of imd.h

Fixes #2913

Change-Id: I2b13dcdd9a0e69caba697f9dd2c928d94e1fb80c

5 years agoIntroduce gmxapi operations and basic data model.
M. Eric Irrgang [Fri, 29 Mar 2019 12:59:54 +0000 (15:59 +0300)]
Introduce gmxapi operations and basic data model.

Ref: #2894

Change-Id: I4e899e63287370fd2fdde89ddc1b2ea39c3fe67d

5 years agogmxapi 2019 Q1/Q2 project roadmap.
M. Eric Irrgang [Tue, 19 Mar 2019 14:58:03 +0000 (17:58 +0300)]
gmxapi 2019 Q1/Q2 project roadmap.

Lay out project goals, functional requirements, and testing plans.
Provides roadmap.rst and pytest acceptance tests
expressing the required functionality of the Python package.

Ref: #2893

Change-Id: I71ec79eb5d8a6e4d61fb5d7d6e20176c9c07a6af

5 years agoRemove stale "TODO".
M. Eric Irrgang [Mon, 8 Apr 2019 15:23:40 +0000 (18:23 +0300)]
Remove stale "TODO".

Refs #2839

Change-Id: I927ee73fc9c6ffa423d37fd4606654392cb8a1b8

5 years agoRemove t_topology from two preprocess tools
Paul Bauer [Thu, 4 Apr 2019 14:31:03 +0000 (16:31 +0200)]
Remove t_topology from two preprocess tools

Refs #2833

Change-Id: Ic842305579986910db8cc30313f74278239640bc

5 years agodensityfitting - MDModule declaration
Christian Blau [Thu, 21 Mar 2019 15:48:04 +0000 (16:48 +0100)]
densityfitting - MDModule declaration

Declaring the infrastructure for running molecular dynamics simulations with
addional forces that are derived from densities.

Adds a IForceProvider for density fitting simulation that is set up with
its DensityFittingParameters that are in turn built from DensityFittingOptions.

refs #2282 #2901

Change-Id: I0732a78747582a6e23bba1e141d73c4cda421011

5 years agoRevert "Temporarily disable ARM HPC compiler in post-submit"
Szilárd Páll [Thu, 4 Apr 2019 16:59:29 +0000 (18:59 +0200)]
Revert "Temporarily disable ARM HPC compiler in post-submit"

This reverts commit d8d9b66ca33e423ca09079e5f9294ca872d61ca5.

Reason for revert: build slave software issues resolved.

Change-Id: I9f7c904152e4be951199c9fcdba00bd9d928f33b

5 years agoEarly exit from mdrun if group scheme is detected in .tpr
Carsten Kutzner [Thu, 4 Apr 2019 14:36:50 +0000 (16:36 +0200)]
Early exit from mdrun if group scheme is detected in .tpr

Fixes #2918

Change-Id: I37566623c3ed4613f8b4e69f9f74882656772d1d

5 years agoRemove isPressureCouplingStep(...)
Artem Zhmurov [Mon, 1 Apr 2019 09:48:05 +0000 (11:48 +0200)]
Remove isPressureCouplingStep(...)

The isPressureCouplingStep(..) subroutine is called from places,
where the type of barostat is already known and then checks for it
again. Removing this subroutine eliminates the double-checks and
improves readability of the code.

Change-Id: I5bbb0706432e16414097e87e4e0d302f669ab83f

5 years agoUpdate developer guide for changes to Gerrit
Paul Bauer [Thu, 4 Apr 2019 09:59:27 +0000 (11:59 +0200)]
Update developer guide for changes to Gerrit

Change-Id: I2fad9ad5dfd0fb4536520529706d6dbaaca5d5d9

5 years agoRemove isTemperatureCouplingStep(...)
Artem Zhmurov [Mon, 1 Apr 2019 09:24:23 +0000 (11:24 +0200)]
Remove isTemperatureCouplingStep(...)

This subroutine hides the checks on whether the temperature
coupling should be updated, making it harder to read the
sequence of events in the main loop. Also, the subroutine is
used only twice and both times some of the conditionals are
double checked (e.g. is Velocity-Verlet integrator is in use).

Change-Id: Idb4196c2f81095c09426b2798e79d2beea4f306e

5 years agoInitial deactivation of group scheme.
Mark Abraham [Wed, 3 Apr 2019 13:58:39 +0000 (15:58 +0200)]
Initial deactivation of group scheme.

mdrun now gives a fatal error with a group-scheme .tpr, so anybody
using one won't get a segfault.

do_force now only has one implementation, which suits those working
on improved force calculations.

More removal of inactive code will follow later. Noted TODO to fix the
release notes properly in such a commit.

Refs #1852

Change-Id: I3b13135565951f4d7f872ddf3b8518860eccfdb0

5 years agoFix post submit
Paul Bauer [Wed, 3 Apr 2019 08:47:02 +0000 (10:47 +0200)]
Fix post submit

Change-Id: Ia45a8e1154c0d5ddd94155ddb7907c0290d13866

5 years agoRefactor gpp_bond_atomtype
Paul Bauer [Tue, 12 Mar 2019 15:28:44 +0000 (16:28 +0100)]
Refactor gpp_bond_atomtype

Refs #2833

Change-Id: Id17a93c9cc4a66b0bf89c465d2d44601fe2c523d

5 years agoAdd std::string case insensitive compare
Paul Bauer [Fri, 15 Mar 2019 11:26:38 +0000 (12:26 +0100)]
Add std::string case insensitive compare

Add another function for std::string case insensitive
comparison over a user specified length instead of
comparing the full string.

Added tests for functionality.

Showcase in preprocessing.

Change-Id: I1f117261ce56ad7c6bc5e5113da1fef705cf8aa6