alexxy/gromacs.git
4 years agoSeparate CPU NB kernel and buffer clearing subcounters
Szilárd Páll [Mon, 13 Nov 2017 22:54:21 +0000 (23:54 +0100)]
Separate CPU NB kernel and buffer clearing subcounters

This is aimed to allow comparing the performance of the pair-interaction
kernels separately from the force buffer clearing.

Change-Id: Ifb2b4b3e5a43ac2ee547da651f9432a22fe58421

4 years agoAdd copy and move operations to density similarity
Christian Blau [Wed, 19 Jun 2019 11:35:18 +0000 (13:35 +0200)]
Add copy and move operations to density similarity

Enable copying and moving for DensitySimilarityMeasure.

Change-Id: Ie4250f67ae42b5cea227b7c17b0a932b04a42a63

4 years agoFused GPU bonded kernels
Magnus Lundborg [Thu, 23 May 2019 14:39:50 +0000 (16:39 +0200)]
Fused GPU bonded kernels

To reduce the GPU kernel launch times the
GPU bonded kernels have been fused to a single kernel.

Refs #2818

Change-Id: I2299e1857df5db469739e3aefbc0f771968a6bd5

4 years agoAdd class to look up density fitting amplitudes
Christian Blau [Fri, 31 May 2019 06:30:39 +0000 (08:30 +0200)]
Add class to look up density fitting amplitudes

Adds a look-up for the weight used for spreading atoms on a grid and
calculate forces on them.

refs #2282

Change-Id: Iadd26f04265aa85ad30a827c92f2c5d5fc48ef85

4 years agoRemove already resolved post-submit matrix TODO
Szilárd Páll [Thu, 27 Jun 2019 12:35:53 +0000 (14:35 +0200)]
Remove already resolved post-submit matrix TODO

Change-Id: I4b4f8c81376ac36c141e27fd6a3301f550968d1a

4 years agoUse random water removal in gmx solvate
Kevin Boyd [Thu, 27 Jun 2019 01:57:48 +0000 (21:57 -0400)]
Use random water removal in gmx solvate

Given a number of solvent molecules to remove, gmx solvate
previously used a striding selection. This patch addresses a
TODO to use random selection

Change-Id: Icb065d61349a55b816337fa49470050eac194aa9

4 years agoAdd helpful note about gmxpai docker notebook server.
M. Eric Irrgang [Mon, 24 Jun 2019 10:11:15 +0000 (13:11 +0300)]
Add helpful note about gmxpai docker notebook server.

Per Joe's comment on https://gerrit.gromacs.org/c/gromacs/+/11502, it
was not clear where the notebook files live or how they may / may not
change. An extra snippet in the README.md may be helpful.

Change-Id: Ifd7b68ebf58fb3f2c3bed50f3267980358ffc047

4 years agoRemove tabulation from free-energy kernel
Berk Hess [Wed, 26 Jun 2019 15:44:21 +0000 (17:44 +0200)]
Remove tabulation from free-energy kernel

The recent group scheme removal cleanup forgot to remove the cubic
spline tabulated Coulomb and VdW interaction. This is done now.
Also removed the switches in the inner loops, as now there are only
two types of Coulomb and LJ interaction functional forms left.

Change-Id: Ia4aa8917077a3e48c7f1f055f171698a4fede8d0

4 years agoOnly use AVX512 in own-FFTW if GROMACS also uses it
Szilárd Páll [Thu, 20 Jun 2019 17:18:23 +0000 (19:18 +0200)]
Only use AVX512 in own-FFTW if GROMACS also uses it

Building the own FFTW with AVX512 enabled for all AVX-flavors means that
an AVX2 build can end up loosing a significant amount of performance due
to clock throttle if the FFTW auto-tuner inadvertently picks and AVX512
kernel. This is not unlikely as measurements at startup are very noisy
and often lead to inconsistent kernel choice (observed in practice).

Change-Id: I857326a13a7c4dd1a6f5ab44360211301b05d3ac

4 years agoMake global topology constant in trajectory writing
Pascal Merz [Wed, 12 Jun 2019 17:22:12 +0000 (11:22 -0600)]
Make global topology constant in trajectory writing

Added a few trivial const qualifiers to make the global topology
const in the call to do_md_trajectory_writing(...).

Change-Id: Id9a501a37bafb4ac25ef6157429d6fb5cb1ff098

4 years agoAdd a docker layer with a jupyter notebook server.
M. Eric Irrgang [Wed, 12 Jun 2019 10:47:28 +0000 (13:47 +0300)]
Add a docker layer with a jupyter notebook server.

Provide a docker image based on the gmxapi/ci-mpich image that runs a
Jupyter notebook server for easier browsing of the gmxapi Python package
artifacts.

Change-Id: I245bccb0522bd7c1e4e7467e10e2e91f09976f25

4 years agoUse ISerializer for TPR file IO
Paul Bauer [Wed, 5 Jun 2019 13:18:34 +0000 (15:18 +0200)]
Use ISerializer for TPR file IO

Change all the function calls in do_tpx and friends to use the
ISerializer instead of the previous t_fileio pointer.
This is intended to prepare for the change where the datastructures
get populated from a byte buffer instead of reading them from disk one
by one.

Refs #2971

Change-Id: I9c2d51c4af0cad5a14da7026d58ecbe053e8efb7

4 years agoAdd coordinate scaling class and extend TranslateAndScale
Christian Blau [Fri, 31 May 2019 06:25:03 +0000 (08:25 +0200)]
Add coordinate scaling class and extend TranslateAndScale

 - Make TranslateAndScale copyable and movable.
 - Make coordinate transformation application const on the
TranslateAndScale object itself
 - Add a function that returns the scale operation only without translation.
 - Add a coordinate scaling class that also allows to inverse the scaling, ignoring zero input.

refs #2282

Change-Id: I73f9bd892f1f81692e05ac6b2fece2e7be9e8e69

4 years agoAllow non-uniform Gaussians
Christian Blau [Fri, 31 May 2019 06:19:52 +0000 (08:19 +0200)]
Allow non-uniform Gaussians

For three-dimensional Gaussian spreading, as well as density guided force
evaluation, allow spreading with different widths along x, y, and z-direction.

This required to account for the common, slightly non-uniform grid
spacing in input densities.

Added some simplifactions for the vector operations based on newly
implemented functions in for BasicVector in a previous patch.

refs #2282

Change-Id: I730897fe672d2444a04ea68fea83e2273b359b27

4 years agoRemove unnecessary #if GMX_MPI in pme code
Berk Hess [Wed, 19 Jun 2019 07:46:19 +0000 (09:46 +0200)]
Remove unnecessary #if GMX_MPI in pme code

Change-Id: I1c645c84b229258527d4c40edb055a706189c2bf

4 years agoTemplate free-energy kernel on soft-core
Berk Hess [Wed, 19 Jun 2019 09:33:05 +0000 (11:33 +0200)]
Template free-energy kernel on soft-core

Templated the free-energy kernel on the presence of soft-core
and the soft-core r-power.
Not doing the soft-core math when not using soft-core doubles
the speed of the free-energy kernel.
Templating for the soft-core power gives 15% performance improvement
with soft-core power 6.
Double precision r variables are only needed with r-power 48.

Change-Id: I5a37307b2a83304a40343a0708afce46f4bdcf75

4 years agoAdd BasicVector scaling, max, min and toIvec
Christian Blau [Wed, 19 Jun 2019 13:00:12 +0000 (15:00 +0200)]
Add BasicVector scaling, max, min and toIvec

Allows element-wise multiplication, maximum, minimum evaluation
as well as conversion to IVec.

Change-Id: I49ba61aff72b197dbe3a67a9516ae0924d28c786

4 years agoRefactor PME atom handling
Berk Hess [Wed, 15 May 2019 11:04:44 +0000 (13:04 +0200)]
Refactor PME atom handling

Converted pme_atomcomm_t to PmeAtomComm class.
The PME atom count on CPU without separate PME ranks is now set by
gmx_pme_reinit_atoms(), as for PME on GPU.
Made all coordinates in PME const and use arrayref where possible.

Change-Id: Iaeb59f8cee910e4c52f2f59016af85662b2109fb

4 years agoSplit tpr header reading reading from tpr body
Paul Bauer [Tue, 11 Jun 2019 09:20:28 +0000 (11:20 +0200)]
Split tpr header reading reading from tpr body

Split the low level functions for TPR file header and file body reading
into fully separate parts to allow reading the main part of the file
without having to read the header again.

Also gave the header datastructure a new name in line with naming
conventions and default initialized all fields.

Refs #2971

Change-Id: I110fb80cf19d9d2e59df1576e50c64806f532e00

4 years agoRemoved unused code paths in the NB FE kernel
Berk Hess [Wed, 19 Jun 2019 08:29:55 +0000 (10:29 +0200)]
Removed unused code paths in the NB FE kernel

Code paths that were only used with the group scheme were removed.

Change-Id: I27175abfad5da9948f0626af90d16e7801eaf19d

4 years agoUpdates to gmxapi docker entry points.
M. Eric Irrgang [Tue, 2 Apr 2019 16:41:50 +0000 (19:41 +0300)]
Updates to gmxapi docker entry points.

* Read GMXRC in gmxapi docker test environment. Allows `gmx` binary to
  be easily discovered by Python wrappers. Supports expected behavior
  for gmxapi/ci-... docker containers and ensures that GROMACS
  components available during image build are available when running.
* Allow more granular testing. Rename and reorganize entry points for
  the docker test containers.

Ref: #2756

Change-Id: I5e781fae4709e4ccb718a8295c3fbe68dd59de44

4 years agoFix gmx dump
Paul Bauer [Wed, 12 Jun 2019 09:39:33 +0000 (11:39 +0200)]
Fix gmx dump

The program would fail because the filename for writing the output mdp
file was passed as valid empty string that could not be opened as an
output file.

Now only passes the string when it is not empty.

Added test and fixed possible floating point exception found by the
test.

Change-Id: I8b18fbc0dfc5642399935f32fb0b1999fad44c98

4 years agoMove code handling mdrun -gpu_id to taskassignment module
Mark Abraham [Mon, 20 May 2019 08:28:28 +0000 (10:28 +0200)]
Move code handling mdrun -gpu_id to taskassignment module

Also made the error message report all incompatible GPU IDs, not just
the first, and do so by throwing an exception.

Change-Id: I4e1f26a59903077b5ab6cc671486fb059cb78964

4 years agoMake forcerec const in dispatchNonbondedKernel()
Berk Hess [Tue, 18 Jun 2019 08:28:19 +0000 (10:28 +0200)]
Make forcerec const in dispatchNonbondedKernel()

Changed forcrecin Nbnxm::dispatchNonbondedKernel() from a pointer
to a const reference. The GPU emulation kernel now writes the shift
forces to nbnxn_atomdata_t.

Change-Id: I170165529ba447db9b5d1824eea10675ae1bef7d

4 years agoMrc format header to lattice coordinate transform
Christian Blau [Fri, 3 May 2019 10:21:32 +0000 (12:21 +0200)]
Mrc format header to lattice coordinate transform

Extracts a coordinate transformation into lattice coordinates from the mrc density
header, as well as the three dimensional grid extents.

refs #2282

Change-Id: I8c01a370e3010add29b8810e2f3320b9ab428c02

4 years agoDensity similarity measure and gradient
Christian Blau [Wed, 17 Apr 2019 11:43:52 +0000 (13:43 +0200)]
Density similarity measure and gradient

Adding a class that allows evaluating the similarity of three dimensional
densities and their gradient given a comparison method, along with a
concrete implementation of the inner-product as a comparison method.

refs #2282

Change-Id: Id73f237e123bed14241227b84cbf83970a09ff49

4 years agoExtend ISerializer functionality
Paul Bauer [Mon, 10 Jun 2019 07:54:06 +0000 (09:54 +0200)]
Extend ISerializer functionality

Add datatypes to ISerializer that are needed to read TPR files but were
missing.

Refs #2971

Change-Id: I5d5e7f1f91c533a079cb287b018fa1d579c4f3f9

4 years agoCombine CUDA Leap-Frog, LINCS and SETTLE. I.
Artem Zhmurov [Mon, 18 Mar 2019 18:03:59 +0000 (19:03 +0100)]
Combine CUDA Leap-Frog, LINCS and SETTLE. I.

This is the first step in combining constraints and integrator
into "UpdateAndConstraints" module. The initial merge does not
imply any performance optimisation or code clean-up. Hence, this
patch keeps all the temporary infrastructure that was built
around SETTLE, LINCS and Leap-Frog to allow them to function as
a separate units. In the following commits, this infrastructure
will be removed and these three implementations will be more closely
integrated. To enable, set GMX_UPDATE_CONSTRAIN_GPU environment
variable. Note, that environment variables GMX_LINCS_GPU,
GMX_SETTLE_GPU and GMX_INTEGRATE_GPU will no longer work.

Refs #2816, #2888

Change-Id: I8730aad0ecaa0230686fe89d1157b0da2f01f7bc

4 years agoReduce docker image size for gmxapi CI.
M. Eric Irrgang [Wed, 12 Jun 2019 10:40:07 +0000 (13:40 +0300)]
Reduce docker image size for gmxapi CI.

Use ``--no-cache-dir`` option to ``pip install``.

Change-Id: I4c1794cc020096c3cee377ff2d79c6c599542bc1

4 years agoBug fix: Constraints tests are not instantiated with CUDA
Artem Zhmurov [Thu, 16 May 2019 08:06:06 +0000 (10:06 +0200)]
Bug fix: Constraints tests are not instantiated with CUDA

If the tests initialization macros is called with ValuesIn
function, the container provided should be filled. In the
current version, it is filled in the test SetUp function,
after the macros is processed. As a result, the empty
container is used in instantiation and no test are run.
Only CUDA-enabled builds are affected.

Change-Id: Ia2f38c9908d4b7d4277d282c01781b278eeeead0

4 years agoSimplify GPU nbnxm x conversion
Berk Hess [Fri, 7 Jun 2019 07:37:25 +0000 (09:37 +0200)]
Simplify GPU nbnxm x conversion

The GPU nbnxm x conversion change 42b343b9 lead to data being transferred
multiple times and introduced several ugly hacks. This change simplifies
the code and transfers each coordinate only once.

Change-Id: I430496251ae40ee4c604e3920b789b3ae2b297dd

4 years agoRemove unused nbnxm include files
Berk Hess [Mon, 17 Jun 2019 07:54:26 +0000 (09:54 +0200)]
Remove unused nbnxm include files

Change-Id: I04ca522139dfa7f1b809a2db9dd494ed9f0f0b23

4 years agoFix pygments detection for sphinx for docs build
Mark Abraham [Wed, 12 Jun 2019 15:39:08 +0000 (17:39 +0200)]
Fix pygments detection for sphinx for docs build

Got broken in 29616660 but somehow wasn't a problem in the docs build
on the dedicated slave for that.

Refs #2615

Change-Id: I407383bd0342decae56e4c60202ffbf190e8bb1b

4 years agoUse RAII approaches for hardware information detection
Mark Abraham [Tue, 21 May 2019 20:59:26 +0000 (22:59 +0200)]
Use RAII approaches for hardware information detection

Eliminated gmx_hardware_info_free. The lifetime of the hardware info
should be from the first time it is needed until the end of the
process, and in particular its ownership should not be related to the
lifetime of any threads implementing mdrun.

The implementation of gmx_detect_hardware now uses a simple mutex and
file static smart pointer to hold the data, lazily create it, and leave
it to process cleanup to call the destructor to free resources. Helper
functions no longer refer to the static smart pointer directly.

Internal data structures of gmx_hw_info_t are now held by smart pointer rather
than needing manual memory cleanup.

Extended not_null to be able to be created from smart pointers, and
tested the new behaviours.

Reduced the header dependencies of detecthardware.cpp, now that it
doesn't do all the string handling of printhardware.cpp

Change-Id: I9d5cd838dc6e214163cf2e3104e0f7aaa356fcf8

4 years agoClean up multisim, communication, and REMD code
Mark Abraham [Sun, 26 May 2019 22:00:46 +0000 (00:00 +0200)]
Clean up multisim, communication, and REMD code

Moved multisim declarations and code to one place.

Moved mpi_in_place_buf_t to its own files in a low-level module, and
made sure we tested a build that needed it. Removed duplicate tng
option declaration while I was there.

Moved a check for REMD to its code, removed another that was redundant
with that for multisim requiring more than one simulation.

Added some t_commrec and gmx_multisim_t cleanup code, but not all
of it can work before some more cleanup takes place.

Change-Id: Ie591f50a2162dce2e83552102f8633c8d49553a7

4 years agoMore quotes
Erik Lindahl [Sun, 9 Jun 2019 11:51:36 +0000 (13:51 +0200)]
More quotes

Having to prepare slides for a Gromacs workshop is
a great motivation for procrastination in the form
of adding more quotes :-)

Change-Id: Ieed151881f5eecdc552726f8d95541a2ab9b5eb7

5 years agoTemplate x buffer ops call on whether GPU is used
Szilárd Páll [Mon, 29 Apr 2019 10:02:32 +0000 (12:02 +0200)]
Template x buffer ops call on whether GPU is used

This allows the code to get optimized to avoid the overhead of merged
CPU and GPU codepaths.

Change-Id: If98c5eff327f5f9ecb81f278ca27b6d139bc19ab

5 years agoClean up renamed simulator.h file
Pascal Merz [Mon, 27 May 2019 04:42:47 +0000 (22:42 -0600)]
Clean up renamed simulator.h file

This change is a follow-up to I9bc31588, in which the Integrator class
was renamed to Simulator, and integrator.{h,cpp} was accordingly
renamed to simulator.{h,cpp}. The former change did, however, miss
the include guard, a typedef, and two mentions of "integrator" in
comments. The current change addresses this.

Change-Id: I14d55eeb35c18f198d4123a7132fbee2366713df

5 years agoRemove dependence of mdoutf_write_to_trajectory_files on global top
Pascal Merz [Sat, 25 May 2019 06:02:52 +0000 (00:02 -0600)]
Remove dependence of mdoutf_write_to_trajectory_files on global top

mdoutf_write_to_trajectory_files is currently taking the full global
topology object as input, but uses only the number of atoms. Removing
this dependency simplifies some refactoring further down the road,
as the new state element can use this function without needing
access to the global topology.

Change-Id: I3ad39050bfd5d7bb0792f3b158bad0817907e029

5 years agoRename Integrator class
Pascal Merz [Sat, 25 May 2019 05:44:47 +0000 (23:44 -0600)]
Rename Integrator class

This renames the `Integrator` class to `Simulator`, which does not
actually represent integrators, but rather types of simulations
(some of which contain an integrator, but not all!).

Refs #2943

Leaves the TODO to rename the corresponding mdp-option, but no
consensus on the new name has been reached yet.

Change-Id: I9bc3158856cd68dfc2ca5f3da793cd1ecbc2ffaf

5 years agoClarify which of the main energy terms are printed.
Artem Zhmurov [Wed, 24 Apr 2019 11:27:42 +0000 (13:27 +0200)]
Clarify which of the main energy terms are printed.

This is an attempt to clarify which of the main
energy terms are printed and which are not printed
from the EnergyOutput.

Change-Id: I8628026817c691add39d0332ddab5e372a2c3e96

5 years agoClarify the EnergyOutput III
Artem Zhmurov [Tue, 16 Apr 2019 14:40:35 +0000 (16:40 +0200)]
Clarify the EnergyOutput III

Making the EnergyOutput into the proper class. The t_mdebin structure
contents was made into the private fields of the object, prepare()
method was transformed into constructor. Legacy printing helper
functions merged into class methods.

Change-Id: Ia97650f8e74c6c08ee9735ba5e973c051b14784c

5 years agoClarify the EnergyOutput II
Artem Zhmurov [Wed, 3 Apr 2019 14:45:16 +0000 (16:45 +0200)]
Clarify the EnergyOutput II

The function that prints energy (and other thermodynamic values)
is now split into three: one that prints current values, one that
prinst averages at the end of the simulation run and one that prints
annealing temperatures. This way it is much clearer what is done at
each call and how many steps can be passed without calling one function
or another.

Change-Id: Ifc481fe3a5243917d0a290f1e3bec616b6ca6073

5 years agoReorder code before thread-MPI spawns threads
Mark Abraham [Thu, 23 May 2019 18:07:27 +0000 (20:07 +0200)]
Reorder code before thread-MPI spawns threads

gmx_check_thread_affinity_set was called before thread-MPI threads
were spawned, because originally that was necessary. But the intended
functionality is to provide feedback to users about whether thread
affinity was set by the OpenMP library or something else. Nothing else
uses the thread_affinity value in the meantime. So, it only needs to
be called just before OpenMP is initialized. The reordering makes
clear that some reduction code within this function only needs to run
with real MPI.

check_and_update_hw_opt_1 does modify hw_opt, but none of the relevant
variables were accessed in the preceding code, so the reordering is
safe. It now takes a boolean rather than a handle to t_commrec, which
decreases the code coupling and will shortly be useful. A check for
mdrun -ntmpi -npme has been moved into this routine.

check_and_update_hw_opt_2 only related to the group scheme and can
be removed.

The fatal error for group-scheme .tpr files can safely be moved
later, alongside other code specific to the Verlet scheme.

Reruns can safely clear the velocity vector later.

The log file makes a request to cite GROMACS papers, which is now
implemented in a simple function elsewhere.

Change-Id: I1e5990656c391da81aec215f86b94efc752002d4

5 years agoFix mulitple link refs in dev-manual
Szilárd Páll [Thu, 23 May 2019 17:30:26 +0000 (19:30 +0200)]
Fix mulitple link refs in dev-manual

Change-Id: I4e9c68d392c911fad227667b1d3f29bb54d024f1

5 years agoTeach ArrayRefWithPadding to make a const flavour
Mark Abraham [Wed, 15 May 2019 10:21:30 +0000 (12:21 +0200)]
Teach ArrayRefWithPadding to make a const flavour

Sometimes code that has a non-const view of padded memory needs to be
able to have a const view of that memory, e.g. to pass to a routine
that does not need to be able to modify. Now there is a member
function to do that. Note that the private data means that it is not
easy to construct the const view from the non-const view, because they
are different instantiations of the same template, so formally are
different types. However there is now a convenience overloaded
constructor so that passing a non-const view to a function that takes
a const view will work.

Also fixed the swap member, which fortunately was unused.

Change-Id: I52095fe3b5d5dd24b86698da2a065c0fd1f3fb0b

5 years agoRewrite starting behavior
Mark Abraham [Fri, 10 May 2019 09:17:52 +0000 (11:17 +0200)]
Rewrite starting behavior

Several necessary checks were deferred until the time the checkpoint
was read, which made this feature hard to implement and
understand. Having moved the code, if it will not be possible to
append, we can tell the user immediately.

Fixed a bug where mdrun -append would start from the .tpr
configuration when the checkpoint file was missing.

Opening the logfile in the non-appending cases is now
closely associated with the logic for how the restart
works.

Refs #2804, #2375

Change-Id: I83a846958619e72ddc9a5e9bae49a9b71221ad24

5 years agoIntroduce tri-state enums for restarts
Mark Abraham [Fri, 10 May 2019 09:17:52 +0000 (11:17 +0200)]
Introduce tri-state enums for restarts

Both the user choice for appending and the decision about how to
implement a restart are good to express as a three-way enumeration of
mutually-exclusive possibilities, rather than booleans.

Checkpoint restarts also need to consider whether KE quantities
need to be recomputed, which is now stored in t_ekinstate alongside
the data from which it was computed.

Together, these eliminate the ContinuationOptions struct.

Several booleans in implementation objects were renamed to be
consistent with the StartingBehavior enumeration values, so that the
code is easier to understand.

Moved the call to handleRestart out of updateFromCommandLine now that
it no longer needed to be there.

Used namespaces for handlerestart.cpp

Refs #2804, #2375

Change-Id: I1128b94e947c6ef355a1b137b8978faa227ab1a0

5 years agoPin X buffer with DD and use proper abstraction in buffer ops
Alan Gray [Tue, 30 Apr 2019 10:18:03 +0000 (03:18 -0700)]
Pin X buffer with DD and use proper abstraction in buffer ops

This patch fixes an issue that the coordinate buffer was not being
pinned with DD, and replaces a raw cudaMemcpy call in the buffer ops
routine with proper abstraction through the copyToDeviceBuffer API.

Follow up to Gerrit change 9169
Implements part of #2934

Change-Id: I64aec66157ceb5eb04bcfd7cfe24b6ea5c18e4ae

5 years agoAdd support for Hygon Dhyana processor
Jinke Fan [Tue, 21 May 2019 03:33:17 +0000 (11:33 +0800)]
Add support for Hygon Dhyana processor

This change adds hardware detection and related task assignment
heuristics support for the Hygon Dhyana CPUs.

Chengdu Haiguang IC Design Co., Ltd (Hygon) is a Joint Venture
between AMD and Haiguang Information Technology Co.,Ltd., aims
at providing high performance x86 processor for China server
market. Its first generation processor codename is Dhyana, which
originates from AMD technology and shares most of the architecture
with AMD's family 17h, but with different CPU Vendor ID ("HygonGenuine")
/Family series number (Family 18h).

More details can be found on:
http://lkml.kernel.org/r/5ce86123a7b9dad925ac583d88d2f921040e859b.1538583282.git.puwen@hygon.cn

Change-Id: Ic91b032e69dfc13abad3fbfe6ab5e4f0e57fc7c0

5 years agoCode quality improvements for CUDA position buffer ops
Alan Gray [Thu, 9 May 2019 11:14:25 +0000 (04:14 -0700)]
Code quality improvements for CUDA position buffer ops

* improved variable naming
* use of reallocateDeviceBuffer

Follow up to Gerrit change 9169
Implements part of #2934

Change-Id: Ie948f624ae6f7e2df7a2b6c6c734d08d862096e5

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