Split up Verlet SIMD kernels for faster compilation

Each kernel is now defined in a seperate compilation unit, and the
files for the kernel functions, the kernel dispatcher function, and
their definitions are all generated by Python script. See its comments
for details. The generation is done by developers and the results
stored in the repo, to avoid CMake-time dependencies. The source for
the file generation is separated from the results of the generation.

On a 48-core AMD machine using GCC 4.7 for an SSE2 build (i.e. 4xN
Verlet kernels), the time for "make mdrun -j" went from 73 s to 34 s.

On a more recent 8-core Intel machine using GCC 4.6.4 for AVX_256
build (both 2xNN and 4xN), the time for "make mdrun -j" went from
81 s to 63 s.

On 16 cores of a POWER7 BlueGene/Q front-end node, time to compile
release-4-6 stays about the same (around 160s).

Also unwound some include file dependencies and removed repeated
definitions of some supporting structures and functions.

Change-Id: I0da1faf351defbe68d5ca43febcabddd93e21f0d
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
Merge branch 'release-4-6'

Conflicts:
	src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_2xnn.c
	src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_2xnn.h
	src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_2xnn_includes.h
	src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_2xnn_inner.h
	src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_2xnn_outer.h
	src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_4xn.c
	src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_4xn.h
	src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_4xn_includes.h
	src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_4xn_inner.h
	src/gromacs/mdlib/nbnxn_kernels/nbnxn_kernel_simd_4xn_outer.h
	src/mdlib/CMakeLists.txt
	src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_2xnn.c
	src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_2xnn_inner.h
	src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_2xnn_outer.h
	src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_4xn.c
	src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_4xn_inner.h
	src/mdlib/nbnxn_kernels/nbnxn_kernel_simd_4xn_outer.h
	src/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn.c
	src/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_inner.h
	src/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h
	src/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn.c
	src/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_inner.h
	src/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h
All resolved in favour of release-4-6, per I0da1faf351def

There was no merge conflict in
src/gromacs/gmxlib/nonbonded/nb_free_energy.c, but Ic7ba3cc26be and
Ia8202ee90 had duplicated the same clean-up of doubly assigned
variables (e.g. Vc), but in different ways. The version in Ia8202ee90
has been retained.

Change-Id: Ia0ec22b7fc16b2be6817b007e52c8b4832549360
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
Remove obsolete tools.

If the user runs one of these tools, print a message directing them to a
wiki page with information about replacements.

Change-Id: I6d213cb28b77de3acd5bb7b66145dea16cb4d833
Merge "Merge branch 'release-4-6'"
Remove src/contrib/prfn.c and related code.

The generated file list hadn't probably been updated in more than a
decade.  It this is necessary at some point, it's easier to reimplement
it at that time than to keep it hanging around now.

Change-Id: I842a92ec416bc5232e54fa8567d540c7af751c24
Remove old generated HTML files.

Related to #1242.

Change-Id: Ic641c8ee09325d5abf124a94ed2a1c1b525cda31
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
CMake helper for dependent cache variables.

Added somewhat extended version of cmake_dependent_option() and used
that for declaring cache variables that are only used if some condition
is satisfied.  Again, not a big change in functionality, but makes
things work more uniformly, and makes it easier to add such options and
not need to think how to implement all the details.

Some dependent options remain that are not yet using the new macros.

Change-Id: I72f4bd19d24c06475bc7f55b6bd561381e5776aa
thread_mpi: Clean up -Wunused-parameter warnings.

Clean up rest of thread_mpi warnings.
Also clean up some whitespace in thread_mpi.

Change-Id: I02c15ac5f1f402e6d04cd120292f5dd6748e89af