alexxy/gromacs.git
9 years agoFix message about incorrect usage of dihedral type 9
Roland Schulz [Mon, 22 Sep 2014 17:31:41 +0000 (13:31 -0400)]
Fix message about incorrect usage of dihedral type 9

The warning printed the wrong type number: 4 instead of 9. Also it
didn't clarify that 9 only combines consecutive lines.

Change-Id: Ie65a050c978f162acf9f9a2329dde286c068438c

9 years agoFix malformed CUDA version macro check
Szilárd Páll [Tue, 9 Sep 2014 21:35:26 +0000 (23:35 +0200)]
Fix malformed CUDA version macro check

The CUDA_VERSION macro check is incorrect in two places. The first is
harmless as it is related to legacy CUDA 3.2 version's reporting. The
second occurrence affects the check that enables stream priorities and
due to the incorrect check, with CUDA 5.5 priorities have not been used.

Fixes #1594

Change-Id: Icf781d41549c39b6b913c11bb11d4dc4e9f3be9c

9 years agoFixes issue with vsiten and verlet buffers.
David van der Spoel [Sat, 30 Aug 2014 14:17:38 +0000 (16:17 +0200)]
Fixes issue with vsiten and verlet buffers.

A loop counter for a loop over vsiten did not take into
account that multiple entries make up one vsiten
particle. Part of #1579.

Change-Id: Ic9a79e89ea9ef8f9f529c9d4a6c5cf05f65e9c7d

9 years agoVersion bump after 4.6.7
Mark Abraham [Fri, 29 Aug 2014 13:47:10 +0000 (15:47 +0200)]
Version bump after 4.6.7

Change-Id: I1f2e73c2b94f31b67e65bf7cf188fb542391ab4d

9 years agoFixed two PME issues with MPI+OpenMP
Berk Hess [Fri, 15 Aug 2014 09:20:28 +0000 (11:20 +0200)]
Fixed two PME issues with MPI+OpenMP

Change 272736bc partially fixed #1388, but broke the more general
case of multiple MPI communication pulses in PME. Change 272736bc
incorrectly changed tx1 and ty1. This change has been reverted.

Change 27189bba fixed the incorrect PME grid reduction with multiple
thread grid overlap in y. But it broke the, much more common, case
where the y-size of the PME grid is not divisible by the domains in y.
This change, incorrectly, changed buf_my.

Now buf_my is set to the correct value, which solves both issues.

Fixes #1578.
Refs #1388 and #1572.

Change-Id: Id2d7d013a3b8cdc04eda1fb026567088a38ec81f

9 years agoFixed bugs in vsiteN with OpenMP
Berk Hess [Tue, 19 Aug 2014 08:10:48 +0000 (10:10 +0200)]
Fixed bugs in vsiteN with OpenMP

Fixes #1579.

Change-Id: I42d234f4ad6a94e8f7b6b8236ea119860dd9f7ab

9 years agoFixed output of eigenvalues in g_covar. Fixes #1575
Carsten Kutzner [Fri, 15 Aug 2014 14:44:44 +0000 (16:44 +0200)]
Fixed output of eigenvalues in g_covar. Fixes #1575

Commit 972032bfb8cd38 introduced a bug that would lead to eigenvalues
only written to .xvg file if "-last" is explicitly stated on the
command line. Otherwise no eigenvalues would appear in the .xvg file.
The eigenvalues are written in a loop from '0' to 'end', but since
'end' is initialized with '-1', the loop would never be executed.
This patch moves the code that computes 'end' one block upwards
before the output to file.

Change-Id: I738c9dd77ff9e6e2daae89b6d2063755dfba88af

9 years agoAvoid stack overflow on Windows with CMake > 2.8.10.2
Stefan Fleischmann [Fri, 8 Aug 2014 15:14:17 +0000 (17:14 +0200)]
Avoid stack overflow on Windows with CMake > 2.8.10.2

CMake used to add "/STACK:10000000" to the default linker flags. That
was removed in version 2.8.11-rc1. The default value used by MSVC is
apparently too small because mdrun crashes with a stack overflow when
built on Windows with MSVC or ICC and CMake newer than 2.8.10.2.

The issue is already fixed in GROMACS 5.0 and master by I1e9858ae3. This
is a backport for release-4-6 of that commit.

Change-Id: Ib9238e513da8e86049d9e56c82262055d3c8b349

9 years agoFixed PME bug with high OpenMP thread count
Berk Hess [Sat, 2 Aug 2014 08:53:31 +0000 (10:53 +0200)]
Fixed PME bug with high OpenMP thread count

PME energies and forces could be incorrect with combined MPI+OpenMP
parallelization. This would, only, happen when
pmegrids->nthread_comm[YY] >= 2, which can only occur with high OpenMP
thread count with multiple large prime factors.
It's unlikely that this issue affected production runs.

Fixes #1572.

Change-Id: I03b38c279c8f8ab2e111dad0976edad88b3ea93b

9 years agoVersion bump after 4.6.6 release
Mark Abraham [Mon, 7 Jul 2014 13:28:38 +0000 (15:28 +0200)]
Version bump after 4.6.6 release

Change-Id: Ifac0db3a07caba28c123d233b54356a1db0d79ba

9 years agoFix detection of i386 in tmpi
Roland Schulz [Sun, 29 Jun 2014 05:17:34 +0000 (01:17 -0400)]
Fix detection of i386 in tmpi

The i386 without underscore is not recommended for new code and is not
defined if -std=... (other than gnu...) is passed on the command line.
__i386__ is already present for GCC 3.2 so there is no need for the old
name. Also we use __i386__ in other places in the code already.
We dont pass such a flag by default for 4.6, but the user could.
In 5.0 this fixes tmpi if the compiler supports c++11 and we pass
std=c++11.

Fixes #1533

Change-Id: I615cb91d3e3196a90fa4ba03fa183bf47af5d444

9 years agoFixes #1532, SEGV in g_current.
David van der Spoel [Sat, 28 Jun 2014 07:33:55 +0000 (09:33 +0200)]
Fixes #1532, SEGV in g_current.

Unfortunately the tool does not do anything useful at this point
in time it seems, it just produces one graph that is non-zero

Change-Id: Ie991b8200628253ab308d36cb5afc80138b1acff

9 years agoAnother MacOSX rpath fix
Roland Schulz [Sat, 28 Jun 2014 05:06:58 +0000 (01:06 -0400)]
Another MacOSX rpath fix

Version comparison was wrong. 2.8.11.x is greater 2.8.11 and thus
was using the 2.8.12 method.

Change-Id: I3eda8c6239ad13194a04fa1da59e99adf2e68519

9 years agoFix MacOSX rpath
Roland Schulz [Thu, 26 Jun 2014 05:02:47 +0000 (01:02 -0400)]
Fix MacOSX rpath

d9d2b0aa74 added rpath for MacOSX but the install rpath
was wrong for MacOSX.

Change-Id: I33984696a0800baf0c58bc13ffbdddc514008750

9 years agoAdded check for domain decomposition and shells.
David van der Spoel [Wed, 25 Jun 2014 07:06:30 +0000 (09:06 +0200)]
Added check for domain decomposition and shells.

Fixes #1376 in as much as that it prevents incorrect calculations.
Can be left out when merging to 5.0 that does not support
particle decomposition. In 5.0 we can write a message about OpenMP
if that works with shells.
Change-Id: Ic07ae70cd3cd5298b6b2d579719da4d267b2d8fb

9 years agoAdded check in grompp for shells and inputrec issues.
David van der Spoel [Mon, 23 Jun 2014 08:42:00 +0000 (10:42 +0200)]
Added check in grompp for shells and inputrec issues.

Some combinations of inputrec settings do not work with shells,
in particular nstcalcenergy > 1 or use of a twin range cutoff.
This is now checked for in grompp. Fixes #1376.

Change-Id: I4382bcf5231920b22c725a7cf8e7b4e17c2526d9

9 years agoFixed the sign of mass perturbed contribution
Berk Hess [Tue, 24 Jun 2014 14:10:31 +0000 (16:10 +0200)]
Fixed the sign of mass perturbed contribution

Corrected the sign of the kinetic energy contribution to dHdl and dH.

Fixes #1527.

Change-Id: Ia1a2f708cdbba9a5a120a2ba8510cc2498f4d054

9 years agoFixed recent bug with disp.corr. and vdwtype=shift
Erik Lindahl [Tue, 24 Jun 2014 08:32:10 +0000 (10:32 +0200)]
Fixed recent bug with disp.corr. and vdwtype=shift

The very recent commit dced970a introduced a small error
in the dispersion correction with vdwtype=shift.

Change-Id: I23c082ed190a5eda096504a23b277fb879c5feb4

9 years agoExtend version checking/warnings for checkpoint continuation
Rossen Apostolov [Thu, 19 Jun 2014 10:26:27 +0000 (12:26 +0200)]
Extend version checking/warnings for checkpoint continuation

Detect if the major/minor versions differ, and write a more
explicit warning that both explains this type of continuation
is unsupported, and recommend to use the -noappend option.
In contrast, for cases where only the patch level differs,
we now only issue a note that the binary has changed, since
this is fully supported.

Fixes #1230.

Change-Id: Ifec509de0e5a05d170ada89fd000c961e311c9ca

9 years agoAdded tip5p to the list of watermodels in some FF.
Rossen Apostolov [Thu, 12 Jun 2014 15:21:10 +0000 (17:21 +0200)]
Added tip5p to the list of watermodels in some FF.

Added support for flexible tip5p to OPLSAA and parameters
were taken from the Amber/Charmm tip5p.itp files.

There are, however, various problems with that water model.
This commit doesn't resolve them so the bug report below
will need to be followed up at later stage.

watermodels.dat now includes a note about these issues
and refers users to the redmine report.

Refs #1348.

Change-Id: I3adaae21f35efbb4240716e91f1bb5d256c8853e

9 years agoImplemented fatal error for nstcalcenergy!=1 with shells.
David van der Spoel [Sun, 22 Jun 2014 20:30:51 +0000 (22:30 +0200)]
Implemented fatal error for nstcalcenergy!=1 with shells.

The combination of using shell particles with a value for
nstcalcenergy that is different from 1 leads to energies
not being communicated around on a parallel machine and hence
a meaningless shell relaxation procedure. This patch will just
bail out with a fatal error if the combination is detected.
Fixes #1376.

Change-Id: Ia54f1480b2358355438acb5de31dfa56b7f8d603

9 years agoMore clear message for undefined pullgroups.
Rossen Apostolov [Wed, 18 Jun 2014 14:19:03 +0000 (16:19 +0200)]
More clear message for undefined pullgroups.

When a pull group was not defined in the index file,
grompp didn't report in a clear way where the problem was.

Fixes #1446.

Change-Id: If571b46b91f6ad28213808b6e18d96e1da0be79d

9 years agoFix g_mindist with pbc=XY
Berk Hess [Fri, 20 Jun 2014 07:01:33 +0000 (09:01 +0200)]
Fix g_mindist with pbc=XY

Fixes #1189.

Change-Id: I7c8242df6f2644bebc49c13c86412f8bc1d37428

9 years agoFixed typo in oplsaa ASPH charges.
Rossen Apostolov [Thu, 19 Jun 2014 13:08:46 +0000 (15:08 +0200)]
Fixed typo in oplsaa ASPH charges.

Part of #1395.

Change-Id: I03c88c8377affadc629c7b9a04d5e8ddd1cb946a

9 years agoFix that seeking was wrong if frame time was modified
Roland Schulz [Sat, 14 Jun 2014 01:07:43 +0000 (21:07 -0400)]
Fix that seeking was wrong if frame time was modified

The trjconv -t0 option causes fr->time to be modified and
this then causes the skipping to be incorrect. Alternative
we could document that fr->time shouldn't be modified
and change that trjconv makes a copy of fr before changing
time. This change has the advantage it is less likely
to reintroduce the problem.

Fixes #1405, #1406

Change-Id: Ibd692dfecdf175450fc43f7f35b774bf4446b316

9 years agoFixed shells with particle decomposition
Berk Hess [Fri, 20 Jun 2014 05:33:57 +0000 (07:33 +0200)]
Fixed shells with particle decomposition

In the spirit of version 5.0, the recent Verlet scheme fix for shells,
commit debd482d, removed the support for PD. Now it's back.

Refs #1429.

Change-Id: I686d4287ec8946e418aa98e739a1a81a0b7f7055

9 years agoFix ref error in constraint pull code
Roland Schulz [Wed, 14 May 2014 22:08:16 +0000 (18:08 -0400)]
Fix ref error in constraint pull code

With multiple pull constraints, the convergence check would use
the reference distance of the last constraint for all constraints.

Change-Id: Ic15d5dd618acc6d3aa5ca0f1e009c6f8096ed0d1

9 years agoFixed CMake 2.8.12+ CUDA dylib bugs and warnings on OS X
Erik Lindahl [Tue, 17 Jun 2014 15:26:33 +0000 (17:26 +0200)]
Fixed CMake 2.8.12+ CUDA dylib bugs and warnings on OS X

This patch fixes up a number of minor compilation issues
with CUDA on OS X. The __STRICT_ANSI__ define has been
added to make CUDA work with gcc version 4.8 and 4.9,
a dummy variable has been added to the dummy c++ gpu utils
file to avoid warnings about empty objects, and we now
properly handle both RPATH (newer CMake) and INSTALL_NAME_DIR
(older CMake) without warnings. CMake-2.8.12 introduced
a bug that caused Gromacs executables to be malformed since
the rpath to the CUDA libraries was added twice. This is
caused by fairly deep internal changes in CMake, but it has
been worked around by removing the rpath (which FindCUDA.cmake
only adds on OS X) manually for CMake>2.8.11.

Fixes #1471.

Change-Id: I8b01204dc07678bc305821162f20db65e0e7b88d

9 years agoFixed sign error in posres dvdl
Berk Hess [Mon, 16 Jun 2014 07:17:35 +0000 (09:17 +0200)]
Fixed sign error in posres dvdl

For position restraints the sign of the contribution of the change
in reference location was incorrect. Note that the contribution of
the change in force constant was and is correct.

Fixes #1408.

Change-Id: I75210c3855d13fdd58e0a698d6c5d7c7116f456b

9 years agoDisabled replica exchange when T not in order
Erik Lindahl [Wed, 11 Jun 2014 21:56:42 +0000 (23:56 +0200)]
Disabled replica exchange when T not in order

There are issues when the replica property is not increasing
with the replica index. This patch has a partial fix. But since
there are still issues, unordered replicas now lead to a fatal error.

Fixes #1377.

Change-Id: I272d9831df85fdc18c1b2fe5724cbfc06e73444e

9 years agoFix a Replica Exchange output problem
Carlo Camilloni [Tue, 17 Jun 2014 14:48:31 +0000 (15:48 +0100)]
Fix a Replica Exchange output problem

when running NPT simulations a "b" was added at the beginning
of the Repl Ex line thus breaking demux.pl

Change-Id: I72781d40187d94216e844a8ea522c5d1832bba09

9 years agoUpdated mdrun -npme documentation
Berk Hess [Fri, 13 Jun 2014 12:01:39 +0000 (14:01 +0200)]
Updated mdrun -npme documentation

The number of nodes at which PME nodes are used has increased.
Added note on PME nodes not being selected automatically with GPUs.

Fixes #1374.

Change-Id: Ie1de87abd3d1204d99af8b4f8e6809e7806f5c08

9 years agoFix that skipping fails if target is 2nd frame
Roland Schulz [Sat, 14 Jun 2014 03:39:20 +0000 (23:39 -0400)]
Fix that skipping fails if target is 2nd frame

With bSeekForwardOnly the current file position should be an inclusive boundary,
but because the binary search stops if the search region (high-low) becomes
header_size, the current frame wasn't found. Because trjconv always reads the
first frame before calling seek, it failed if the target was the 2nd frame.

Fixes #1154

Change-Id: Id4151f0106abdb68d6067f02fe2927a4ec6d77a0

9 years agoRemoved rounding issue in nbnxn Ewald table
Berk Hess [Mon, 9 Jun 2014 13:12:12 +0000 (15:12 +0200)]
Removed rounding issue in nbnxn Ewald table

The nbnxn Ewald table could got the spacing dx passed as a real.
Changing this to double improves the accuracy of the single precision
table by two orders of magnitude, because rounding errors are avoided.

Change-Id: I11b6c27bd3f4e306c412da8f01761b03dc337ce7

9 years agoFixed PME bug with #OpenMP-threads a large prime
Berk Hess [Thu, 12 Jun 2014 13:01:40 +0000 (15:01 +0200)]
Fixed PME bug with #OpenMP-threads a large prime

With hybrid MPI+OpenMP parallelization and the rank local FFT grid
size for a dimension not divisible by the number of OpenMP threads
in that dimension, a very small amount of the FFT grid overlap part
could set/added twice. This would only occur at low-medium MPI
parallelization with OpenMP thread counts with large prime factors,
which is practice means almost never. Even when it occured, no actual
differences in PME energies or forces were observed.
This issue was due to a leftover from when space was uniformly
divided over the grids iso assigning whole grid lines.

Fixes #1388.

Change-Id: I22904c7f55d2e96fc4b8cd1498af2087eaed47ac

9 years agoMake sure figure legends are adapted to xmgr/xmgrace
Erik Lindahl [Thu, 12 Jun 2014 12:39:24 +0000 (14:39 +0200)]
Make sure figure legends are adapted to xmgr/xmgrace

A few programs were not using the xvgr_legend call. g_mdmat
has been modified to use it, and for g_analyse and g_enemat
I at least fixed the existing direct-writing code by adding
a conditional.

Fixes #783.

Change-Id: I782af539b93737b570f266ba744e718fbd846e5f

9 years agoChanged appending file name error message
Berk Hess [Thu, 12 Jun 2014 09:36:30 +0000 (11:36 +0200)]
Changed appending file name error message

The error message now mentiones potential names issues.

Fixes #1497.

Change-Id: I0c0195abd21c5012b49119024505b18a906078be

9 years agoFix memory-usage error in g_chi
David van der Spoel [Thu, 12 Jun 2014 07:58:11 +0000 (09:58 +0200)]
Fix memory-usage error in g_chi

Out of array bounds writing error as pointed out by valgrind
is fixed by this patch, preventing a SEGV.

Fixes #1503

Change-Id: I57959f4751f3eb645ff66bbcd4418607af56c1a4

9 years agoForce g_bond to use structure file
Erik Lindahl [Wed, 11 Jun 2014 23:10:14 +0000 (01:10 +0200)]
Force g_bond to use structure file

Previous versions of Gromacs never wrote broken molecules, but
this is no longer true for domain decomposition. Box dimensions
are set from the trajectory, but the molecular connectivity
from the structure file.

Fixes #834.

Change-Id: I61ecb4957ef11e03bfeef10095a406cbddd23a34

9 years agoMade shells work with the Verlet scheme
Berk Hess [Thu, 12 Jun 2014 08:23:27 +0000 (10:23 +0200)]
Made shells work with the Verlet scheme

The issue was that atoms iso charge group should be put in the box.
Additionally water_pol only worked within a charge group, now fixed.
Note that with shells working across charge groups, which is always
the case with the Verlet scheme, no shell prediction is done.
We should implement prediction, since it improves performance.

Fixes #1429.

Change-Id: I2ebfc2d91fc161167f8f2573b61e1f519cf11fd8

9 years agoAdded dummy mass for charmm TYR aromatic vsites
Erik Lindahl [Wed, 11 Jun 2014 22:49:12 +0000 (00:49 +0200)]
Added dummy mass for charmm TYR aromatic vsites

pdb2gmx was not able to create aromatic vsites
for charmm27 since this dummy mass center was missing.
Note that aromatic vsites are still largely untested,
and not recommended for general usage.

Fixes #587.

Change-Id: Ic7d2976536c6269d1dcf12b7d33bddab096c353f

9 years agoFixed perturbed wall interactions
Berk Hess [Mon, 9 Jun 2014 14:25:57 +0000 (16:25 +0200)]
Fixed perturbed wall interactions

With free-energy calculations, the B-state wall force and potential
were set to zero.
Fixes #1501

Change-Id: Ib53073c19fee19979ade96455b6505001187a2fa

9 years agoMade gmxcheck -rmsd work again with forces
Berk Hess [Mon, 9 Jun 2014 13:22:06 +0000 (15:22 +0200)]
Made gmxcheck -rmsd work again with forces

Change-Id: I776b282b17ee7c6cc4e56130dd804aa0ea04bce6

9 years agoMake sure genrestr uses the disre_up2 parameter
Erik Lindahl [Wed, 11 Jun 2014 23:45:48 +0000 (01:45 +0200)]
Make sure genrestr uses the disre_up2 parameter

Previously, a constant value of 1.0 was used instead of the
margin read from the command line.

Fixes #1357.

Change-Id: I65ef225159e7b6ef818c71d062b619e78fa7ea22

9 years agoMapped HIS1 to HSD in charmm27.
Rossen Apostolov [Mon, 26 May 2014 13:52:05 +0000 (15:52 +0200)]
Mapped HIS1 to HSD in charmm27.

Fixes #1133.

Change-Id: I6c289af9b58c8e7cd66f36982bf118505aa38f7d

9 years agoMade repl_ex time step more readable
Berk Hess [Wed, 11 Jun 2014 06:56:12 +0000 (08:56 +0200)]
Made repl_ex time step more readable

A recent change made the repl_ex time print %e, now it's %.5f,
as in the log file.

Refs #1486.

Change-Id: I2e669d91a61e6a696ce6d123c701fa8b773a3c2f

9 years agoAvoid writing xvgr formatting with -xvg none
Erik Lindahl [Fri, 6 Jun 2014 06:57:43 +0000 (08:57 +0200)]
Avoid writing xvgr formatting with -xvg none

Several tools were writing xvgr formatting code directly
to output files, even when the users selects -xvg none as
a command line option.

Fixes #1407, #1479.

Change-Id: I1db10c2ad7455332e2a415a922885cddaec5efd1

9 years agoPrint in higher precision repl_ex timestep.
Rossen Apostolov [Tue, 10 Jun 2014 13:44:36 +0000 (15:44 +0200)]
Print in higher precision repl_ex timestep.

Fixes #1486.

Change-Id: Ibe5bcee18f761bea96e1b4a432774a4472a40f47

9 years agoProcess negative sigma correctly with combrule 2 or 3
Erik Lindahl [Fri, 6 Jun 2014 07:48:45 +0000 (09:48 +0200)]
Process negative sigma correctly with combrule 2 or 3

The initial combination rule code (for sigma/epsilon)
did not take negative sigma rules into account, which
caused segfaults instead of the values reaching the code
in convparm.c that handles sigma<0 during conversion
to c6/c12 (where it is used to signal c6=0).

Fixes #1391.

Change-Id: I437f06d67c5ecfb58d236590288ad122bcdf2df0

9 years agoIssue a warning for using gmx_rms -prev with large trajectories.
Rossen Apostolov [Fri, 23 May 2014 11:48:19 +0000 (13:48 +0200)]
Issue a warning for using gmx_rms -prev with large trajectories.

Refs #716.

Change-Id: I607d6a63259e0dd9de7c8c99e4917bbe9f37ff8e

9 years agoFixed typo in description of conversion factors.
Rossen Apostolov [Tue, 3 Jun 2014 13:46:37 +0000 (15:46 +0200)]
Fixed typo in description of conversion factors.

Change-Id: I5f9875ef94e8d5526f84c029f539fab642319a04

9 years agoFixed shift and switch modifiers, particularly for free-energy
Berk Hess [Mon, 17 Mar 2014 17:24:50 +0000 (18:24 +0100)]
Fixed shift and switch modifiers, particularly for free-energy

When using tabulated interactions (historically with PME-Switch), the
previous free-energy kernels used tabulated interactions which gave
correct results. However, as we have moved to using the new
interaction modifiers, Ewald short-ranged interactions are computed
analytically. To extend the range over which we apply the soft-core
interaction, the free-energy kernels evaluated interactions by
subtracting the reciprocal-space component, and then applying the
free-energy evaluation to the Coulomb (1/r) short-range
interaction. This works fine for vanilla PME, but led to problems when
combined with a switch modifier, since we are switching a different
function compared to the non-free-energy kernels. This could lead to
large artefacts where the free energy was 100x off if we were applying
the cutoff to r while the switch was applied to the scaled soft-core
radius.

This patch modifies the free-energy kernel so that the vanilla, shift,
and exact-cutoff versions still use the compensation trick, while the
switch modifier always operates on the traditional short-range Ewald
functional form.

The (very small) Ewald shift has also been added when computing free
energy in combination with Ewald summation and potential-shift
modifiers. As the perturbation goes to zero, the interaction will also
approach the non-free-energy interactions. Tested to match the
non-free-energy kernel to with 1e-8 in the fully coupled state, it
conserves energy, and produces reasonable free energies for ethanol in
water.

This also modifies table-generation, table-usage, and
dispersion-correction code to use shift/switch forms (and correctly),
when that has been selected in the interaction modifiers. This
provides much more accurate results for our new shifted interactions.

Correct (unmodified) tables are now generated for 1-4 interactions
in a few corner cases in the presence of modifiers for non-bonded
interactions.

Code paths for using exact cutoffs now work correctly when
rcoulomb-switch != rvdw-switch, or if only one kind of switch is
active.

Free-energy calculations using a plain Coulomb interaction now
incorporate a potential shift if one exists.

The GMX_NB_GENERIC environment variable can now be used to specify the
use of the generic kernel even with shifts or switches active.

Fixes #1463.

Change-Id: Ia63a1ed7d6c9cdf9cd9e6209b6326a49043060ec

9 years agoFix constraint virial with multiple time stepping
Berk Hess [Wed, 14 May 2014 20:36:29 +0000 (22:36 +0200)]
Fix constraint virial with multiple time stepping

With multiple time stepping the additional nstcalclr-1 force
contribution was constrained to remove it from the virial.
This procedure neglected the non-linear contribution due to
the rotation of constraints. Now the contribution of this force
component to the coordinate update is constrained instead and
the corresponding virial contribution is subtracted from the
constraint virial.

Fixes #1400

Change-Id: If3217f52808bf7491998324f8dc3161bc003ec1b

9 years agoUpdated C-/N-terminal partial charges in Amber03.ff.
Rossen Apostolov [Thu, 22 May 2014 13:03:54 +0000 (15:03 +0200)]
Updated C-/N-terminal partial charges in Amber03.ff.

At the time of porting the AmberFFs were validated against
AMBER 8 and the results have matched precisely. However,
that specific AMBER version had a bug due to which CT/NT charges in ff03
were in fact using ff94 charges. The bug correspondingly propagated
to the Gromacs ports. In newer versions of AMBER this has been fixed.

The current GROMACS patch uses charges as specified in the
all_aminoct03.lib and all_aminont03.lib files as
taken from the AmberTools14 distribution.

In that distribution (14) seem to be no updates to the ff9x parameters.

Fixes #1466.

Change-Id: Ie6cfea5702500ff6cd5019edb22f224d29135425

9 years agoFixed g_energy Einstein viscosity
Berk Hess [Mon, 2 Jun 2014 20:48:18 +0000 (22:48 +0200)]
Fixed g_energy Einstein viscosity

The g_energy -vis Einstein viscosity output was obviously incorrect.
This bug has been introduced in version 4.5.
Fixes #1516

Change-Id: I5ffc1a232f0c64769cc438c977b757e8d8b55b98

9 years agoFix memory issue in solvate
Roland Schulz [Thu, 22 May 2014 22:16:13 +0000 (18:16 -0400)]
Fix memory issue in solvate

Caused by SIMD padding introduced by new group kernels.

Fixes #1499

Change-Id: I5126217c9b752f1c1fd04d01e2644987fdc52d5b

9 years agoNormal modes don't work currently with virtual sites or shells.
Rossen Apostolov [Tue, 6 May 2014 14:23:25 +0000 (16:23 +0200)]
Normal modes don't work currently with virtual sites or shells.

Refs #879.

Change-Id: I1c45b5a4b4c97feff222dccbbbb884e0153ad0c5

9 years agoAdd fatal errors for VV and twin-range MTS
Mark Abraham [Tue, 13 May 2014 15:52:50 +0000 (17:52 +0200)]
Add fatal errors for VV and twin-range MTS

Michael never implemented the multiple-time stepping with the VV
integrator family and constraints (see code that calls
combine_forces() from update_coords() in src/mdlib/update.c). Probably
that means the multiple-time-step regime was not tested with VV
either. Strictly speaking, these new fatal errors have scope that is
wider than is clearly warranted, but it is not clear the
no-constraints VV path was only ever as bad as the broken leap-frog
path is (see #1400).

I suspect VV+constraints will work with the incoming fixes for
leap-frog, but until someone wants to use it (and why would they?),
then I'm not going to test that it works as well as it does with
leap-frog.

Change-Id: Ib61d0fb7661bca2101c04423a6af1744420c06ab

9 years agoImprovements to the g_lie help description.
Justin Lemkul [Tue, 8 Oct 2013 11:38:04 +0000 (07:38 -0400)]
Improvements to the g_lie help description.

Information was sparse, likely to avoid restating published
protocols, but some expansion was definitely warranted,
given the amount of questions that have recently been
posted to the mailing list and Redmine.

Refs #1353

Change-Id: Ib4057ae671ccac70061498b1d40ebcba84c497ee

9 years agoAdded a note about using direction-periodic pulling.
Rossen Apostolov [Tue, 6 May 2014 13:28:58 +0000 (15:28 +0200)]
Added a note about using direction-periodic pulling.

Refs #1352.

Change-Id: I867fe1372082063bb221880e8021089f9ded14e7

9 years agoAdded a note about unsupported Verlet cutoff + Buckingham.
Rossen Apostolov [Wed, 14 May 2014 10:10:55 +0000 (12:10 +0200)]
Added a note about unsupported Verlet cutoff + Buckingham.

Refs #1192.

Change-Id: I2da3bf8c768de40531e1ffdf6f8cec73c9e53314

10 years agoFixes a complicated bug in g_anaeig.
David van der Spoel [Fri, 16 May 2014 05:40:37 +0000 (07:40 +0200)]
Fixes a complicated bug in g_anaeig.

If the number of frames for a covariance analysis is fewer than the
number of degrees of freedom, g_covar would happily print nonsense
eigenvalues in the eigenval.xvg file. This would then lead g_anaeig
to give NaN entropy values. By limiting the number of output lines in
the eigenvalue file this should be resolved. In addition a warning is
printed.

Change-Id: I01693a0fa9f3ba5b5784543a04d0d88b33a755c2

10 years agoProhibit AVX_256 with buggy gcc 4.6.1
Mark Abraham [Tue, 13 May 2014 14:16:44 +0000 (16:16 +0200)]
Prohibit AVX_256 with buggy gcc 4.6.1

Fixes #1259

Change-Id: I7c523a90ccd0dd8fd3df6cb1914429e22a27ab5d

10 years agoFix clang 3.5 warnings regarding *abs*
Alexey Shvetsov [Sun, 20 Apr 2014 13:01:54 +0000 (17:01 +0400)]
Fix clang 3.5 warnings regarding *abs*

Fix abs() family functions type usage mismatch.

Change-Id: I85ed2931d681aa1ad024678b4209a524abc2cc61
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agocmake: enable shared libraries by default on Hurd
Pino Toscano [Mon, 5 May 2014 21:01:28 +0000 (23:01 +0200)]
cmake: enable shared libraries by default on Hurd

Since the toolchain is mostly the same as used on e.g. GNU/Linux
(glibc, gcc, binutils, etc), they can be safely enabled.

Change-Id: Ic663c8c344b5dfa2910e9c30260588e1917038c1

10 years agoRemoved truncation of nrdf in v-rescale thermostat
Berk Hess [Wed, 23 Apr 2014 13:15:08 +0000 (15:15 +0200)]
Removed truncation of nrdf in v-rescale thermostat

The resampling function for the v-rescale thermostat expected an
integer value for nrdf, but a real was passed, which was truncated.
With a single coupling coupling group nrdf is analytically an int,
but could be off by a bit. The could lead to incorrect kinetic
energy fluctuations (averages were correct).
Now fractional nrdf's are properly handled for nrdf > 3.
For nrdf < 3 a check is added for integer values with a small margin
for rounding.
Fixes #1218

Change-Id: I4c60c337f9874d0bff51220ad09429140be2a056

10 years agoFix memory error in asc format IO
Roland Schulz [Tue, 22 Apr 2014 19:51:29 +0000 (15:51 -0400)]
Fix memory error in asc format IO

Found with cppcheck 1.64

Change-Id: I72e80cd2b11559be47d449d0a8d444857843979b

10 years agoIssue warnings for potential switch w/o defining switch regions.
Michael Shirts [Fri, 18 Apr 2014 03:09:01 +0000 (23:09 -0400)]
Issue warnings for potential switch w/o defining switch regions.

If either older style switches or new potential-switch modifiers are
used, issue a warning if the PME regions is too long, resulting in
inaccurate energies. Also issue a warning if rvdw_switch is 0, which
occurs if no value is specified.

Discussion is in redmine #1463

Change-Id: I7a2c29f87ceb04712aab5076ac97f5f22f573671

10 years agoFixed g_rmsdist NOE calculation
Carlo Camilloni [Wed, 9 Apr 2014 22:38:08 +0000 (23:38 +0100)]
Fixed g_rmsdist NOE calculation

This fix solve a series of bugs in NOE calculations:
1) incorrect number of frames in the calculation of the average distance
2) wrong selection of equivalent atoms
3) -equiv was wrongly documented

Change-Id: Icc6bbed0e1ba65774ad470c3edbd7a6a96e63ee6

10 years agoFix invalid dereference in g_tune_pme
Mark Abraham [Sun, 6 Apr 2014 11:40:38 +0000 (13:40 +0200)]
Fix invalid dereference in g_tune_pme

Change-Id: If4c999e22799ab2087ff1a1d74d8e5b50ddddd57

10 years agoMake sure water optimization is disabled for esoteric interactions
Erik Lindahl [Wed, 19 Mar 2014 16:16:18 +0000 (17:16 +0100)]
Make sure water optimization is disabled for esoteric interactions

This fixes a bug where the generic NB kernel could be called with
a water-water neighborlist for a few special combinations where
no C kernels existed (e.g. switch/shifted plain-cutoff coulomb).
This would typically lead to virtually no nonbonded interactions
being calculated and the simulation crashing rapidly, so it is
unlikely to have affected any results silently, but was noticed
when testing interaction forms.

Change-Id: I634fc4ab78b54281c89333299975e25883dc1f2c

10 years agoAdds cut-off checks for triclinic domain decomposition
Berk Hess [Mon, 24 Mar 2014 14:33:52 +0000 (15:33 +0100)]
Adds cut-off checks for triclinic domain decomposition

With domain decomposition and 2 decomposition cells in a trilinic
dimension, the cut-off could be longer than the size of the
communicated domains. This could lead to some pairs close to cut-off
distance to be ignored in the force/energy calculations.
Fixes #1467

Change-Id: Id7e16d7f8fa0796d6adcf48ad6e8bbb0b88039ff

10 years agoFixed bug in parallel v/f constraining
Berk Hess [Mon, 17 Mar 2014 15:48:53 +0000 (16:48 +0100)]
Fixed bug in parallel v/f constraining

Constraining v or f with 3 or more decomposition domains in one
or more dimensions could lead to modification of communicated
v and f components by the box size for inter charge-group constraints.
Fixes #1462

Change-Id: Idece9d2d0d8f48e65a654d5c2892fbe1ff836ba0

10 years agoHouse-keeping for MTTK
Mark Abraham [Mon, 17 Mar 2014 17:46:59 +0000 (18:46 +0100)]
House-keeping for MTTK

Leapfrog + MTTK silently produced a .tpr that is probably broken;
certainly the documentation only states support for Velocity-verlet
integrators.

Added note about deprecation and planned removal of MTTK + constraints.

Refs #1292

Change-Id: Iec2cf0dd866242735ce04a954e585b2461f6e701

10 years agoAvoid cross product with zero vector in rotational pulling.
Carsten Kutzner [Wed, 12 Mar 2014 15:14:04 +0000 (16:14 +0100)]
Avoid cross product with zero vector in rotational pulling.

Fixes #1431 (rotation/flex-t regression test failing on BG/Q)

In do_flex_lowlevel() we checked (by mistake!) for xj-xcn being
zero, although we need to check for yj0-ycn being zero, since
we use yj0-ycn in a cross product in the following lines of code.
I now also replaced the direct check (0 == norm(...)) by checking
what gmx_numzero(norm(...)) returns. The latter replacement
was also applied in the do_flex2_lowlevel() routine. Note that there
the check for small xj-xcn was and is actually correct.

Change-Id: I972b6d67a81e30f297db286cd2224f66753a20aa

10 years agoThe van der Waals radius must equal the Coulomb radius with Verlet
Carsten Kutzner [Fri, 14 Mar 2014 10:27:36 +0000 (11:27 +0100)]
The van der Waals radius must equal the Coulomb radius with Verlet

This patch fixes an issue that can occur when using g_tune_pme
with a Verlet pair-list .tpr input file. If the .tpr itself has
large cutoffs (e.g. 1.2 nm) and one asks g_tune_pme to scale
_down_ the Coulomb radius, the van der Waals radius is not
scaled down with the Coulomb radius (only upscaling worked).
One ends up with an unusable .tpr file because rVdW != rCoul.
This patch ensures that van der Waals and Coulomb radii
are always equal with Verlet pair-lists. Fixes #1460. Thanks
to Joao Rodrigues for reporting the issue!

Change-Id: I5ef30e71a35cd83838040057e16e52e09ea82e9a

10 years agoFix incorrect grid cell size in g_sas -nopbc
Teemu Murtola [Fri, 28 Feb 2014 04:33:59 +0000 (06:33 +0200)]
Fix incorrect grid cell size in g_sas -nopbc

Fixes #1445

Change-Id: I798fc8fe96608633f26d9a3500f83f39b44af008

10 years agoAdd fatal error for Andersen+constraints+DD
Mark Abraham [Mon, 24 Feb 2014 16:31:07 +0000 (17:31 +0100)]
Add fatal error for Andersen+constraints+DD

This combination produced a temperature that was 6.5 degrees higher
than the same with one domain, for a 1ns PME lysozyme in water
simulation.

Change-Id: I9f80276c47de955a5053bcabb6fe7c9bfdceaf0e

10 years agoImproved CUDA non-bonded kernel performance
Szilard Pall [Fri, 28 Feb 2014 21:11:08 +0000 (22:11 +0100)]
Improved CUDA non-bonded kernel performance

Some old tweak which was supposed to improve performance had in fact
the opposite effect. Removing this tweak and with it eliminating
shared memory bank conflicts it caused improved performance by up
to 2.5% in the force-only CUDA kernel.

Change-Id: I7fcb24defed2c68627457522c39805afc83b3276

10 years agoPermit warning-free use of Andersen thermostat
Mark Abraham [Mon, 24 Feb 2014 04:32:06 +0000 (05:32 +0100)]
Permit warning-free use of Andersen thermostat

Simulations using Andersen thermostat don't need to remove center of
mass motion, because that is intrinsic to the algorithm. Using it with
nstcomm > 1 generated a warning that center-of-mass removal is
unnecessary. Using it with nstcomm == 0 generated a warning that
ice-cube artifacts might be generated. Resolved by suppressing the
latter warning for both Andersen thermostats.

Change-Id: I6b2c1594cabd81964b3ba1ebc5dd61e0f1debb5e

10 years agoportability aspects in install guide + minor tweaks
Szilard Pall [Fri, 7 Feb 2014 18:57:09 +0000 (19:57 +0100)]
portability aspects in install guide + minor tweaks

Added information on portability aspects related to CPU instruction
sets, related to #1428.

Additionally, made several minor updates and tweaks related to
compilers, platforms, cmake, etc.

Change-Id: I621262c939c119e5bdd5e7c91dda0ae3ffc60b7b

10 years agoReinstate shell code with DD
Mark Abraham [Thu, 20 Feb 2014 21:59:41 +0000 (22:59 +0100)]
Reinstate shell code with DD

Further work on the complex/sw test case in the 5.0 regressiontests
branch reveals that the initial conditions may have been the reason
for the problems observed with DD and more than one node, rather than
the implementation.

Refs #1429

Change-Id: I26ff6d9f8c79605afa794cae4761b5643b712124

10 years agoadded gmx_is_{single,double}_precision
Christoph Junghans [Tue, 18 Feb 2014 17:32:47 +0000 (10:32 -0700)]
added gmx_is_{single,double}_precision

* allows easy detection of the precision for cmake, autotools
  without parsing the output of gmx_print_version_info (no
  cross-compile support) or the output of strings command (unix
  only)
* linking against libgmx with/out -DGMX_DOUBLE will lead to
  unpredictable segfaults

Change-Id: I472f10ae374a1f42c94c55e156b53f8905bdf098

10 years agoFix aligned store to unaligned memory
Roland Schulz [Mon, 17 Feb 2014 22:23:33 +0000 (17:23 -0500)]
Fix aligned store to unaligned memory

Also fixes that unaligned store was used when not necessary.

Change-Id: I44bb222a07ec0af65198667787b8673b3c6cd2e7

10 years agoavoid mdrun crash when rdtscp is not supported
Mark Abraham [Fri, 31 Jan 2014 14:06:20 +0000 (15:06 +0100)]
avoid mdrun crash when rdtscp is not supported

When using rdtscp, mdrun now detects at runtime whether the CPU supports
this instruction and if this is not the case, it issues a fatal error
and instructs the user to recompile mdrun for the compute host. Note
that this will happen rarely, only when cross-compiling from a newer
host for a rather old one.

Additionally, when the user manually picks AVX, we also turn on RDTSCP
as all AVX-capable CPUs support it.

Also made CMake advanced cache option for GMX_USE_RDTSCP. This replaces
the previously hidden GMX_DISTRIBUTABLE_BUILD option.

Fixes #1428

Change-Id: I8bc884ef9ea8ea4661626b60490182ae2b302648

10 years agoAdded safety check for fitting group in anaeig.
Jan Henning Peters [Mon, 10 Feb 2014 17:53:32 +0000 (18:53 +0100)]
Added safety check for fitting group in anaeig.

Previously, g_anaeig would not check the number of atoms in the selected
fit group against the number of atoms in the reference structure if this
was read from the eigenvector file (g_covar adds the reference structure
to the eigenvector file if fit and analysis group are identitcal). As a
result, anaeig would run out of bounds when selecting the atoms for
fitting, reading random values from memory.

This simple check should prevent this behaviour by terminating anaeig
with a fatal error similar to the one that is invoked if the group
selected for analysis has an incorrect number of atoms.

Change-Id: I63a1e1629144e539808d95d867e0ad0673480fdf

10 years agoIssue fatal errors rather than use broken shell code
Mark Abraham [Tue, 4 Feb 2014 21:13:46 +0000 (22:13 +0100)]
Issue fatal errors rather than use broken shell code

Refs #1429

Change-Id: I18a17f1e232a86a13f4e3b591bd992702af3017b

10 years agocmake eats slashes
Christoph Junghans [Mon, 3 Feb 2014 16:03:00 +0000 (09:03 -0700)]
cmake eats slashes

Change-Id: I5ea157c4a5e9df2212643b49ba9b270ffd9a6978

10 years agoKeep clang Address Sanitizer happy
Mark Abraham [Tue, 28 Jan 2014 01:43:21 +0000 (02:43 +0100)]
Keep clang Address Sanitizer happy

Allocating 15 bytes with the 8-byte aligned memory at offset 8 of
15, would overflow the buffer, which would be fairly likely to
have no effect. But ASan notices this if you run it on AVX hardware,
unlike the Jenkins build which runs on SSE4.1. The good news is
that this fix is enough to make all the existing tests pass under
ASan on AVX.

Change-Id: I61ff11687709e096c70a162d3514227cb243561d

10 years agocmake: added FFTW_URL to allow easy offline build
Christoph Junghans [Mon, 27 Jan 2014 18:30:52 +0000 (11:30 -0700)]
cmake: added FFTW_URL to allow easy offline build

Change-Id: I9904ce03e0ee1b377e4961c1f8481fc98c10cba4

10 years agoRemove unused fplog
Mark Abraham [Tue, 28 Jan 2014 13:24:31 +0000 (14:24 +0100)]
Remove unused fplog

Keeps gcc 4.8 build happy

Change-Id: I392b02c0950ead04c414dffd6340b364b804b7aa

10 years agoUnify logic for timing counts
Mark Abraham [Tue, 28 May 2013 08:35:24 +0000 (10:35 +0200)]
Unify logic for timing counts

Made all integrators use the same logic for starting timing
mechanisms.

Change-Id: Id8cb154f7b96d977efffcc9533d4a6dd9894afbd

10 years agoclarified OpenMP-related things in mdrun help/man
Szilárd Páll [Tue, 26 Feb 2013 22:06:42 +0000 (23:06 +0100)]
clarified OpenMP-related things in mdrun help/man

Added note on OMP_NUM_THREADS/GMX_PME_NUM_THREADS env vars and
improved description on the use-cases when MPI+OpenMP improves
performance.

Change-Id: I904f00c8a4b6907a006b9d4367406d3fa3f3ce42

10 years agoFixed precision in thermal expansion coefficient calc.
David van der Spoel [Mon, 23 Dec 2013 20:42:08 +0000 (21:42 +0100)]
Fixed precision in thermal expansion coefficient calc.

Loss of accuracy was caused by different sampling
of volume and enthalpy and as a result alpha was
computed incorrectly. With the present "fix" the volume
and enthalpy are both downsampled to what is written
in the .edr file. The real fix would be to store the product
of H and V in the .edr file, but that falls outside the
4.6 branch policy.

Change-Id: I1be06d689002d7c9d6be92bf1e377912f0be1efd

10 years agoCheckpointing fix for Native Client
Peter Kasson [Wed, 8 Jan 2014 00:29:06 +0000 (16:29 -0800)]
Checkpointing fix for Native Client

Native Client doesn't allow file renames.  We can over-write output
files, however.  For checkpoints, live dangerously and skip backups.
The alternate would be to use an in-memory file system, but then we're
still screwed if the program gets killed partway through writing the
on-disk version.  Other alternates:  keep all checkpoints.

Change-Id: I952ee6436e69f015633a150f94fca65c7271c6bb

10 years agoPatch for Native Client builds.
Peter Kasson [Tue, 17 Dec 2013 21:49:38 +0000 (13:49 -0800)]
Patch for Native Client builds.

This patch contains the source changes necessary to compile Gromacs
for Native Client.  Patch is based on original work by Ivan Krasin,
additional changes from Joseph Coffland.
Also included are a few compiler warning fixes and a minor FAHCORE
tweak.

Change-Id: I085c52ff1d8e45ec8ffb8c56f5877313d6225bb2

10 years agocmake: make GMX_BUILD_OWN_FFTW work without fortran compiler
Christoph Junghans [Sun, 29 Dec 2013 01:51:50 +0000 (18:51 -0700)]
cmake: make GMX_BUILD_OWN_FFTW work without fortran compiler

Fixes #1412

Change-Id: I4739c112630ad7e264ce314d2da0b29932ea3041

10 years agoPass on default value of radstep in make_edi
Carsten Kutzner [Fri, 20 Dec 2013 11:02:19 +0000 (12:02 +0100)]
Pass on default value of radstep in make_edi

This is a bugfix for make_edi when -radfix is chosen. Problem was:
if the user did not specify -radstep, then the default value of 0
was not written to the sam.edi output file. Now it is. Also
renamed "radfix" variable to "radstep" because that better reflects
what it is.

Change-Id: I0cc6ee84d42b18ee0ea6b045cdfb0c1d55d51b9f

10 years agoEssential dynamics: move bNeedDoEdsam evaluation to separate function
Carsten Kutzner [Fri, 6 Dec 2013 12:03:55 +0000 (13:03 +0100)]
Essential dynamics: move bNeedDoEdsam evaluation to separate function

The bool variable edi->bNeedDoEdsam is used to signal whether any essential
dynamics constraints have to be evaluated for the ED group. This variable
was evaluated at the beginning of an ED simulation in write_edo_legend().
The latter is however not called if continuing from checkpoint. To
get rid of having to remember whether edi->bNeedDoEdsam was already
initialized, there is now a function bNeedDoEdsam(edi) that is evaluated
every time when called.
Also corrected a few typos.

Change-Id: Iab899a677a85ee8270354859c98cc9e5a9db34b7

10 years agoFixed essential dynamics (ED) continuation from .cpt for reference=average
Carsten Kutzner [Fri, 6 Dec 2013 11:56:11 +0000 (12:56 +0100)]
Fixed essential dynamics (ED) continuation from .cpt for reference=average

ED runs where the reference and average structure indices are the same can
crash when continued from checkpoint. For these cases (where reference =
average atom indices) obviously the set of atomic positions for the reference
and average structures is always identical. Therefore, only one of the two
structures is stored (which is the average structure edi->sav). When reading
the old values of these structures from the checkpoint file, edi->sav.x_old
therefore needs to be copied both to xstart and xfit in init_edsam().

Change-Id: Ieb1f029f4a927999dfb4579ee7c3bebe15071dc8