Fix trjconv -split not closing files

With long trajectories, the number of file handles will run out.

Change-Id: I9f6e20ddb836250431460ff6ed918ec74f2699ee
Fixes issue with vsiten and Verlet buffers

Commit 0336ab2d only fixed part of the vsiten issue in the Verlet
buffer calculation code. Parameters were read from incorrect memory
locations, which could lead to a segmentation fault or incorrect
masses for vsiten particles. It unlikely that this affected results.
Part of #1579.

Change-Id: I76cdb94e34194d2f6d49d98a49486ce1df76d91a
Merge release-4-6 into release-5-0

Change-Id: I08dc9d5e776480e7686a159cfcd981ba46c510ad
Extend gmock to turn off socket listener

On Linux, you'd generally expect this feature to work, but on Cray the
linker warns that the use of getaddrinfo() would require linking a
shared library at runtime. That never happens because we don't use the
socket listener feature, but we don't want people stressing over that
at build time.

Change-Id: I9c358a2923d7563809d471f2ea1767cf2e8bbe25
Fix order of ED/swap blocks during checkpoint reading.

For some reason the order of reading the swap state and the essential
dynamics (ED) state were mixed up in read_checkpoint(), which lead to
unreadable state files if both ED and swap functionality were used.
This fix changes the order of those blocks to be consistent with
write_checkpoint().

Change-Id: Ie234486b990861decef9e00fc5125f867001f814
Removed f_novirsum reduction in Verlet scheme

There is a reduction over MPI ranks (dd_move_f) for fr->f_novirsum
for the exclusion correction of PME, which should not contribute
to the virial. But with the Verlet scheme this is unnecessary,
since the exclusions fully are handled in the non-bonded kernels.

Change-Id: I65b3dc90cf01de7b33e955074dfa32bd1940f781
Avoid common.h inclusion in CUDA code

This is solved nicer in master with I943f90f, but there is little value
in backporting that compared to the effort, since more or less all
changes from there would conflict.  This may fix compilation problems
with some nvcc/boost combinations.

Change-Id: I82a26c60d366bfe5fdbcfd8a17bffdb1139ce017
Improve analysis nbsearch grid mapping

Now the analysis neighborhood search implements its own version of
put_atoms_in_triclinic_unitcell().  While computing the index of the
correct grid cell, it is relatively easy to produce also the coordinates
that lay within that cell instead of using a separate call.  This
provides two benefits:
 - It avoids rare rounding problems if put_atoms_in_triclinic_unitcell()
   would put the atom right at the edge of the box, but the mapping code
   would consider it outside the box, causing out-of-range grid cell
   index to be generated.
 - It allows to customize the grid mapping more freely (e.g., to create
   grids that are not periodic).

Backported from master with minor changes, fixes #1611.  Kept commit
message the same; the second point will be only relevant for master.

Change-Id: Ib7602fa49a1b8f7882a63843322786b3e51e8e32
(cherry-picked from b3e2e82 in master)
Merge release-5-0 into master

Conflicts:
    src/external/gmock-1.7.0/CMakeLists.txt
        - took both changes on the same line
    src/gromacs/gmxpreprocess/calc_verletbuf.c
        - took both changes on the same line
    src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu
        - discarded temporary common.h hack from release-5-0 in favor of
          better solution in master
    src/gromacs/selection/nbsearch.cpp
        - resolved all conflicts in favor of master (were from a
          back-ported change)

Change-Id: I34190b704bcb1c020dcc2a3586a25620fd3c3ccf
Merge "Merge release-5-0 into master"