alexxy/gromacs.git
8 years agoMerge branch release-5-1
Mark Abraham [Thu, 14 Apr 2016 09:23:52 +0000 (11:23 +0200)]
Merge branch release-5-1

Several changes from release-5-1 have been fixed separately
in master, such changes are omitted here.

Change-Id: Ib03a2091ad6f76e785f7a6cc9ea91493d246da3b

8 years agoCorrected value of electric conversion factor f in the manual
Carsten Kutzner [Mon, 4 Apr 2016 11:39:15 +0000 (13:39 +0200)]
Corrected value of electric conversion factor f in the manual

- As suggested by Christopher Neale
- Made a new latex command for the value so that it can appear
  consistently throughout all uses in the .tex manual
- changed the value to f = 138.935 458(9), which is value and
  standard deviation calculated from NIST 2010 CODATA, as also
  used by GROMACS in units.h (full value calculated from
  numbers in units.h is f = 138.935 457 839 ... )
- If I calculated correctly, the pre-June-2015 value of the std-dev
  was correct, just the last two digits of the value itself
  were swapped in some places 58(9) <-> 85(9)
- I believe commit 1ee3b15530a5 accidentally overwrote the std-dev
  with digits from the value itself

Change-Id: I293768b657a81af0a4dc0865db8c4a1b0eebd4ad

8 years agoSpelling fixes
Szilárd Páll [Wed, 13 Apr 2016 19:08:03 +0000 (21:08 +0200)]
Spelling fixes

Thanks to: Nicholas Breen / DebiChem
https://anonscm.debian.org/viewvc/debichem?view=revision&revision=6293

Change-Id: I5bfecc4cc623276b65cd2dd6e455eff697d4a227

8 years agoDo not create empty man/man7 directory
Szilárd Páll [Wed, 13 Apr 2016 16:51:00 +0000 (18:51 +0200)]
Do not create empty man/man7 directory

Thanks to: Nicholas Breen / DebiChem

Change-Id: I42d0bf14ea774c623ccf9af687ac54bbe634da4c

8 years agoAVX512 transposeScatterIncr/DecrU with load/store
Roland Schulz [Wed, 9 Mar 2016 02:21:35 +0000 (18:21 -0800)]
AVX512 transposeScatterIncr/DecrU with load/store

Also remove one more mask

Change-Id: I0d27eb42eead92d2f50725b2f3831af7e9ee229e

8 years agoFix hwloc narrowing warning on 32-bit architectures
Erik Lindahl [Sun, 3 Apr 2016 12:20:07 +0000 (14:20 +0200)]
Fix hwloc narrowing warning on 32-bit architectures

hwloc always uses a 64-bit integer for cache size, while
size_t might be 32 bits on a 32-bit architecture. Since we
do not expect any 32-bit architectures to come with more
than 4GB of cache, we simply cast it explicitly to size_t.

Change-Id: I35b064de60a6b20dcf9ab6af751b4721037e271c

8 years agoMark more variables as advanced
Szilárd Páll [Mon, 4 Apr 2016 19:17:03 +0000 (21:17 +0200)]
Mark more variables as advanced

CMake 3.x introduced a few more non-advanced CUDA cache variables that
most users do not care about, so this commit hides them.

Refs #1764

Change-Id: I926b03ece080d8f8255e37dc5471275d48956d49

8 years agoFix compile error for IBM VMX on ppc64
Erik Lindahl [Sun, 3 Apr 2016 18:43:54 +0000 (20:43 +0200)]
Fix compile error for IBM VMX on ppc64

gcc-5.1 does not provide vec_mul(), only vec_madd().
This has already been fixed in the master branch with
the new implementation.

Fixes #1812.

Change-Id: I02c691b16bc0827cfa799aa99fd4fc7b84045e3f

8 years agoFix SIMD detection on new AMD AVX CPUs w/o fma
Erik Lindahl [Sun, 3 Apr 2016 19:52:08 +0000 (21:52 +0200)]
Fix SIMD detection on new AMD AVX CPUs w/o fma

We earlier assumed that all AMD CPUs had fma
support and could use AVX_128_FMA, but with this
change we properly detect it and revert to
AVX_256 otherwise.

Fixes #1906 for release-5.1.

Change-Id: I803a6bfa75c5069b73023688a477cfca03c1ddcd

8 years agoCorrect nrdf for 1D/2D systems
Berk Hess [Thu, 17 Mar 2016 21:18:01 +0000 (22:18 +0100)]
Correct nrdf for 1D/2D systems

With COMM removal, grompp would subtract degrees of freedom also for
VCM groups with fully frozen dimensions, i.e. 1D/2D systems.
Also fixed division by zero for groups with #DOF=0 with VV.

Fixes #1923.

Change-Id: I0ba2535df0495947d9bbb6ee1ef29f519635c221

8 years agoFix unit test segfaults with gcc-6.0
Erik Lindahl [Sun, 3 Apr 2016 15:12:38 +0000 (17:12 +0200)]
Fix unit test segfaults with gcc-6.0

Work around a bug in gmock-1.7 by adding the flag
-fno-delete-null-pointer-checks to for the gmock
and testutil sources.

Fixes #1911.

Change-Id: I3e2d3fde99898191437d9eed986659f6f6fb056a

8 years agoFix incorrect return type for scalar version of simd andNot
Erik Lindahl [Sun, 3 Apr 2016 12:03:14 +0000 (14:03 +0200)]
Fix incorrect return type for scalar version of simd andNot

The return type for the integer version was incorrectly set
to float. Fixed by properly adding separate integer, float
and double versions. This has never been used in any higher
level code yet, so it won't have caused any problems.

Refs #1930.

Change-Id: I84a4dfe51cf898664631ec2b0313ecf8e11a4a3a

8 years agoAdded references to ProtSqueeze and g_membed to the user guide
Semen Yesylevskyy [Fri, 1 Apr 2016 12:43:14 +0000 (15:43 +0300)]
Added references to ProtSqueeze and g_membed to the user guide

Change-Id: Ia05a3710eb170173bae9257993f05d2377c02db6

8 years agoFix coolquotes
Roland Schulz [Fri, 1 Apr 2016 20:13:37 +0000 (13:13 -0700)]
Fix coolquotes

The unseeded generator produced always the same number.

Change-Id: I7ce678e61b75aa789e7535bfedb0021c1f2117e7

8 years agoRevert to treating -1 as "generate a seed" in .mdp
Mark Abraham [Fri, 1 Apr 2016 10:30:32 +0000 (12:30 +0200)]
Revert to treating -1 as "generate a seed" in .mdp

Commit 2d0247f6 changed the grompp behaviour while refactoring the rng
seed setup, without mentioning it in the docs or commit message.
Several of the tools also had their functionality changed, but in most
cases there was no previous documentation and now there is
some. However, we can't change grompp behaviour without catering for
all the scripts whose behaviour would change.

This change restores the previous functionality for grompp.

Change-Id: Id77098e1f03ebf96207f8c9908b2dada28c59e6a

8 years agoFix includes in readpull.cpp
Berk Hess [Thu, 31 Mar 2016 21:57:08 +0000 (23:57 +0200)]
Fix includes in readpull.cpp

Change-Id: Iaf055fc196a17dd59795c6579caa0afc210a0c82

8 years agoAdd option for external pull potential
Berk Hess [Wed, 23 Mar 2016 13:57:40 +0000 (14:57 +0100)]
Add option for external pull potential

An module other than the pull code can now provide the potential
and force for a pull coordinate, when the pull coordinate type is set
to external-potential. It is the responsibility of the module to call
a function that applies the scalar force to the atom in the groups
involved in th pull coordinate. A registering function has to be
called by the provider module at setup. This function checks the
consistency of the pull setup and checks a provider string the user
provided against the string of the providing module.
This functionality is intended to be used by the AWH module.

Removed the set_pull_coord_reference_value() function. Instead of
externally modifying the reference value, an external pull potential
should be used.

Change-Id: I231fe43fe3a2148a7a77d979b0fdb234d3de5c9b

8 years agoAdd test and improved docs for custom checkSequence
Mark Abraham [Mon, 21 Mar 2016 06:05:40 +0000 (07:05 +0100)]
Add test and improved docs for custom checkSequence

I tried to use this, but ran into problems if I passed a non-unique id
that was not NULL to the compound checker. Passing NULL is the
behaviour for the implementation of checkSequenceArray, and that seems
to be often appropriate here, too.

Change-Id: I9b02e4632085ad995ef67bbb52959f1533d56c34

8 years agoRevert behavior for handling SETTLE errors
James W. Barnett [Wed, 9 Mar 2016 18:28:15 +0000 (12:28 -0600)]
Revert behavior for handling SETTLE errors

SETTLE errors were changed to fatal in 5.1.2. This causes problems with
minimization of some systems, since a SETTLE error is likely to occur at the
beginning of the minimization. This commit reverts that such that
it only issues a warning as before.

Fixes #1915.

Change-Id: I43ea1878cb61aecf5ae2c5ebcc67fcbda27ba50f

8 years agorefactor CUDA texture-based table initialization
Szilárd Páll [Wed, 9 Mar 2016 13:35:05 +0000 (14:35 +0100)]
refactor CUDA texture-based table initialization

Also makes conditional the allocation of non-bonded parameter table and
related CUDA texture, skipping it when combination rule kernels are
used.

Change-Id: I6f7e25ff3906d8f92da22d2a227292bcb9e9fc74

8 years agoavoid CPU oversubscription with GPUs
Szilard Pall [Sat, 20 Jun 2015 23:23:44 +0000 (01:23 +0200)]
avoid CPU oversubscription with GPUs

If the user specifies the number of OpenMP threads on the command line N
such that N*#GPU > #hardware threads, mdrun will determine the number of
thread-MPI ranks to start based on the number of GPUs without taking
into account the total number of threads that such a run would use. This
will result in CPU oversubscription.

This change will reduce the number of tMPI threads started to prevent
oversubscription.

Fixes #1338

Change-Id: I6bceaa2230686fee2e410caf8ae97c43847a5c28

8 years agoFix multiple tMPI ranks per OpenCL device
Szilárd Páll [Fri, 18 Mar 2016 01:12:18 +0000 (02:12 +0100)]
Fix multiple tMPI ranks per OpenCL device

The OpenCL context and program objects were stored in the gpu_info
struct which was assumed to be a constant per compute host and therefore
shared across the tMPI ranks. Hence, gpu_info was initialized once
and a single pointer pointing to the data used by all ranks.
This led to the OpenCL context and program objects of different ranks
sharing a single device get overwritten/corrupted by one another.

Notes:
- MPI still segfaults in clCreateContext() with multiple ranks per node
  both with and without GPU sharing, so no changes on that front.
- The AMD OpenCL runtime overhead with all hw threads used is quite
  significant; as a short-term solution we should consider avoiding
  using HT by launching less threads (and/or warning the user).

Refs #1804

Change-Id: I7c6c53a3e6a049ce727ae65ddf0978f436c04579

8 years agoLJ combination rule kernels for OpenCL
Szilárd Páll [Tue, 1 Mar 2016 20:30:18 +0000 (21:30 +0100)]
LJ combination rule kernels for OpenCL

The current implementation enables combination rules for both AMD and
NVIDIA OpenCL (also ports the changes to the "nowarp" test/CPU kernel).

Like in the CUDA implementation, all kernels support it, but only for
plain cut-off are combination rules used.

Notes:
- On AMD tested on Hawaii, Fiji, Spectre and Oland devices;
  combination rules in all cases improve performance, although combined
  with the i-prefetching, the improvement is typically only ~10%.
- On NVIDIA tested on Kepler and Maxwell; in most cases the combination
  rule kernels are fastest.
  However, with certain inputs these kernels are 25% slower on Maxwell
  (e.g. pure water box, cut-off LJ, pot shift), but not on Kepler.
  This is likely a compiler mis-optimization, so we'll just leave the
  defaults the same as AMD.

Change-Id: I05396e000cdf93c1d872729e6b477192af152495

8 years agoRe-enable i-atom type local mem prefetch in OpenCL
Szilárd Páll [Fri, 11 Mar 2016 18:05:47 +0000 (19:05 +0100)]
Re-enable i-atom type local mem prefetch in OpenCL

For reasons unknown this has been disabled in the original OpenCL
implementation. However, it turns out that prefetching does have
substantial performance benefits, especially on AMD (>10%) and in some
cases on NVIDIA too (although not on Maxwell).

This change re-enables prefetching code-path and turns it on
for AMD devices. For NVIDIA the decision will be revisited later.

The GMX_OCL_ENABLE_I_PREFETCH/GMX_OCL_DISABLE_I_PREFETCH environment
variables allow testing prefetching with future architectures/compilers.

Change-Id: I8324d62d3d78e0a1577dd3125edf059d3b311c2f

8 years agoCorrect mdrun tMPI (non-)parallel error message
Berk Hess [Wed, 30 Mar 2016 09:34:02 +0000 (11:34 +0200)]
Correct mdrun tMPI (non-)parallel error message

Fixes #1931

Change-Id: Ifad46c7f62099a2cd80d70ccbe46bf3f2b5751e0

8 years agoMake includesorter.py work with Doxygen 1.8.10+
Teemu Murtola [Tue, 29 Mar 2016 19:08:49 +0000 (22:08 +0300)]
Make includesorter.py work with Doxygen 1.8.10+

Newer Doxygen versions write relative paths to the XML output, so make
the filtering that limits what to parse work with relative paths, using
XML entries that should give a relative path with all Doxygen versions.

Change-Id: I6172c625cd7e5293764b9a4dfeacf1c7de10ce78

8 years agoDescribe AMD APPSDK 3.0 issues in the guide
Szilárd Páll [Tue, 29 Mar 2016 15:25:25 +0000 (17:25 +0200)]
Describe AMD APPSDK 3.0 issues in the guide

No better solution has been found to the issue, so we can only warn
users and provide advice for a workaround.

Fixes #1921

Change-Id: I4f6c8efa72e02d39ccb59977a2093802c0590563

8 years agoFix error reporting for documentation build
Teemu Murtola [Tue, 29 Mar 2016 15:50:52 +0000 (18:50 +0300)]
Fix error reporting for documentation build

Make explicit file handling in the documentation build work, now that
the current working directory is managed separately.  In some cases,
this could cause missing some warnings (probably mostly from
check-source) and marking a build incorrectly as successful.  However,
the main effect was that reporting of the unsuccessful reason back to
Gerrit was less than ideal.

Fix issues that had been introduced while the checking was not working.

This can possibly be improved further by adding methods in releng for
wrapping all this file access, but that can wait for later, once there
is a bit of time to design a good, stable API for that.

Change-Id: I2f1dc927a2134365dba15a6b7dcec1a754b58433

8 years agoClean up vsite code
Mark Abraham [Fri, 18 Mar 2016 22:53:16 +0000 (23:53 +0100)]
Clean up vsite code

No functionality changes. Added some const correctness. Reduced the
scope of a lot of variables.

Change-Id: Ia6caba6686ecf9348223932f7cc812e601d0109c

8 years agoMore support for release workflow
Teemu Murtola [Sat, 16 Jan 2016 05:09:13 +0000 (07:09 +0200)]
More support for release workflow

- Add a matrix used for the deployment tests for tarballs.
- Make gromacs.py support builds with static linking, make it
  possible to run the tests (including regression tests) with 'make
  check', and do an install with a normal + mdrun-only build.
- Adapt the website build script to releng changes, and do not run all
  the Doxygen targets twice for the website build.

Some TODOs in gromacs.py identify what would still be necessary to get
to the level the Test_Tarballs_* jobs currently do, but that can also be
improved separately.  Now this, together with the releng changes,
produces something useful reasonably robustly.

Change-Id: Idca8974c5c9e2ee20e04f0a309e0f306a9c615d6

8 years agoIgnore empty GMXLIB
Teemu Murtola [Sat, 26 Mar 2016 05:40:38 +0000 (06:40 +0100)]
Ignore empty GMXLIB

If the GMXLIB env.var. was set, but empty, it triggered an assert
(at least) in pdb2gmx. Now this case is silently handled as if
the variable wasn't set at all.

Part of #1928.

Change-Id: I51646ec659d119b20b7cb429f9292bffa5775aaa

8 years agoAdd real/SIMD template for LJ-14 pairs
Berk Hess [Thu, 11 Feb 2016 08:55:44 +0000 (09:55 +0100)]
Add real/SIMD template for LJ-14 pairs

Added a real/SIMD templated code-path for plain LJ 1-4 pair
interactions without free-energy, virial and energy.
We should add virial and energy, but the virial requires a different
treatment of the shift forces, that we should introduce at the same
time for angles and dihedrals.
The gives a few factors speed improvement. The main improvement comes
from simplified analytical LJ instead of tables; SIMD helps a bit.

Change-Id: Ifdefd875e32f6c5b7d609c3bd66a864fe77fc13e

8 years agoRemoved srenew that was making array smaller incorrectly.
David van der Spoel [Wed, 23 Mar 2016 13:04:00 +0000 (14:04 +0100)]
Removed srenew that was making array smaller incorrectly.

An array y was first allocated to 6 entries, then reduced
to 3 entries using srenew, but after that the indices
3, 4 and 5 were used anyway. Removing the srenew fixes the probem.

Fixes #1920

Change-Id: I3f35f0af3f56d33435bf54a9c7cda6273fb3f05a

8 years agoAvoid assertion failure in pme_loadbal_do
Berk Hess [Wed, 16 Mar 2016 12:45:03 +0000 (13:45 +0100)]
Avoid assertion failure in pme_loadbal_do

When ir->init_step % ir->nstlist != 0 an assertion would fail in
pme_loadbal_do. If it does not fail every time, the assertion can safely
be replaced by a conditional return, which is now done in this case.

Fixes #1870.

Change-Id: Ie586022c87d3993f2de5a6fdf9210ae56aa7855b

8 years agoMake gmx vanhove work without PBC
Berk Hess [Fri, 26 Feb 2016 08:38:40 +0000 (09:38 +0100)]
Make gmx vanhove work without PBC

Change-Id: I37d59fc7edf6d6da36778ac3f342c71a876e2872

8 years agoClean-up code for swapcoords.
Carsten Kutzner [Tue, 1 Mar 2016 14:16:02 +0000 (15:16 +0100)]
Clean-up code for swapcoords.

Fixes one of the TODOs left from change gerrit.gromacs.org/#/c/5660/

Change-Id: If9f443447f2cfd7fb757a386447a51a9f958dd41

8 years agoLJ combination rule kernels for CUDA
Berk Hess [Tue, 23 Feb 2016 18:51:48 +0000 (19:51 +0100)]
LJ combination rule kernels for CUDA

Implemented LJ combination rule parameter lookup in the CUDA kernels
and enabled it for plain LJ cut-off, as was already present in the
SIMD kernels.

Change-Id: Ic1222e9433eb21e8bd1fb81658ebbbfe42c1d2c2

8 years agoMoved pull initialization back to mdrunner
Berk Hess [Fri, 18 Mar 2016 16:34:01 +0000 (17:34 +0100)]
Moved pull initialization back to mdrunner

Commit 29943fe5 moved the init_pull and init_rot calls from
mdrunner() to do_md(), but both are needed in energy minimization
as well and init_pull should be called before init_constraints().
Added an assertion to init_constraints() for pull initialization.

Fixes #1924.

Change-Id: I9420940f772afc2be93416619f464a6ef7472372

8 years agoAdd more const correctness
Mark Abraham [Tue, 15 Mar 2016 17:06:15 +0000 (18:06 +0100)]
Add more const correctness

This helps reduce the size of a future change to how we handle reading
and writing conformation files.

In particular, the way we write symmetric low-level I/O routines that
do both reading or writing according to the value of a parameter
requires that parameters for values to be written are passed as
non-const at some level of the call stack. In several cases, this
change moves that point lower down, so that routines whose job is
writing complex data to files take const parameters. Improving this
helps understand what is going on when e.g. an analysis tool reads in
coordinates, perhaps modifies them, and then writes them. The down
side is that we need to use some const_cast as we get close to the
low-level routines.

Change-Id: I5c22d8681fa5f247f302409bf67b062ebc9fe766

8 years agoFix warning from GCC 6
Mark Abraham [Thu, 25 Feb 2016 15:55:15 +0000 (16:55 +0100)]
Fix warning from GCC 6

These omega variables could not actually be used when uninitialized
but the code is anyway improved by this change.

Change-Id: Ic038ecf1f5ae1ff1f43bbc77b6de023d94b020b2

8 years agoImproved some mdrun integration tests
Mark Abraham [Fri, 12 Feb 2016 09:18:49 +0000 (10:18 +0100)]
Improved some mdrun integration tests

Made some better naming.

Avoided using the whole of OPLS/AA just to get water parameters, which
may have been unstable when calling grompp many times in a binary, for
reasons unknown.

Removed warning suppressions for unsupported icc compiler versions.

Change-Id: I5107fca64f6a73e3c0b85146f28347453ded705a

8 years agoWarn about OpenMPI 1.8.6
Mark Abraham [Tue, 15 Mar 2016 14:08:03 +0000 (15:08 +0100)]
Warn about OpenMPI 1.8.6

Refs #1897

Change-Id: I529e59f095bb38a35569da57d395658e038e3f8f

8 years agoFix non-normalization of FFT autocorr
Berk Hess [Wed, 16 Mar 2016 09:04:31 +0000 (10:04 +0100)]
Fix non-normalization of FFT autocorr

The function many_auto_correl incorrectly divided by the number of
data points, leading to incorrect absolute values of autocorrelation
functions, as e.g. out by gmx analyze -ac -nonormalize.
Also simplified the FFT size calculation.

Added a test for -nonormalize functionality.

Fixes #1914.

Change-Id: If0961c91d6e0a78f88e4390ce55b2a56143dd5e5

8 years agoFix typo in Fourier dihedral equation
Mark Abraham [Tue, 15 Mar 2016 12:48:31 +0000 (13:48 +0100)]
Fix typo in Fourier dihedral equation

This now matches the version in the preceding subsection, and seems
consistent with thoses equations and the code in convparm.c.

Change-Id: Ied7b74d07463f36ad6b1aadfb1c5f4a5b9e776a7

8 years agoAdded pull coordinate geometry angle-axis
Viveca Lindahl [Mon, 21 Sep 2015 16:18:38 +0000 (18:18 +0200)]
Added pull coordinate geometry angle-axis

The new geometry is described in the docs.
Some checks in readpull.cpp where reorganized since adding new
geometries made some old logic a bit convoluted.

Change-Id: I310891740d65e3c47948a06726e7a9e7c974bc44

8 years agoAdded pull coordinate geometry dihedral (angle)
Viveca Lindahl [Wed, 10 Feb 2016 20:29:31 +0000 (21:29 +0100)]
Added pull coordinate geometry dihedral (angle)

How to use the new geometry is explained in the docs.

Change-Id: Ic5fc106df923857e5e94409583e3793dcd7f9fb8

8 years agoAdded pull coordinate geometry angle.
Viveca Lindahl [Wed, 15 Apr 2015 23:04:58 +0000 (01:04 +0200)]
Added pull coordinate geometry angle.

A new subsection was added to the docs explaining the new geometry.

Change-Id: Ie3ab77f6f2e9f35b3afe1a99414a9c0b2bafb991

8 years agoFixed division by zero in polarize.
David van der Spoel [Mon, 29 Feb 2016 14:57:28 +0000 (15:57 +0100)]
Fixed division by zero in polarize.

Replaced dr2*gmx::invsqrt(dr2) by std::sqrt(dr2) in polarize.
invsqrt does not work for values that can be zero.

Change-Id: I1ae75bb64c35ac51afd237b2138cbacc86a425dc

8 years agoClarified license text in the .tex manual
Carsten Kutzner [Fri, 18 Mar 2016 10:01:52 +0000 (11:01 +0100)]
Clarified license text in the .tex manual

This is the remainder of patch https://gerrit.gromacs.org/#/c/5659/
(which is to be abandoned), which was not already fixed
by https://gerrit.gromacs.org/#/c/5655/

Change-Id: I170f63d94a0ab0c4258f8a66b8c1a524aaf975ef

8 years agoVarious minor spelling fixes - messages and code comments only.
Nicholas Breen [Sun, 28 Feb 2016 21:22:59 +0000 (13:22 -0800)]
Various minor spelling fixes - messages and code comments only.

Subsequent revision: Also update copyright years as necessary.

Change-Id: I04ad9fd4948ea6c8598262cdd4b1fb87e5348248

8 years agoFix membed initialization
Carsten Kutzner [Thu, 3 Mar 2016 10:55:48 +0000 (11:55 +0100)]
Fix membed initialization

In commit 29943fe59dca471b2  the membed initialization was copied over to do_md,
but in do_md, state_global instead of state (which is still a NULL pointer
at that point) needs to be passed to init_membed.

Change-Id: Ic43e66f054f0e9b139ff9b402eb7cf4d08d20731

8 years agoFixed OpenCL e/fshift clear kernel first invocation
Szilárd Páll [Tue, 15 Mar 2016 20:46:49 +0000 (21:46 +0100)]
Fixed OpenCL e/fshift clear kernel first invocation

During refactoring the energy/shift force buffer clearing OpenCL kernel
call was moved before the kernels get initialized. This could never
work, but the lacking error checking in the code and (apparently) lax
runtimes allowed it to go unnoticed for some time.

Change-Id: I4bc13bf5e4e33c0797d6f08ad3cd7185d548af96

8 years agoMerge branch release-5-0 into release-5-1
Mark Abraham [Mon, 14 Mar 2016 14:32:27 +0000 (15:32 +0100)]
Merge branch release-5-0 into release-5-1

Change-Id: Ic214521c998b898175a3c9317534008faccef280

8 years agoAdd tests for empty strings in refdata
Teemu Murtola [Mon, 14 Mar 2016 14:55:36 +0000 (16:55 +0200)]
Add tests for empty strings in refdata

This is apparently fragile functionality when trying to rewrite the code
with something else than libxml2.

Change-Id: Iff6a3e76745e43212fc67a6481341d6413e72873

8 years agoFix tabulated wall potential.
Jakub Krajniak [Thu, 25 Feb 2016 15:23:13 +0000 (16:23 +0100)]
Fix tabulated wall potential.

The dispersion and repulsion of the tabulated wall potential were a factor
too small by a factor 6 and 12 respectively.

Fixes #1912.

Change-Id: I56c4b81e7f40f5d5dc9e0f2a184cf4a1bb01e3e5

8 years agoRemove restriction on dihdraltypes order
Berk Hess [Fri, 12 Feb 2016 17:58:17 +0000 (18:58 +0100)]
Remove restriction on dihdraltypes order

Wildcards are allowed for dihedraltypes by grompp. But it was assumed,
with only code and no user documentation, that wildcard types come
after fully specified types. If this order was switched, grompp would
silently choose the wildcard matches. Now the match with the most real
atom type matches is chosen.
Added a paragraph to the bonded parameter section in the manual on
dihedral wildcard matching.

Fixes #1901.

Change-Id: I7e44ff19e4d069d1b186ea470438a47d48f1a72d

8 years agoSupport replacing solvent in insert-molecules
Teemu Murtola [Sat, 3 Oct 2015 04:12:14 +0000 (07:12 +0300)]
Support replacing solvent in insert-molecules

Make it possible to specify the solvent (or other set of atoms) with
-replace (as a selection) for gmx insert-molecules, and make the tool
replace residues from this set with the inserted molecules, instead of
not inserting there.  It is assumed that the solvent consists of
single-residue molecules, since molecule information would require a tpr
input, which might not be commonly available when preparing the system.

Add a basic test for the functionality.

Change-Id: I3a60cdcec9a1675a116c13d83465b07a69b3388d

8 years agoUpdate use of isnan in linearalgebra
Mark Abraham [Sat, 12 Mar 2016 14:29:42 +0000 (15:29 +0100)]
Update use of isnan in linearalgebra

In C++11, cmath now provides std::isnan, so we should use it.

Change-Id: Id3c9f3103722c2ae94c93f09cea74a27852bcbc2

8 years agoFind hwloc quietly if it's already been found
Mark Abraham [Sat, 12 Mar 2016 13:31:49 +0000 (14:31 +0100)]
Find hwloc quietly if it's already been found

Change-Id: I9463decfd16731ddb8da4e6badb679bd53bf8900

8 years agoSplit off Fermi kernel from CUDA kernel
Berk Hess [Mon, 29 Feb 2016 21:08:52 +0000 (22:08 +0100)]
Split off Fermi kernel from CUDA kernel

There are now two CUDA nbnxn kernel files, one for Fermi and one for
all architectures after Fermi. Compute capability 2.x does not support
many features used in the newer kernel, so this change removes many
preprocessing macro from the code and simplifies the shmem math.
This reorganization is even more useful with the coming combination
rule kernels that add more macros and shmem branching.
Also removed the ci_offset variable and replaced &~4 by &3.

Change-Id: I6fa50970215ad32e4d3e4430af04b403db83abc2

8 years agoFix MPI_IN_PLACE test
Roland Schulz [Wed, 2 Mar 2016 20:58:23 +0000 (13:58 -0700)]
Fix MPI_IN_PLACE test

Failed for Intel-MPI because cmake adds libmpicxx and it depends
on libstdc++.

Change-Id: I7b4e485502779ce923fe511ed99ad224166b9aa1

8 years agoAdd infrastructure for tests to compare mdruns
Mark Abraham [Tue, 29 Dec 2015 16:42:23 +0000 (17:42 +0100)]
Add infrastructure for tests to compare mdruns

These can now compare energies and forces within a given tolerance,
though nothing in this commit actually uses the new infrastructure.

Added and updated input files for various kinds of argon, water,
peptide and lipid boxes.

Added some functionality so that scoped_ptr can work with the legacy
APIs for reading files and managing data structures.

Change-Id: I463f7902568ec778871e0ae15898f240ff51d3ad

8 years agoMerge branch release-5-0 into release-5-1
Mark Abraham [Fri, 11 Mar 2016 00:37:02 +0000 (01:37 +0100)]
Merge branch release-5-0 into release-5-1

Change-Id: Icb8d7bc8d5639a824fe5f45e72eede3ec7b9d3c9

8 years agoImprove AVX512
Roland Schulz [Fri, 26 Feb 2016 02:00:43 +0000 (18:00 -0800)]
Improve AVX512

Reduce usage of masking when not necessary.
Fixed FPE in debug mode.

Change-Id: I88e6324535471669faf1c30642128242d5f54e7d

8 years agoRequire 2015 version for MSVC
Mark Abraham [Tue, 16 Feb 2016 22:29:17 +0000 (23:29 +0100)]
Require 2015 version for MSVC

C++11 support is best in this compiler in its latest version, which is
an acceptable compromise for this platform.

This is not good for a CUDA build, which won't officially support MSVC
2015 until CUDA 8, which is unlikely to be released before GROMACS
2016. Thus, there is likely to be a few months where CUDA-enabled
GROMACS 2016 cannot be built by a supported MSVC host compiler.

MSVC 2015 adds warnings for illegal implicit narrowing of double to
float, when used in a brace initializer. In some cases
* we intend the interpretation as real, which is now explicit
* we can just use double
* we can suppress the warning
* in some test code, it is more convenient to initialize as double and copy

Change-Id: Ic6b2f9165b6f1aaa3dc59ce05cd6ffb3abe8861c

8 years agoFix Ewald 3DC dipole with Verlet scheme
Berk Hess [Wed, 9 Mar 2016 22:09:51 +0000 (23:09 +0100)]
Fix Ewald 3DC dipole with Verlet scheme

With the Verlet scheme, the dipole for the Ewald 3DC correction was
summed twice over the PP-ranks at non-NS steps, leads to a correction
that was a factor #PP-ranks too high.

Fixes #1916.

Change-Id: Iefda70ea42f1b6a4c6bd4cbc7c0982114282c15c

8 years agoRandom engines & distributions as proper C++11 classes
Erik Lindahl [Wed, 12 Aug 2015 16:02:42 +0000 (18:02 +0200)]
Random engines & distributions as proper C++11 classes

This change implements the ThreeFry2x64 random engine with flexible
number of encryption rounds and internal counter bits. The class is
compatible with the C++11 random number generators, and the GROMACS
tabulated normal distribution has likewise been turned into a
random distribution compatible with C++11, meaning they can be used in
almost any combination with the standard library distributions.
- The ThreeFry2x64 implementation uses John Salmon's idea of a template-
  selected internal counter so a number of bits are reserved to generate
  an arbitrary random stream. This makes it possible to use ThreeFry as
  a normal random engine, and even in counter mode it is possible to
  draw an arbitrary amount of random numbers before restarting counters.
- Both accurate (20-round) and fast (13-round) versions are available.
- There is a gmx::DefaultRandomEngine when we don't care about details.
- gmx::GammaDistribution has been added to work around bugs in
  libstdc++-4.4.7 headers, and to avoid getting different results
  for libstdc++ vs. libc++.
- Custom Uniform, normal, and exponential distributions have been added
  to make all results reproducible across platforms since stdlibc++ and
  libc++ do not use the same generating algorithms.
- Code using random numbers has been updated, but no changes have been
  made to turn random seeds into 64bits yet.
- The selection nbsearch unit test was a bit fragile and very sensitive
  to the coordinate specific values; this has been fixed so it should
  be resilient no matter what RNG is used in the future.

Change-Id: I47a04d03e2f264e1a6ef0aa0a2174cb464ed9af7

8 years agoSupport for portable hardware locality (hwloc)
Erik Lindahl [Mon, 18 May 2015 22:36:57 +0000 (00:36 +0200)]
Support for portable hardware locality (hwloc)

Added CMake support to detect hwloc, and extended the
HardwareTopology class to read information from hwloc when present,
with the CpuInfo class as fallback. All available information is
dumped to the log file at the beginning of the run. Tested to
work on x86 (Intel, AMD, both single- and dual socket), Power8 and
32-bit Arm, and hwloc versions back to 1.5 (for older hardware).

Change-Id: Id98819254bdfdcb5725f1aee625ecb65dc40f752

8 years agoAdd SETTLE unit tests
Mark Abraham [Sat, 20 Feb 2016 13:07:06 +0000 (14:07 +0100)]
Add SETTLE unit tests

Now that there is a decent seam for how to set up and run SETTLE, we
can have some unit tests that will support making further changes.

Also taught the include sorter that tuple is a C++11 header that we
now use.

Change-Id: I02c2ee19df0322e7c36dd7e65bb992d76f63a5da

8 years agoConverted csettle() to use real/SimdReal template
Berk Hess [Tue, 2 Feb 2016 09:38:11 +0000 (10:38 +0100)]
Converted csettle() to use real/SimdReal template

The csettle() routine for constraining coordinates has been converted
to call a template function that is instantiated with either real or
SimdReal. On Haswell this makes settle a factor 5 faster.
Added reorganized indices to the SETTLE data structure, these are set
by a new function settle_set_constraints analogous to LINCS.
Reorganized the SETTLE initialization.
The settle fatal error no longer report the atom index of (one of the)
problematic water molecule, but the pdb dumps are more useful anyhow.

Change-Id: I61d81ad8a0add6fe234f8c7b5b44dc8c7084ace9

8 years agoFix length of SIMD4 boolean vector in reference build
Erik Lindahl [Sun, 27 Dec 2015 10:28:25 +0000 (11:28 +0100)]
Fix length of SIMD4 boolean vector in reference build

While it will be correct for default builds, this length
should always be 4 even if the user changes the float
SIMD width.

Change-Id: Iea76382fa8c4819f39dc90c7177ad167e9c36ae1

8 years agoMinor corrections to license file COPYING
John Eblen [Thu, 3 Mar 2016 13:53:07 +0000 (05:53 -0800)]
Minor corrections to license file COPYING

Change-Id: I31424b0919c4229069700d097550d0caa7a64039

8 years agoUse SIMD transpose scatter in bondeds
Berk Hess [Mon, 7 Dec 2015 21:23:31 +0000 (22:23 +0100)]
Use SIMD transpose scatter in bondeds

The angle and dihedral SIMD functions now use the SIMD transpose
scatter functions for force reduction. This change gives a massive
performance improvement for bondeds, mainly because the dihedral
force update did a lot of vector operations without SIMD that are
now fully replaced by SIMD operations.

Change-Id: Id08e6c83d4c9943d790bfe2a40c70fa4697077af

8 years agoUse rvec4 for listed force buffer
Berk Hess [Mon, 7 Dec 2015 20:25:05 +0000 (21:25 +0100)]
Use rvec4 for listed force buffer

To allow aligned 4-wide SIMD force reduction, changed the force
buffer passed to ifunc from rvec to rvec4.
Because the listed and normal force buffers now have a different
format, the listed force buffer reduction over threads also needs
to reduce the buffer of thread 0 and is thus now also used without
OpenMP threading. This extra cost is more than outweighed by the
faster listed force updates.
The current force updates in bonded.cpp will be replaced by SIMD
transposeScatter in a separate commit.

Change-Id: I9a9027d983efaf0e919634a55bf2c906aad1fa90

8 years agoRemove epsfac from GPU kernel inner-loops
Berk Hess [Thu, 25 Feb 2016 19:27:36 +0000 (20:27 +0100)]
Remove epsfac from GPU kernel inner-loops

Multiplying the i-charge instead of the j-charge with epsfac in
the GPU kernels removes a flop form the inner-loop. On Maxwell with
CUDA the gain is 2-3% in the force kernels and 3-4% in the energy
kernels (which is more than a flop, probably a register less is used).
There is a single additional division in the energy kernel, but the
gain more than compensates for this.

Change-Id: I6924b32f3f61d3b7bbe532f95361b7fefb577609

8 years agoMinor code reordering in GPU kernels
Berk Hess [Wed, 24 Feb 2016 13:53:08 +0000 (14:53 +0100)]
Minor code reordering in GPU kernels

Updating bCalcFshift just before use instead at the top of the kernel
improves performance by 1-2% on CUDA. This also improves readability.
Making specialized (no)shift kernels will only add 1% gain.
Also updated the OpenCL kernels for consistency and readability
(the perfromance impact is negligible with current hardware/compiler).

Change-Id: I309f90ad61e5815726d55254e2cd38d5e4e7662d

8 years agoFix leftover load() calls in the simd util headers
Szilárd Páll [Fri, 26 Feb 2016 16:40:51 +0000 (17:40 +0100)]
Fix leftover load() calls in the simd util headers

Commit dc2488c8 left behind in a number of headers load() calls. This
change replaces these wiht simdLoad() fixing compilation on ARM NEON,
IBM VSX, VMX, and QPX.

Fixes #1909

Change-Id: I6b5e70f738380ea95d862c207ba45bb48fe2c805

8 years agoFix compilation with Simd4Float, without Simd4Double
Berk Hess [Wed, 24 Feb 2016 20:11:17 +0000 (21:11 +0100)]
Fix compilation with Simd4Float, without Simd4Double

Commit 971335dc added Simd4Real in nbnxn_search.cpp when Simd4Float
was supported, but Simd4Double not, e.g. SSE in double precision.

Fixes #1910.

Change-Id: I92464aa9e63c08901e272c7b9337bfe8c741b0aa

8 years agoSeparated test of CDATA end tag handling from others
Mark Abraham [Sun, 21 Feb 2016 23:55:59 +0000 (00:55 +0100)]
Separated test of CDATA end tag handling from others

Also documented what we're trying to achieve with such a test, since
it has twice been not obvious to me while simply reading the code.

Also clarified where it is and is not appropriate to test how the XML
code handles '\r'.

Change-Id: Ic17af40e2a64477a20b168ade666af588e7a3b41

8 years agoReplace cppcheck suppression in checkpoint code
Mark Abraham [Tue, 23 Feb 2016 21:23:54 +0000 (22:23 +0100)]
Replace cppcheck suppression in checkpoint code

We used to have this suppression, and somehow this didn't get flagged
by Jenkins before the recent cppcheck update to support 1.72.

Change-Id: I1805937210d6cb6b46a6daa4d108b8d763c49267

8 years agoMove init of specialized dynamical algorithms to do_md
Mark Abraham [Fri, 19 Feb 2016 19:00:28 +0000 (20:00 +0100)]
Move init of specialized dynamical algorithms to do_md

These algorithms only make sense with dynamical integrators, so they
should be initialized in do_md.

Noted TODO for essential dynamics, which has a non-trivial interaction
with the constraint code, and no test coverage.

Noted TODO for swapcoords, which has no clean-up code.

Change-Id: I584ad264ef1b0ecfcb4fb95bf7b595a02d668114

8 years agoSeparate table construction
Mark Abraham [Sun, 27 Sep 2015 16:24:59 +0000 (18:24 +0200)]
Separate table construction

Construction of tables for the group scheme, pair interactions and
dispersion correction are now separated. The resulting tables are
never re-used for something else. This uses slightly more memory, but
makes the logic rather more simple. Some of the tables are now held by
reference by their owners, rather than by value, which might improve
cache locality a little.

With this change, we can implement the table support for the Verlet
scheme without getting involved with the group-scheme code, and will
have an easier time removing the group scheme.

Refs #1666, #1852

Change-Id: I8ca608f0e41b02723e6080b80b04d9e7ff048900

8 years agoMerge "Merge branch release-5-1"
Gerrit Code Review [Fri, 19 Feb 2016 15:14:30 +0000 (16:14 +0100)]
Merge "Merge branch release-5-1"

8 years agoFix OpenCL table interpolations of Ewald correction
Szilárd Páll [Fri, 19 Feb 2016 00:29:47 +0000 (01:29 +0100)]
Fix OpenCL table interpolations of Ewald correction

The interpolation function used in the tabulated Ewald kernels was
implemented incorrectly. This did not affect results because by default
anaytical Ewald is used.

Change-Id: I4449ad13c06d9511725be9b19eff98c8d647f622

8 years agoMerge branch release-5-1
Mark Abraham [Fri, 19 Feb 2016 09:18:47 +0000 (10:18 +0100)]
Merge branch release-5-1

Change-Id: I8935d1351656d6b0888e923c8316fce5d5c27cde

8 years agoMake both ftp and http links for source download
Mark Abraham [Wed, 10 Feb 2016 08:03:52 +0000 (09:03 +0100)]
Make both ftp and http links for source download

Apparently some people aren't allowed to use ftp.

Change-Id: Ia9270a2692ca3e95569f1de938f1ba0a8fab1a5f

8 years agoFix excessive list splitting
Berk Hess [Thu, 18 Feb 2016 07:52:32 +0000 (08:52 +0100)]
Fix excessive list splitting

Due to a possible integer overflow, the pair list splitting code could
end up over-splitting pair lists and causing large performance
degradation. Due to the larger processor count, runs using AMD GPUs,
using 100k+ simulation systems are more prone to suffer from the issue.

Fixes #1904

Change-Id: I29139ec80aa75c78fa93de0858f7c60cdae88d5b

8 years agoFix compiler warnings with ICC
John Eblen [Thu, 18 Feb 2016 22:44:49 +0000 (14:44 -0800)]
Fix compiler warnings with ICC

Fixes two compiler remarks:

remark #111: statement is unreachable (nbnxn_search.cpp)

remark #181: argument of type "int" is incompatible with format
             "%3u", expecting argument of type "unsigned int"
             (atoms.cpp and espio.cpp)

Change-Id: Id118e9061c8634e06e5be99600810e74e17e23a6

8 years agoFix copyright
John Eblen [Thu, 18 Feb 2016 21:23:30 +0000 (13:23 -0800)]
Fix copyright

Fix COPYING to say that GROMACS is also covered under later versions
of LGPL.

Change-Id: I96e9608509d0b11d03813a094f82ec857ae13861

8 years agoSmall update to reference manual
Carsten Kutzner [Wed, 17 Feb 2016 16:43:39 +0000 (17:43 +0100)]
Small update to reference manual

This line was so long that the last word was not even on the page.
Added a space so that proper text wrapping is now possible.

Change-Id: I074174a500039b47ef93896fa742f24d6f65baac

8 years agoUpdated reference manual text about PME tuning
Mark Abraham [Fri, 12 Feb 2016 14:12:21 +0000 (15:12 +0100)]
Updated reference manual text about PME tuning

Also removed some junk that has long been commented out.

Change-Id: I0d1d962bd1d41fb35131c64b2c5d77edf36c8791

8 years agoreintroduce supercl interaction mask constant
Szilárd Páll [Mon, 15 Feb 2016 21:28:25 +0000 (22:28 +0100)]
reintroduce supercl interaction mask constant

5822b64 removed the constant and placed the long expression directly
into the conditional. This made the code slightly less readable,
so this change restores the constant, but at function scope.

Additionally, the change is adopted in OpenCL kernels too to keep the
GPU kernels in sync.

Change-Id: I405b5ff73019b750e5304ff925f12edefc051573

8 years agochange macros to constants in GPU code
Szilárd Páll [Thu, 4 Feb 2016 16:31:04 +0000 (17:31 +0100)]
change macros to constants in GPU code

Following the CPU-side changes, further changes and de-capitalization
was done.
Assertion for CUDA warp size to match the cluster split was also added.

Change-Id: Ib4d6c2f1f5680ccaeb7b4065d10ac8ffced334fb

8 years agoRenamed nbnxn static const ints
Berk Hess [Wed, 17 Feb 2016 09:46:35 +0000 (10:46 +0100)]
Renamed nbnxn static const ints

Renamed all static const integers in the nbnxn code from Hungarian
to CamelCase.
Also replaced two functions in nbnxn_atomdata.c by a template.

Change-Id: Ie465c6252767f3042054452d2b85759a14f7d7e9

8 years agoSame fix for XeonPhi (double precision)
Alexey Shvetsov [Tue, 16 Feb 2016 18:57:59 +0000 (21:57 +0300)]
Same fix for XeonPhi (double precision)

Breakege was caused by I646b8b37f14e498f1a9a3a6e0d7a45761951ee0e

Change-Id: I7ed633fc1a02e4fff08a52f8ab509a0392de60fa
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
8 years agoMerge branch release-5-0 into release-5-1
Mark Abraham [Tue, 16 Feb 2016 15:17:46 +0000 (16:17 +0100)]
Merge branch release-5-0 into release-5-1

Change-Id: I4268a1ced2a874dc2844decf6c2853590230ad30

8 years agoChanged norm(...) > 0 condition to norm2(...) > 0 in init_ekindata()
Carsten Kutzner [Tue, 16 Feb 2016 12:32:19 +0000 (13:32 +0100)]
Changed norm(...) > 0 condition to norm2(...) > 0 in init_ekindata()

Fixes issue #1856 on K computer

Change-Id: Ib4f301f17124077bb6cc2aa6b955d01ccdcaec1b

8 years agoReplaced pull-print-com1,2 mdp option with pull-print-com.
Viveca Lindahl [Wed, 10 Feb 2016 16:38:11 +0000 (17:38 +0100)]
Replaced pull-print-com1,2 mdp option with pull-print-com.

Changes were made to the pull output order and naming.

Change-Id: Ic1a5ef460c0979b8ea72a11e96adf51b4bf3f6de

8 years agoImproved/enlarged Fig. 4.9 in manual for better readability
Carsten Kutzner [Tue, 16 Feb 2016 13:06:40 +0000 (14:06 +0100)]
Improved/enlarged Fig. 4.9 in manual for better readability

- Made the whole figure somewhat larger
- Made the axis text larger
- Added/updated the units:
  - kJ mole-1 -> kJ mol-1
  - added degree unit
- Changed plot type from .eps to .pdf

Change-Id: Ibc77c661ed89d9c814d3e2da8490f8b472c4c828

8 years agoMake GROMACS compile again on XeonPhi
Alexey Shvetsov [Mon, 15 Feb 2016 11:51:03 +0000 (14:51 +0300)]
Make GROMACS compile again on XeonPhi

Breakege was caused by I646b8b37f14e498f1a9a3a6e0d7a45761951ee0e

Change-Id: Ia73fbd80cf1366cfa7eb6599cc3943f39e195179
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>