Fixed pdb2gmx -vsite hydrogen -o conf.pdb

Generation of v-sites did not initialise the elem field of the t_atom
structs. Later when writing the output to PDB format, that elem is
used for the final column. Somehow, the memory in elem was
uninitialized at that point, despite the use of srenew. Oh for proper
constructors and copies!

I observed the problem with v-sites generated from a POPC lipid, but
presumably the underlying cause is common to all kinds of v-sites, so
I have filled the elem field for two other kinds of v-site
generation. I have no idea why not all of the aromatic v-site
generation schemes involve filling a new t_atom struct.

Change-Id: I69efee07d8fd51192808a85d5704d488a0d310be
Removed buggy -seppot output

ns() no longer computes forces, so the comment needs correcting.

dvdlambda was changed to an array at some point, but the output code
did not change in sync. So, that output has been broken in at least
4.6, and is always zero anyway. So the output code can go away.

A patch in master branch removes the useless parameters in the
neighbour-search code. When merging this patch into master branch,
eliminate the useless dvdlambda variable.

Fixes #1294

Change-Id: Iba48f549ee07f0ee1877035a9e506780439c8002
implemented plain-C SIMD macros for reference

This is mainly code reorganization.
Adds reference plain-C, slow, arbitrary width SIMD for testing.
Adds FMA for gmx_calc_rsq_pr.
Adds generic SIMD acceleration (also AVX or double) for pme solve.
Moved SIMD vector operations to gmx_simd_vec.h
The math functions invsqrt, inv, pmecorrF and pmecorrV have been
copied from the x86 specific single/double files to generic files
using the SIMD macros from gmx_simd_macros.h.
Moved all architecture specific nbnxn_kernel_simd_utils code to
separate files for each SIMD architecture and replaced all macros
by inline functions.
The SIMD reference nbnxn 2xnn kernels now support 16-wide SIMD.
Adds FMA for in nbnxn kernels for calc_rsq and Coulomb forces.

Refs #1173

Change-Id: Ieda78cc3bcb499e8c17ef8ef539c49cbc2d6d74d
Fixes #1312 uninitialized error in g_enemat.

Change-Id: Ia0ac6d095dd560f08576aad1b435c92b6de52b3b
Update management of linear algebra libraries

Management of detection and/or linking to BLAS and LAPACK libraries is
re-organized. The code has migrated to its own module. This will
help future extension and maintenance. This version communicates
things that are newsworthy and stays out of the way when nothing
is changing.

We no longer over-write the values specified by the user for
GMX_EXTERNAL_(BLAS|LAPACK). Previously, this was used to signal
whether detection succeeded, but that does not really get the job
done. Instead, the user is notified that detection failed (repeatedly,
if they deliberately set such an option on).

Correct usage and expected behaviour in all cases is documented both
in the code and the install guide.

The user interface is pretty much unchanged. We still don't offer full
configurability (e.g. MKL for FFTs must use MKL for linear algebra
unless GMX_*_USER is used, and the only way to get MKL for linear
algebra is to use it for FFTs). The size of any performance difference
is probably very small, and if the user really needs mdrun with
certain FFT and tools with certain linear algebra library, they can do
two configurations. Note that mdrun never calls any linear algebra
routines (tested empirically)!

Expanded the solution of #771 by testing that the user supplied
libraries that actually work. If not, we emit a warning and try to use
them anyway.

We also now check that MKL really does provide linear algebra
routines, and fall back to the default treatment if it does not.

Refs #771,#1186

Change-Id: Ife5c59694e29a3ce73fc55975e26f6c083317d9b
Find mkl.h on more icc versions

Refs #1110

Change-Id: I0b6bc2497fc2a504b6c29b0697ee9e354fe6cffd
Updated dlist.c to recognize more atom names.

Previously, g_chi basically only worked correctly for OPLS-AA and
Gromos96 force fields, based on C-terminal atom names.  This commit
adds atom names for AMBER and CHARMM force fields so that g_chi
calculates dihedral properties for all residues.

Change-Id: I48517fb55bd46e7d49941f7902f4f6531e443e62
Merge branch release-4-6 into master

Conflicts:
	src/gmxlib/CMakeLists.txt
resolved in src/gromacs/CMakeLists.txt and
src/gromacs/linearalgebra/CMakeLists.txt

Conflicts:
	src/gromacs/legacyheaders/gmx_x86_simd_double.h
	src/gromacs/legacyheaders/gmx_x86_simd_single.h
resolved by deletion, because this functionality is
now in gmx_simd_macros.h and nbnxn_kernels_simd_utils*.h

Conflicts:
	src/gromacs/mdlib/nbnxn_search_simd_2xnn.h
	src/gromacs/mdlib/nbnxn_search_simd_4xn.h
	src/gromacs/mdlib/pme.c
resolved in favour of release-4-6 because of new
SIMD approach

Conflicts:
	src/gromacs/mdlib/sim_util.c
resolved comment in favour of release-4-6 (which is accurate)
and code in favour of master (where refactoring has occured).

Change-Id: I6c1a365fcff66c7023ec824c3f2e0e9e2b9ade59
cmake: Improve some error messages

Lessons learned from the Q-bio summer school

Change-Id: I521a08ba3a83566582137740a0d097c0637d7d3e
Properly finalize MPI on mdrun -version. Fixes #1313

Change-Id: I1ae5f342da96980df322770d134555e2dc9fe712
Refactored preparation of buffer for NBNxN table loads

The outer and inner kernels try to be hardware-agnostic, but some
architectures need a thread-local buffer for transferring computed
table indices to integer registers via memory. It is better to set up
this buffer using a helper function that is implemented in
hardware-specific files, because the compiler can help prevent some
bugs. In particular, you can no longer forget to make a function
definition on non-SSE2. This eliminates one of the special-case kernel

Change-Id: I1ebdd15afaf03ff4559365867970b88e9ce0ed5e
Fixing problem caused by overflow in expanded ensemble.

Basic problem: logic was failing for single precision because of round off errors.
Solution: convert some of the intermediate arrays into double.

Fixes redmine #1314

Change-Id: Id7e3771d257bbeebeed2f340593b817015a0cd4c
Fixed reference SIMD code to work with MSVC

Also noted minor issue with rounding to even. Using rint would be
preferable, but that's even harder to work around on MSVC.

Change-Id: I495cf2d43cf0b33cc0896958f15703ba8632c7e4
Reordered FFTW fatal error; avoids using unset variables

Now variables that are set in FFTW detection are only used when the
variable that reports FFTW has been found is set (i.e. there has not
been a fatal error). Not sure why we haven't seen problems with this
so far, but we do see them on Power7 with cmake 2.8.8 when FFTWF is
not available.

Change-Id: I1a3e84002dda7f29f90eb532ab14ce51dfca6e5c
fixed parallel normal modes with PME

When doing a normal mode calculation with PME and (thread-)MPI,
the PME forces were incorrect. Also fixed some EM/NM output layout.
Fixes #1308

Change-Id: Ia7862fa62e235336c546824afdcbe28f37b145c5
Fixed GMX_DD_DUMP_GRID

The pdb format string no longer matched the parameters it was given

Change-Id: I682154a0986fdbd73ae414264982a68fed164c87
Fix minor wallcycle output issues

Document 19-character wcn name restriction better.

Enforce 19-character wcn name restriction better. The new behaviour
correctly truncates a wcn[] that is too long for the 19-printing
character field width of the wallcycle table.

Compress two names into one field for GMX_CYCLE_ALL correctly. The
previous version was buggy because the first call to snprintf()
resulted in 0 == buf[8], which suppressed output of the second name
completely. The previous version's second call to snprintf() was
probably wrong similarly.

Change-Id: I430ca6eb2bccfe3775e58bae4b6fc3326bcde706
Consolidated NBNxN SIMD kernel utility routines

Hardware-, precision-, and j-width-specific routines used only by the
NBNxN kernels are now all defined in
nbnxn_kernel_simd_utils*.h. Hardware-specific details are contained in
files specific to that hardware.

A major feature contained in this patch is a refactored treatment of
NBNxN particle-particle exclusions. This hides the
x86-implementation-specific details of using integer- or real-valued
SIMD registers and operations. Both inner and outer NBNXN loops are
now more independent of hardware.

* Moved SIMD types, constants and functions for exclusions to the
  NBNxN kernel module, because that is the only place where they are
  used.
* Introduced gmx_exclfilter type to hide the implementation detail of
  whether the masking is handled in integer- or real-valued SIMD
  registers
* Consolidated gmx_checkbitmask* likewise, and renamed to reflect that
  it returns a gmx_mm_pb
* Eliminated the need for gmx_castsi_pr, gmx_set1_epi32, gmx_load_si
  by recasting the code as the composite operation of
  gmx_load1?_exclfilter
* Through the above, eliminated the need for CHECKBITMASK preprocessor
  defines and checks
* Converted code macros to static inline functions
* Converted FILTER_STRIDE and NBFP_STRIDE to a static const instead of
  macro, since neither are ever used as an array dimension in C. This
  works towards using the compiler where possible and the preprocessor
  only where necessary.
* Introduced functions for exclusion mask loading so that there will
  be a link seam for testing with in master branch

TODO: Respond to two questions addressed to Berk embedded in new
comments.

Change-Id: I2a74638b982bdbf5a88442b93736df0a2f0c14b0
Fixes for Bluegene/Q

* Moved suffixing code to after where gmxManageBlueGene sets
  GMX_MPI. Since nothing depends on the suffixing until the calls to
  add_subdirectory(), this is safe. There is a complication from the
  way that GMX_MPI means "real MPI" for most of CMake and "real or
  thread MPI" in the source code; that is managed by GMX_THREAD_MPI=ON
  causing GMX_MPI=ON at a certain point. To cope with this, we add the
  "_mpi" suffix in response to GMX_LIB_MPI=on, which is how things
  should have been done back when GMX_MPI was co-opted, except that
  the suffixing was probably being done too early... Altogether, this
  change means that real-MPI binaries are always built with the _mpi
  suffix, like users have come to expect.
* Added compiler suppression for a useless information message that
  is otherwise issued for almost every source file
* Made the C and CXX platform files identical; I'd originally
  thought they could be combined on the command line, but
  that is not true

Change-Id: I26cb782a1b47cf48f47b80ec8c8d0a53db338872
introduced nbnxn data structure for bounding boxes

The nbnxn search code now uses a well organized bounding box data
structure instead of a complicated indexed plain float array
for the cluster bounding boxes.

Change-Id: Ia5adf2d33d495cff3178ca950e8c16aefcfef1fb