Set upper case of FFTW variable at the right place.

Fixes #1327

Change-Id: Ie9ef1fffceefef7d46f1e7a5a8ca3ceb22a81854
corrected grompp constraint/DOF warning with vsites

grompp now counts constraints after removing the ones with vsites.
Fixes #1322

Change-Id: I1f2b129fa5f4c5f56fea384f2749af833c92eabc
mdrun without OpenMP with thread-MPI now uses all cores

With the Verlet scheme, mdrun compiled without OpenMP would
often run on a single MPI-thread only.
Fixes #1317

Change-Id: I8fc43fe933ba23047f0ee9368ad9105cfc62eb4a
Fixing manual for sc-coul description.

fixes #1331

Change-Id: I84a388bf8a9e289b37ff838a0d335d96d4393fb2
made free energy PME kernel 40% faster

Also removed double assignments and unused variables.

Change-Id: Ia8202ee90f70da86474cc946707f016d8ad69286
Fixed g_tune_pme assumption that MPI is available

Refactored function with two distinct parts into two functions. This
makes it easy to call the part that checks that mdrun works only when
that check is necessary. Now g_tune_pme -np 512 -nobench works on
machines like BlueGene/Q where you might only be able to get the MPI
environment via the queuing system. g_tune_pme -nobench should work as
a stand-alone.

Fixes #1319

Change-Id: I7237800a1c67664c9253e5422a7b3f12f4ebd62f
Fixed reading history_t from checkpoint

The use of the wrong reading function prevented reading any checkpoint
file with distance restraints, (and probably any with orientation
restraints, too) because the stored lengths of the arrays could not be
read.

Additionally, the way a t_state is allocated on the stack and most of
the GROMACS code base assumes structures have been allocated on the
heap (and set to zero) by snew() makes the problem worse. Noted that
this is evil and must go away some time.

Fixes #1174

Change-Id: Ic8240f80c17272a1499421233689ed4b2c640ba3
Fix total time measurement with separate PME nodes

The runtime counter needs to be passed to the PME code so that
PME-only nodes can have their time included in the statistics.

Fixes #1325

Change-Id: I13effaa185b1290e41bdd642c607ff75ab8db929
Described another way g_tune_pme might reasonably fail

Change-Id: Ibb75f40a17b81934ae768a57d5e4fb11d07cdc2d
fixed multiple distance restraints with OpenMP

Distance restraints with multiple pairs (the same label) are no
longer split over multiple OpenMP threads. Some (beneficial)
reorganization of the bonded thread division was required to do this,
most importantly: removed calc_one_bond_foreign.
Fixes #1316

Change-Id: I88d8eafede5cbc26c19026a9272639e652f7abd7
optimized generic SIMD invsqrt

The function gmx_invsqrt_pr now uses one instruction less when
FMA is not supported in hardware.
Fixes #1333

Change-Id: Idace7296b88a8ecc0331e22d5bb3088753c478de
Fix bug in (long) neighborlist SIMD padding when adding to previous list

Gromacs-4.6 introduced SIMD padding in the neighborlists, which works
fine for normal simulations. However, when the neighborlist gets long
and we end up adding a second batch of particles we need to remove the
previous padding, which was not done until now. This will typically only
occur when the list per node is large, e.g. when using long cutoffs
(>2nm) with only a single core. Normal simulations should not have been
affected by it (which is also why we did not find it until now).

Fixes #1341.

Change-Id: Ie64ab6c0313a8dc0d3545a5e7d610f24adae4438
Drop md5sum check for GMX_BUILD_OWN_FFTW

The old version gave a confusing error message about a wrong md5sum if
the download failed.

The new version no longer checks an md5sum at all, which avoids the
need to test a CMake version. It also gives an explicit warning and
instructions on how to proceed safely.

CMake bug reported at http://www.cmake.org/Bug/view.php?id=14330
Noted TODO to revisit if that bug gets fixed.

Noted TODO in master branch to show this warning only the first time a
suitable cached variable is set.

Change-Id: I403896505b178251087d71f95362c3754cd4a2de
logic fix for free energies with mdrun -rerun

It was taking the wrong logical path when it checks whether
delta_lambda = 0 when doing mdrun -rerun

fixes #1330

Change-Id: I3dadbb546b4376fae72c1b00c0684450bf77396f
Fixed limitations in g_cluster

Old version produced wrong output for large trajectories with more
than 46340 frames. The reason was that the number of RMSD matrix
entries which is the square number of frames was stored as int which
caused a MAX_INT overflow. By changing it to gmx_large_int_t, g_cluster
is now able to handle trajectories with up to 3e9 frames.

Also freed leaking temporary buffers.

Change-Id: I8acfb0cedae9ddde207f39cb627ad2ea9fbbb9e6
Corrected info text. -center --> -boxcenter

Change-Id: I99901047fcde55f9714c81d3182a3778f290ebac
allow compilation to optimize for CUDA compute cap. 3.5

Enabling optimizations targeting compute capability 3.5 devices
(GK110) slightly improves performance of both PME and RF kernels.
This requires a hint for the compiler optimization indicating
the maximum number of threads/block and minimum number of
blocks/multiprocessor. This change allows nvcc >=5.0 to generate
code for CC 3.5 devices and switches to including PTX 3.5 code
(instead of 3.0) in the binary.

Change-Id: If7e14d31165bc05859250db7468bf6bd8c186264
Silence clang warnings

Pre-release clang 3.4 warns that the types of lout[23] variables
is not the real * expected with GMX_MPI_REAL.

Change-Id: Id3ca4567f5eb642ead0cb4ce8d48dafbb92c303a
Fixes reaction field free energy bug

Version 4.6 introduced an error in the reaction-field correction
force term for perturbed interactions. A factor r_softcore^2 was
missing. The force calculation code is now slightly reorganized
and comments added to avoid such issues in the future.
Fixes #1318

Change-Id: I9105139f8975495c323008ce202cde517a69281a
Fix parallel build for GMX_BUILD_OWN_FFTW

* only works for cmake >=2.8.8
* cmake 2.8.7 has a bug in add_library, but
  cmake 2.8.[0123] have other problem, cmake-2.8.[456]
  still don't build in parallel
* fix from https://gerrit.gromacs.org/#/c/1675/12
* hardcode libdir to fix build on OpenSuse

Change-Id: I74315880f71fd4384084819ccc686072f7cad4f5