alexxy/gromacs.git
3 years agoRelease configs were using a wrong build type
Mark Abraham [Fri, 31 Jul 2020 08:33:34 +0000 (10:33 +0200)]
Release configs were using a wrong build type

3 years agoMove foreign potential energy accumulation
Berk Hess [Fri, 31 Jul 2020 08:47:03 +0000 (08:47 +0000)]
Move foreign potential energy accumulation

The potential energy contributions to the foreign lambda
Hamiltonian differences were summed in sum_dhdl() which meant
that the foreign energy differences were not complete when
do_force() returns. Now there are summed in
accumulatePotentialEnergies() which is called instead of sum_epot().

Also consistently changed the lambda vector to ArrayRef in the force
routines and made it const.

3 years agoMove sources for libgmxapi.
M. Eric Irrgang [Thu, 30 Jul 2020 14:17:53 +0000 (17:17 +0300)]
Move sources for libgmxapi.

Sources in src/api/cpp exclusively supported the public libgmxapi
interface whose headers now live in api/include/gmxapi. The sources are
not coupled to anything in src/gromacs or src, and have been moved to
api/cpp/gmxapi to better enforce this decoupling.

Currently, the unit tests for this code still rely on infrastructure in
src/ and cannot yet be moved.

Refs #3152

3 years agoRemove disabled test for superseded feature.
M. Eric Irrgang [Thu, 30 Jul 2020 10:02:32 +0000 (13:02 +0300)]
Remove disabled test for superseded feature.

3 years agoIgnore a generated file.
M. Eric Irrgang [Thu, 30 Jul 2020 11:13:07 +0000 (14:13 +0300)]
Ignore a generated file.

When a Python package is configured in "develop" mode, the source
directory is treated as the installed directory, so generated package
files end up in the source tree. This change tells `git` to ignore a
generated package file that will be present in a developer's source tree
after `python setupy.py develop`.

3 years agoUse GMXAPI CMake option guard for gmxapi target declaration.
M. Eric Irrgang [Wed, 29 Jul 2020 12:48:17 +0000 (12:48 +0000)]
Use GMXAPI CMake option guard for gmxapi target declaration.

A recent change moved the declaration of the `gmxapi` CMake library
target outside of a conditional. This change isolates the initial
configuration of the CMake target and restores the option guard.

Fixes #3604.

3 years agoFix undefined behavior flagged by UBSAN
Kevin Boyd [Wed, 29 Jul 2020 11:42:59 +0000 (11:42 +0000)]
Fix undefined behavior flagged by UBSAN

Running under the UBSAN sanitizer pointed out a bunch of undefined
behavior - most of them were harmless issues in rarely taken branches,
but should still be avoided.

3 years agoRevert c++-17 features that are not supported by CUDA build
Artem Zhmurov [Wed, 29 Jul 2020 10:48:30 +0000 (10:48 +0000)]
Revert c++-17 features that are not supported by CUDA build

C++-17 is fully supported only starting from CUDA 11, which is not
required currently. This rolls back some of the changes made in
2f876de263efdf08daf160e7791434cd760ccd9b and
106b2d8ded04dbc51031022e9b11d147dccb76a3 that broke the CUDA build.
The change should be reverted once c++17 is fully supported.

Fixes #3608
Refs #3609

3 years agoRevert c++-17 features that are not supported by CUDA build
Artem Zhmurov [Wed, 29 Jul 2020 03:46:11 +0000 (03:46 +0000)]
Revert c++-17 features that are not supported by CUDA build

C++-17 is fully supported only starting from CUDA 11, which is not
required currently. This rolls back some of the changes made in
2f876de263efdf08daf160e7791434cd760ccd9b and
106b2d8ded04dbc51031022e9b11d147dccb76a3 that broke the CUDA build.
The change should be reverted once c++17 is fully supported.

Fixes #3608
Refs #3609

3 years agoFix warnings in release builds
Mark Abraham [Wed, 22 Jul 2020 11:41:55 +0000 (13:41 +0200)]
Fix warnings in release builds

These suppressions need to be issued whether or not we are adding
developer warnings.

Change-Id: I34f4353a9172674b792488e86bf001dd2e8b917c

3 years agoFix clang-tidy warning
Artem Zhmurov [Mon, 27 Jul 2020 10:38:11 +0000 (13:38 +0300)]
Fix clang-tidy warning

clang-tidy complains about comparison of int and gmx::index,
since they are of different type.

3 years agoFix RDTSCP handling
Mark Abraham [Mon, 27 Jul 2020 12:16:56 +0000 (12:16 +0000)]
Fix RDTSCP handling

Commit 13def2872ae5311d tried to make all builds default to using
RDTSCP, which would have broken non-x86 builds. But it also
deactivated the implementation of RDTSCP support because HAVE_RDTSCP
was left undefined. So all it did was make timing on x86 less
efficient (plus e.g. DLB effects from that).

Used GMX_RDTSCP everywhere. Only the GROMACS project depends on
thread-MPI, so it's reasonable to let a GMX symbol leak in there (and
it's easily fixed if ever needed).

3 years agoAssertion string and typo fix
Simon Christ [Fri, 24 Jul 2020 09:52:32 +0000 (09:52 +0000)]
Assertion string and typo fix

3 years agoTwo sets of coefficients for Coulomb FEP PME on GPU
Magnus Lundborg [Mon, 20 Jul 2020 10:17:02 +0000 (10:17 +0000)]
Two sets of coefficients for Coulomb FEP PME on GPU

The first patch in a series to enable running Coulomb FEP PME on GPU.
Use two sets of coefficients to store atom charges.

Refs #2054, #3117

Change-Id: Iab6eb7ac766800f7c045dc5a00069e77509d391f

3 years agoFollow up to "Separate StatePropagatorData element" (!363)
Pascal Merz [Sat, 18 Jul 2020 06:27:10 +0000 (06:27 +0000)]
Follow up to "Separate StatePropagatorData element" (!363)

StatePropagatorData, EnergyData, and FreeEnergyPerturbationData
have all been separated into a pure data class and an Element
member object. The three were intended to be following the same
design principles, but were merged in three separate MR. The
design was improved in reviews of the EnergyData and
FreeEnergyPerturbationData MRs, leaving StatePropagatorData
with some of the design flaws ironed out in the other two.
This commit adapts StatepropagatorData and its member Element
to the improved design. Specifically:

* Build the Element in the constructor of StatepropagatorData.
  To this end, the change in signature of the constructor is
  partially rolled back to have all required data available.
* The element is accessed using a simple getter method, doing
  away with building at first invocation or throwing exceptions
  when accessed more than once.

3 years agoIntroduce modular simulator exceptions
Pascal Merz [Thu, 16 Jul 2020 16:38:23 +0000 (10:38 -0600)]
Introduce modular simulator exceptions

This introduces a new base exception for modular simulator, and a
few exceptions inheriting from this base exception. Having a
modular simulator base class allows to easily add exceptions without
touching (4!) files outside the module. The introduced derived
exceptions are all used in the fulfillment of #3437. Introducing them
in a separate commit allows to keep the final commit smaller.

3 years agoBegin moving installed interface to `api/`
M. Eric Irrgang [Wed, 15 Jul 2020 13:29:47 +0000 (16:29 +0300)]
Begin moving installed interface to `api/`

Create `api/` directory outside of `src/` to decouple the public
interface from the internal and build tree infrastructure.

Move the `gmxapi` installed headers to `api/include/gmxapi`.
The public header maintenance (once managed with custom CMake functions)
is now reduced to filesystem layout and `install` commands in
`api/CMakeLists.txt`

Deferred to future changes:
* Split public and developer doxygen builds.
* Move remaining libgmxapi public interface details to `api/gmxapi`
* Re-expose essential public facilities from libgromacs to allow
  (re-)deprecation of ENABLE_LEGACY_API.

Refs #3288

3 years agoSeparate Element from FreeEnergyPerturbationData
Pascal Merz [Thu, 11 Jun 2020 06:48:11 +0000 (00:48 -0600)]
Separate Element from FreeEnergyPerturbationData

Mirroring the StatePropagatorData and EnergyData, the free energy
element is split up into a data part that is accessed by other
elements, and a member class which implements the ISimulatorElement
to allow for updating and checkpointing of lambda values.

Refs #3437

3 years agoDivide default communicator from DD communicators
Mark Abraham [Wed, 15 Jul 2020 17:09:31 +0000 (17:09 +0000)]
Divide default communicator from DD communicators

The communicators mpi_comm_mysim and mpi_comm_mygroup inside
t_commrec got initialized in init_commrec (to MPI_COMM_WORLD
if no multisim, to a subset otherwise). These communicators
were then used in subsequent setup work, before they got
reassigned during the construction of the DDBuilder object
and the construction of the actual domain decomposition object.
Effectively, this means that the same communicators (and, hence,
identical function calls) do very different things depending on
whether they get used before or after the setup of domain
decomposition. It also means that before DD set up, mpi_comm_mysim
and mpi_comm_mygroup are *identical*.

This change introduces an additional communicator within
t_commrec, mpiDefaulCommunicator, which helps to make these
implicit assumptions explicit. Consequently, this also redefines
PAR(cr), MASTER(cr), and SIMMASTER(cr).

This change will allow to move the sim and group communicators,
which are now only created at DD time, into the DD object,
logically separating the DD object from t_commrec.

Refs #2395

3 years agoFix the suspicious string literal error in GPU status description
Artem Zhmurov [Wed, 15 Jul 2020 16:05:08 +0000 (16:05 +0000)]
Fix the suspicious string literal error in GPU status description

Fixes clang-tidy error, introduced by broken string in
d2ba568ac6d5d3b6a1ef996618a1367307872d03

3 years agoSeparate energy data and element
Pascal Merz [Tue, 14 Jul 2020 13:27:20 +0000 (13:27 +0000)]
Separate energy data and element

The EnergyElement was both holding data which is accessed by
a majority of the elements, and was an element itself. The element
part is needed to update the energy records and save data for
trajectory writing.
The double nature of the EnergyElement created some difficulty in
initializing the elements, however - the EnergyElement
has a well defined place within the simulator loop, but has to be
created ahead of time so that other elements can get a pointer to it
to query for or save energy data during the simulation run.

This change separates the ISimulatorElement implementation which
allows EnergyElement to take part in the simulation loop
into a member object. The data part of the EnergyElement is renamed
to EnergyData, the element is EnergyData::Element. The EnergyData
can now be created ahead of element construction time, while an
object of the member class can be created later. This will make the
implementation of a builder approach significantly easier.
The life time of the element is managed by the EnergyData object to
avoid problematic life time dependencies between the two.

Refs #3437

3 years agocmake: export cxx standard
Christoph Junghans [Sat, 11 Jul 2020 16:32:07 +0000 (16:32 +0000)]
cmake: export cxx standard

3 years agoFix libgromacs CMake target install syntax.
M. Eric Irrgang [Fri, 10 Jul 2020 12:34:03 +0000 (15:34 +0300)]
Fix libgromacs CMake target install syntax.

Make `install(TARGETS libgromacs...` conform to the documented usage at
https://cmake.org/cmake/help/v3.13/command/install.html#programs

Refs #3592

3 years agoDivide default communicator from DD communicators
Pascal Merz [Thu, 9 Jul 2020 12:08:59 +0000 (12:08 +0000)]
Divide default communicator from DD communicators

The communicators mpi_comm_mysim and mpi_comm_mygroup inside
t_commrec got initialized in init_commrec (to MPI_COMM_WORLD
if no multisim, to a subset otherwise). These communicators
were then used in subsequent setup work, before they got
reassigned during the construction of the DDBuilder object
and the construction of the actual domain decomposition object.
Effectively, this means that the same communicators (and, hence,
identical function calls) do very different things depending on
whether they get used before or after the setup of domain
decomposition. It also means that before DD set up, mpi_comm_mysim
and mpi_comm_mygroup are *identical*.

This change introduces an additional communicator within
t_commrec, mpiDefaulCommunicator, which helps to make these
implicit assumptions explicit. Consequently, this also redefines
PAR(cr), MASTER(cr), and SIMMASTER(cr).

This change will allow to move the sim and group communicators,
which are now only created at DD time, into the DD object,
logically separating the DD object from t_commrec.

Refs #2395

3 years agoFix issues found with clang-tidy
Mark Abraham [Wed, 8 Jul 2020 14:00:40 +0000 (16:00 +0200)]
Fix issues found with clang-tidy

3 years agoUse signed arithmetic in enumeration helper
Kevin Boyd [Wed, 8 Jul 2020 13:44:30 +0000 (13:44 +0000)]
Use signed arithmetic in enumeration helper

With a signed enum and the unsigned step, implicit conversion to unsigned
could change the value in the subtraction operator. Note that errors could
also occur with negative results in pure unsigned operations.

A negative result isn't expected for increasing enumerators, but the boost
iterator implementation does an == comparison that invokes the diff operator
and compares it to 0, and this error actually occurs there in unit tests,
and is caught by UBSAN.

Added some SFINAE to disable accidental instantiation of non-enum
types - before C++ 20 std::underlying_type on a non-enum is undefined.

3 years agoEnforce unsigned type in flags.
Kevin Boyd [Wed, 8 Jul 2020 11:31:20 +0000 (11:31 +0000)]
Enforce unsigned type in flags.

Flag enums could be signed types - since the only operations performed
by the flags were bit ops, this was harmless, but the implicit signed/
unsigned conversions are caught in analysis tools like UBSAN that can
also catch real issues.

Added a compile-time enforcement of underlying unsigned type to the
flags class, and specified uint64_t for underlying type of the class
and the various flags that are passed to it.

Added some SFINAE to disable accidental instantiation of non-enum
types - before C++ 20 std::underlying_type on a non-enum is undefined.

3 years agoSeparate StatePropagatorData element
Pascal Merz [Wed, 8 Jul 2020 10:24:48 +0000 (10:24 +0000)]
Separate StatePropagatorData element

The StatePropagatorData was both holding data which is accessed by
a majority of the elements, and was an element itself. The element
part is needed to save state information for printout and checkpointing.
The double nature of StatePropagatorData created some difficulty in
initializing the elements, however - the StatePropagatorData
has a well defined place within the simulator loop, but has to be
created ahead of time so that other elements can get a pointer to it
to query for state data during the simulation run.

This change separates the ISimulatorElement implementation which
allows StatePropagatorData to take part in the simulation loop
into a member object. The StatePropagatorData can now be created
ahead of element construction time, while an object of the member
class can be created any time later. This will make the implementation
of a builder approach significantly easier.

Refs #3437

3 years agoMove finalising routine into mtop
Christian Blau [Tue, 7 Jul 2020 18:33:21 +0000 (18:33 +0000)]
Move finalising routine into mtop

Change-Id: I383ceb3b48e5eddafc3f8ea96fc3b326d34602ef

3 years agoMove densityfitting to its own directory
Paul Bauer [Tue, 7 Jul 2020 16:10:13 +0000 (16:10 +0000)]
Move densityfitting to its own directory

Preparing for adding more applied_forces modules

Change-Id: Ieec20d1f0752a369d26352ec6b0997812decd21e

3 years agoFix unsigned integer overflow bug in spline tables
Kevin Boyd [Tue, 7 Jul 2020 15:07:07 +0000 (15:07 +0000)]
Fix unsigned integer overflow bug in spline tables

Subtraction of two uints could lead to a huge positive rather than
a correct negative number. Found by UBSAN integer check (though
not technically undefined behavior)

3 years agoAdd stricter ASAN checks
Kevin Boyd [Sun, 5 Jul 2020 20:55:53 +0000 (13:55 -0700)]
Add stricter ASAN checks

ASAN supports some checks that are turned off by default. Enabling
these adds ~30-40% overhead.

3 years agoAnnotate modular simulator headers with exposure level
Pascal Merz [Tue, 7 Jul 2020 10:46:53 +0000 (10:46 +0000)]
Annotate modular simulator headers with exposure level

This change adds comments to the doxygen commen on top of each header file
to describe which files are exposed outside the modular simulator module.

3 years agoMake cl_nbparam into a struct
Artem Zhmurov [Tue, 7 Jul 2020 09:50:45 +0000 (09:50 +0000)]
Make cl_nbparam into a struct

This is needed to unify with CUDA path

3 years agoMove foreign potential energy accumulation
Berk Hess [Mon, 6 Jul 2020 15:14:31 +0000 (15:14 +0000)]
Move foreign potential energy accumulation

The potential energy contributions to the foreign lambda
Hamiltonian differences were summed in sum_dhdl() which meant
that the foreign energy differences were not complete when
do_force() returns. Now there are summed in
accumulatePotentialEnergies() which is called instead of sum_epot().

Also consistently changed the lambda vector to ArrayRef in the force
routines and made it const.

3 years agoModernize STL usage
Roland Schulz [Mon, 6 Jul 2020 14:19:37 +0000 (14:19 +0000)]
Modernize STL usage

3 years agoAvoid overflow in RNG
Kevin Boyd [Mon, 6 Jul 2020 01:37:21 +0000 (18:37 -0700)]
Avoid overflow in RNG

Instead of checking for overflow, get necessary information about
number of bits from type attributes.

This technically wasn't undefined behavior but with strict UBSAN
settings got tagged in tests.

3 years agoFix cycle counters for "comm.coord" and "Wait + Comm. F" to support GPU halo exchange...
Gaurav Garg [Mon, 22 Jun 2020 16:31:13 +0000 (22:01 +0530)]
Fix cycle counters for "comm.coord" and "Wait + Comm. F" to support GPU halo exchange path
Replace buffer ops counters with GPU launch counters for GPU backend.

3 years agoUse vector in atoms2md instead of pointer
Joe Jordan [Fri, 3 Jul 2020 09:55:37 +0000 (09:55 +0000)]
Use vector in atoms2md instead of pointer

At all call sites for atoms2md the underlying vector was cast to an int pointer.
This change makes it easier to inspect the values passed to atoms2md in a
debugger while incurring no performance penalty.

3 years agoSeparate ModularSimulator and ModularSimulatorAlgorithm
Pascal Merz [Fri, 3 Jul 2020 08:02:09 +0000 (08:02 +0000)]
Separate ModularSimulator and ModularSimulatorAlgorithm

This introduces the ModularSimulatorAlgorithm, which takes over some
responsibilities from ModularSimulator. The ModularSimulatorAlgorithm
owns the elements, and allows ModularSimulator to run a simulation
following the prescribed algorithm. This change is only refactoring -
no functionality is added or removed, but separating the algorithm and
its builder from the simulator allows to develop the two independently.

The ModularSimulatorAlgorithm is built by ModularSimulatorAlgorithmBuilder.
In a first approach, ModularSimulatorAlgorithmBuilder creates an appropriate
algorithm based on the input passed from the runner level (md or md-vv, thermo-
and / or barostat, constraining, FEP, etc).

Eventually, the builder will not need to know about all possible algorithms,
but offer an interface for its user to creat algorithms. Currently, the only
planned user of the ModularSimulatorAlgorithm is the ModularSimulator itself.
In view of this, two "hacks" were used to reduce unnecessary line changes
to simplify review: The builder mirrors all protected members of ISimulator,
and some of its member function implementations were left in modularsimulator.cpp.
Note that both of these "hacks" will disappear in subsequent changes.

Refs #3437

3 years agoCoordinate transformation on single RVecs
Christian Blau [Mon, 17 Feb 2020 15:22:36 +0000 (16:22 +0100)]
Coordinate transformation on single RVecs

So far, coordinate transforamtions of TranslateAndScale and Scale
classes could only performed on ArrayRefs. This meant that
transformations of single RVecs had to be done by first constructing an
ArrayRef on a single RVec x with the unintuitive and cumbersome
transform({&x,&x+1}).

Now this call is reduced to transform(&x) and respective calls.

Change-Id: I0d1f9d2f5ba90a46b1afc9b617af606995e0df59

3 years agoSimplify Iterators
Roland Schulz [Wed, 1 Jul 2020 16:27:30 +0000 (16:27 +0000)]
Simplify Iterators

3 years agoRevert "Make everything run on Gitlab infrastructure."
Paul Bauer [Tue, 30 Jun 2020 14:30:04 +0000 (16:30 +0200)]
Revert "Make everything run on Gitlab infrastructure."

This reverts commit af3b2782f26d6bde2975a581de7b3fc8bf69b954.

3 years agoUpdated the change management documentation
Christian Blau [Wed, 1 Jul 2020 14:29:05 +0000 (14:29 +0000)]
Updated the change management documentation

Describe how to upload and review code on gitlab.
Introduce merge-requests and approvals.

3 years agoClean up simulatorbuilder.h
M. Eric Irrgang [Wed, 1 Jul 2020 11:44:24 +0000 (11:44 +0000)]
Clean up simulatorbuilder.h

Sort forward declarations to improve readability.
Reduce unnecessary `#include`s.

3 years agoDisable failing builds for master branch
Paul Bauer [Wed, 1 Jul 2020 08:45:02 +0000 (10:45 +0200)]
Disable failing builds for master branch

Change builds that use failing docker containers

Changes builds away from the
gromacs/cmake-3.15.7-gcc-8-cuda-10.1-nvidiaopencl-clfft-openmpi:master
and gromacs/cmake-3.15.7-llvm-8-cuda-10.1-openmpi:master images
that have failed over the recent days.

For now set to use
gromacs/cmake-3.13.0-gcc-7-amdopencl-clfft-openmpi:master
and gromacs/cmake-3.15.7-llvm-9-openmpi:master images.

Change-Id: I92ad04c65021005345668262be1eccecb149a694

3 years agoMake everything run on Gitlab infrastructure.
Paul Bauer [Mon, 29 Jun 2020 20:18:36 +0000 (20:18 +0000)]
Make everything run on Gitlab infrastructure.

Change-Id: I0cfbc2e287641d9f9e9e1cf3a54c9237a6d6c8e2

3 years agoAdd missing ABI header.
M. Eric Irrgang [Fri, 26 Jun 2020 15:41:21 +0000 (18:41 +0300)]
Add missing ABI header.

simulatorbuilder.cpp did not include "gmxpre.h"

3 years agoIncrease BD ulp tolerance to avoid spurious test failures
ejjordan [Fri, 26 Jun 2020 11:53:03 +0000 (13:53 +0200)]
Increase BD ulp tolerance to avoid spurious test failures

3 years agoChange ArrayRef to use a proper iterator
Roland Schulz [Fri, 26 Jun 2020 16:03:46 +0000 (16:03 +0000)]
Change ArrayRef to use a proper iterator

Fixes #2859

3 years agoMinor cleanup in gmx bar
Paul Bauer [Thu, 25 Jun 2020 17:06:28 +0000 (19:06 +0200)]
Minor cleanup in gmx bar

Just to make static analyser happy in dependent change.

Change-Id: I3e590b8ee7e6fa81ed334556dec86c2f7e7f4425

3 years agoImplement SimulatorBuilder.add() for BoxDeformationHandle.
M. Eric Irrgang [Thu, 23 Apr 2020 15:34:32 +0000 (18:34 +0300)]
Implement SimulatorBuilder.add() for BoxDeformationHandle.

Refs #3567

3 years agoUse TopologyData.
M. Eric Irrgang [Thu, 23 Apr 2020 15:16:21 +0000 (18:16 +0300)]
Use TopologyData.

Refs #3567

3 years agoUse IonSwapping parameter.
M. Eric Irrgang [Thu, 25 Jun 2020 12:03:27 +0000 (15:03 +0300)]
Use IonSwapping parameter.

Refs #3567

3 years agoUse CenterOfMassPulling
M. Eric Irrgang [Thu, 23 Apr 2020 15:06:30 +0000 (18:06 +0300)]
Use CenterOfMassPulling

Refs #3567

3 years agoUse ReplicaExchange member instead of build() argument.
M. Eric Irrgang [Thu, 23 Apr 2020 15:03:05 +0000 (18:03 +0300)]
Use ReplicaExchange member instead of build() argument.

Refs #3567

3 years agoUse SimulatorModules parameter.
M. Eric Irrgang [Thu, 23 Apr 2020 14:58:11 +0000 (17:58 +0300)]
Use SimulatorModules parameter.

Refs #3567

3 years agoUse InteractiveMD SimulatorBuilder parameter.
M. Eric Irrgang [Thu, 23 Apr 2020 14:54:19 +0000 (17:54 +0300)]
Use InteractiveMD SimulatorBuilder parameter.

Refs #3567

3 years agoUse LegacyInput.
M. Eric Irrgang [Thu, 23 Apr 2020 14:52:08 +0000 (17:52 +0300)]
Use LegacyInput.

Refs #3567

3 years agoUse ConstraintsParam.
M. Eric Irrgang [Thu, 23 Apr 2020 14:37:02 +0000 (17:37 +0300)]
Use ConstraintsParam.

Refs #3567

3 years agoMove Profiling parameter out of simulatorbuilder.build()
M. Eric Irrgang [Thu, 23 Apr 2020 14:29:25 +0000 (17:29 +0300)]
Move Profiling parameter out of simulatorbuilder.build()

Refs #3567

3 years agoUse SimulatorEnv
M. Eric Irrgang [Thu, 23 Apr 2020 14:21:51 +0000 (17:21 +0300)]
Use SimulatorEnv

Refs #3567

3 years agoImplement remaining SimulatorBuilder.add() methods.
M. Eric Irrgang [Thu, 23 Apr 2020 13:22:03 +0000 (16:22 +0300)]
Implement remaining SimulatorBuilder.add() methods.

Refs #3567

3 years agoInterface for remaining SimulatorBuilder.add() methods.
M. Eric Irrgang [Thu, 23 Apr 2020 13:03:20 +0000 (16:03 +0300)]
Interface for remaining SimulatorBuilder.add() methods.

Refs #3567

3 years agoCompletely encapsulate membed logic in MembedHolder
ejjordan [Thu, 23 Apr 2020 09:08:50 +0000 (12:08 +0300)]
Completely encapsulate membed logic in MembedHolder

Refs #3567

3 years agoMake holder for simulation configuration
Artem Zhmurov [Tue, 21 Apr 2020 14:30:03 +0000 (17:30 +0300)]
Make holder for simulation configuration

Make a class that holds values of:

useModularSimulator
mdrunOptions
startingBehavior
doRerun
runScheduleWork

inside the SimulatorBuilder.

Refs #3567

3 years agoUse SimulatorStateData.
Prashanth Kanduri [Mon, 22 Jun 2020 14:59:57 +0000 (17:59 +0300)]
Use SimulatorStateData.

Implement `SimulatorBuilder.add(SimulatorStateData&&)`

Refs #3567

3 years agoAdd MembedHolder for SimulatorBuilder.
ejjordan [Tue, 21 Apr 2020 14:23:38 +0000 (17:23 +0300)]
Add MembedHolder for SimulatorBuilder.

Implement SimulatorBuilder.add(MembedHolder&&)

Refs #3567

3 years agoSimulatorBuilder.add() for StopHandlerBuilder.
M. Eric Irrgang [Mon, 22 Jun 2020 13:27:52 +0000 (16:27 +0300)]
SimulatorBuilder.add() for StopHandlerBuilder.

Refs #3567

3 years agoImplement SimulatorBuilder.build()
M. Eric Irrgang [Tue, 21 Apr 2020 10:46:46 +0000 (13:46 +0300)]
Implement SimulatorBuilder.build()

Explicitly define the build() and its signature
so that we can start to refine the interface.

Refs #3567

3 years agoMKL NULL->nullptr and remove dead code
Roland Schulz [Fri, 26 Jun 2020 06:39:58 +0000 (23:39 -0700)]
MKL NULL->nullptr and remove dead code

3 years agoMove dispersion correction call to do_force()
Berk Hess [Fri, 26 Jun 2020 08:30:32 +0000 (08:30 +0000)]
Move dispersion correction call to do_force()

The call to dispersion correction was in compute_globals(), which
should only compute globals, not compute energies. Moving the call
to do_force() simplifies the logic, as correcting the virial before
computing the pressure removes the need to correct the pressure.

3 years agoRestored the comment
Mark Abraham [Thu, 25 Jun 2020 16:29:01 +0000 (16:29 +0000)]
Restored the comment

We can keep the comment in its most useful form while avoiding the warning.

3 years agoMake cl_nbparam into a struct
Artem Zhmurov [Thu, 25 Jun 2020 15:31:36 +0000 (15:31 +0000)]
Make cl_nbparam into a struct

This is needed to unify with CUDA path

3 years agoFix warning about needing config.h
Paul Bauer [Wed, 24 Jun 2020 11:43:29 +0000 (13:43 +0200)]
Fix warning about needing config.h

A comment would lead to the warning in the check source build.

Change-Id: Iacfc2f97827b31feb674b3c53bd2c4eff065a859

3 years agoAdd class ListedForces
Berk Hess [Wed, 24 Jun 2020 17:35:16 +0000 (17:35 +0000)]
Add class ListedForces

Gather all data that is only used for the listed force calculation
in a new class called ListedForces. This is a first step in
refactoring, more parameters to the listed forces calculation can
be moved into class.
Also converted bonded_threading_t, t_fcdata and bondedtable_t to C++.
Made listed_threading.h internal to the listed_forces module.

This change is only refactoring.

3 years agoChange grompp disres cost to linear
Berk Hess [Tue, 23 Jun 2020 19:53:11 +0000 (21:53 +0200)]
Change grompp disres cost to linear

The cost of adding distance restraints (actually their parameters)
was quadratic in the number of restraints and has now been changed
to linear.

Fixes #3457

3 years agoFix OpenCL install
Roland Schulz [Wed, 24 Jun 2020 07:06:20 +0000 (00:06 -0700)]
Fix OpenCL install

9b3fb3b5ffdb77f223e9ed949508905284bfe3f3 moved the include of
gmxManageOpenCL.cmake after setting of GMX_INSTALL_GMXDATADIR.
But GMX_INSTALL_GMXDATADIR is used in there to set GMX_INSTALL_OCLDIR.

3 years agoFix minor nit-picks
Artem Zhmurov [Wed, 24 Jun 2020 10:26:11 +0000 (10:26 +0000)]
Fix minor nit-picks

1. Make the array with device status names static.
2. Expilcitely list integers in enumeration.

3 years agoFix clFFT build without GMX_LOAD_PLUGINS
Roland Schulz [Tue, 23 Jun 2020 21:53:29 +0000 (14:53 -0700)]
Fix clFFT build without GMX_LOAD_PLUGINS

It only happened to work before 649af69b44d503 because
GMX_LOAD_PLUGINS was on by default and it added the
required dl library.
Also fixes that we reuse the same code for checking for
dlopen.

3 years agoDon't print pygments error
Roland Schulz [Tue, 23 Jun 2020 21:45:04 +0000 (14:45 -0700)]
Don't print pygments error

Find modules shouldn't print tool errors to the cmake output.
These errors can be confusing because it is unclear whether
the error text applies to cmake or something else. Those
errors should go to log files. In this case logging doesn't
seem necessary. We didn't report the error until
b277931fcf4bc. And that commit claims to just fix a bug and
not increase verbosity. Therefore it was likely an
accidental change.

3 years agoRefactor simulator comparison tests
Pascal Merz [Thu, 23 Jan 2020 14:00:09 +0000 (15:00 +0100)]
Refactor simulator comparison tests

The rerun test and the simulator comparison test share some
infrastructure. The scope of shared functionality was chosen
a bit too broadly, making reuse for other similar tests difficult.
This change makes the shared functionality more granular, allowing
to reuse this functionality more broadly and increasing the
readability, at the expense of some minor code duplication.

3 years agoWIP: Finish removing compile_cpp_as_cuda
Mark Abraham [Tue, 23 Jun 2020 15:36:20 +0000 (15:36 +0000)]
WIP: Finish removing compile_cpp_as_cuda

The definition can now be removed, and a comment updated.

Test code can use the same approach where needed.

3 years agoRemove some headers from install targets
Joe Jordan [Tue, 23 Jun 2020 14:20:15 +0000 (14:20 +0000)]
Remove some headers from install targets

There are valid use cases for including gromacs exceptions in the
installed headers, such as packages wanting to utilize gromacs
testing features. However, class_helpers.h does not provide
enough benefit over just satisfying the rule of 5 to warrant
exposure in installed headers. This change removes the need for
class_helpers.h as well as the, apparently unused,
current_function.h from the installed headers.

3 years agoAdd virtual site with one constructing atom
Berk Hess [Tue, 23 Jun 2020 12:54:12 +0000 (12:54 +0000)]
Add virtual site with one constructing atom

Also fixed the order of the function type update table in tpxio.cpp.

3 years ago[WIP] Run regression tests under ASAN
Kevin Boyd [Tue, 23 Jun 2020 09:57:40 +0000 (09:57 +0000)]
[WIP] Run regression tests under ASAN

Suppression gets regression tests passing for complex, free energy,
rotation.

TODO - essential dynamics does not work for non-leak reasons, issues
in perl script

3 years agoRemove DeviceStream include from GPU traits
Artem Zhmurov [Fri, 19 Jun 2020 13:59:34 +0000 (15:59 +0200)]
Remove DeviceStream include from GPU traits

GPU traits no longer use DeviceStream directly, so it should not be
included there.

3 years agoReformat pairs.cpp
M. Eric Irrgang [Mon, 22 Jun 2020 12:59:00 +0000 (15:59 +0300)]
Reformat pairs.cpp

Resolve clang-format error.

3 years agoUse Gromacs::gmx target to hint gmxapi tests.
M. Eric Irrgang [Tue, 16 Jun 2020 12:40:12 +0000 (15:40 +0300)]
Use Gromacs::gmx target to hint gmxapi tests.

Import Gromacs::gmx CMake target from GROMACS package to get binary
install directory and executable name for a new gmxapi resource file.

Encapsulate gmxcli test fixture into module variable. Perform gmx
command discovery only at module import.

Refs #2961

3 years agoMove soft-core parameters to interaction_const_t
Berk Hess [Mon, 22 Jun 2020 10:56:00 +0000 (10:56 +0000)]
Move soft-core parameters to interaction_const_t

The soft-core free-energy parameters for use in the kernels have been
put in a separate struct called SoftCoreParameters
and have been moved from t_forcerec to interaction_const_t.

3 years agoRemove workaround for gcc bug 58265.
M. Eric Irrgang [Fri, 19 Jun 2020 09:18:27 +0000 (12:18 +0300)]
Remove workaround for gcc bug 58265.

Fixes #3041

3 years agoModular simulator: Separate trajectory element and signaller
Pascal Merz [Thu, 18 Jun 2020 18:53:59 +0000 (18:53 +0000)]
Modular simulator: Separate trajectory element and signaller

The trajectory element implemented both the ISimulatorElement and
the ISignaller interface. It was both signalling its clients that a
trajectory writing step was about to occur during task list creation,
and actually performing trajectory writing during the simulation.

In general, the tasks of signallers and elements, their call site in
the code, and their build and ownership procedures are all significantly
different. The dual nature of the trajectory element makes this
differentiation less clear, and requires some workarounds. Additionally,
separating the trajectory element in separate element and a signaller
requires no changes on client side, since all clients of the trajectory
element with integrated signaller already implemented two interfaces,
ITrajectorySignallerClient and ITrajectoryWriterClient.

The current change hence splits the current trajectory element into
a pure element and a pure signaller. This will make subsequent changes,
especially the introduction of a builder approach much easier. It also
removes support for combined elements and signallers: It renames the setup
method of the ISignaller interface from `signallerSetup` to `setup`, as
this differentiation was only used for classes implementing both element
and signaller interfaces. It also simplifies the handling of signallers
in ModularSimulator, as having a separate ownership and call list is not
needed anymore.

Refs #3437

3 years agoFix missing #include <string>
Paul Bauer [Wed, 17 Jun 2020 16:13:34 +0000 (18:13 +0200)]
Fix missing #include <string>

Only showed up in MSVC 2019 builds.

Fixes #3559

Change-Id: Ie5162ff6d922d7dbd8e7fd867327f68de1c8b682

3 years agocmake: export gmx target
Christoph Junghans [Thu, 18 Jun 2020 12:03:23 +0000 (12:03 +0000)]
cmake: export gmx target

3 years agoConvert t_forcetable to C++
Berk Hess [Wed, 17 Jun 2020 21:28:59 +0000 (23:28 +0200)]
Convert t_forcetable to C++

Also forward declared t_nblist in nbnxm.h to reduce dependencies.

3 years agoSimplified uniform GPU selection in CMake
Erik Lindahl [Wed, 17 Jun 2020 18:25:20 +0000 (18:25 +0000)]
Simplified uniform GPU selection in CMake

GPU selection is now done by setting GMX_GPU to either CUDA
or OpenCL, with no other variables required. As part of the
overall CMake simplification, the CMake automatic detection
of hardware and "auto" settings for GPU acceleration have
been removed. This will require the user to explicitly enable
GPU support (which is a drawback), but it leads to much
simplier and shorter CMake code, similar support for CUDA and
OpenCL, and it will make it easier to handle multiple different
APIs targeting e.g. NVIDIA GPU hardware in the near future.

3 years agoFix style errors in modular simulator propagator
Pascal Merz [Wed, 20 May 2020 07:03:30 +0000 (01:03 -0600)]
Fix style errors in modular simulator propagator

Some member variables of the Propagator class were missing the trailing
underscore. This also changes the initialization of a vector and a
matrix to list initialization, which used to throw off uncrustify.

3 years agoImprove pytest output handling.
M. Eric Irrgang [Fri, 12 Jun 2020 12:34:13 +0000 (15:34 +0300)]
Improve pytest output handling.

Reduce default pytest output verbosity.

Explicitly create only one output file when running under MPI.

Fixes #3553

3 years agoReplace trivalue options with plain booleans
Erik Lindahl [Mon, 15 Jun 2020 09:21:48 +0000 (09:21 +0000)]
Replace trivalue options with plain booleans

Our CMake auto-detection has been a long discussion since
it both complicates the CMake code and leads to complex
interactions when multiple auto-settings interact with
each other, and when/how things can change.

This is a first step towards removing such auto settings,
by altering "nice to have, but not required" to "off" by
default (GMX_BUILD_HELP, GMX_HWLOC).

The option GMX_LOAD_PLUGINS was on by default, and
the build generates errors if it's turned off, so for now
I set it to "on", and will adress the compile error when
it's disabled in a separate change.

With these changes, the trivalue options are no more.

3 years agoReplace compile_cpp_as_cuda(...) with CUDA runtime header inclusion
Artem Zhmurov [Fri, 12 Jun 2020 08:12:17 +0000 (08:12 +0000)]
Replace compile_cpp_as_cuda(...) with CUDA runtime header inclusion

To make CUDA-specific tipes visible, one should either use CUDA compiler
for the files where they are exposed, or include the CUDA runtime header
for the normal compiler. This changes first approach to the second.