Merging in free energy, exp. ensemble, & andersen t-control to 4.6

Conflicts:
	src/gmxlib/mvdata.c
	src/gmxlib/txtdump.c
	src/kernel/readir.c
	src/mdlib/sim_util.c
	src/tools/gmx_membed.c
	include/mdrun.h
	src/kernel/md.c
	src/kernel/md_openmm.c
	src/kernel/md_openmm.h
	src/kernel/runner.c
	src/mdlib/minimize.c
	src/mdlib/tpi.c
	src/tools/gmx_membed.c
	src/kernel/md.c

Change-Id: Ide69a8dbfb96072d5c55d0a051dc9db788cbe144
Merge branch 'release-4-6'

Conflicts:
	src/gromacs/gmxlib/dihres.c
	src/gromacs/legacyheaders/dihre.h
	src/gromacs/mdlib/force.c
	src/gromacs/mdlib/mdebin.c
	src/gromacs/mdlib/sim_util.c
	src/programs/mdrun/md.c

Change-Id: I0c5e6d8e57f9f19da73a81737c3105dcd55488ec
Moved:
     src/mdlib/expanded.c ->
       src/gromacs/mdlib/expanded.c
Merge "Merge branch 'release-4-6'"
Remove unnecessary *-impl.h files.

Originally, I put all class declarations in headers, but for private
implementation classes used only from one source file, it just leads to
additional maintenance without much benefit.  Moved such class
declarations to the source files (quite a few private implementation
classes are already declared in the source files).

Removed some unnecessary destructors, and had to adjust some includes,
otherwise this change just copy-pastes code around.

Change-Id: Icfb30f88f593806971746d14e3fc0d9b5e7caa96
Updates to selection online help.

Some of the help topics were outdated after changes introduced by the
linked Redmine issues (some of them even before that).  Improved the
situation a bit and also did some misc. other documentation fixes.

Related to #656 and #666.

Change-Id: I7f18ca4ad8ce2aa5cd808281bab044253ca77f56
Merge "Remove unnecessary *-impl.h files."
Simple patch for openmm_wrapper.cpp

The naming of several variables is changed to be consistent with the
latest free energy changes.  Allows mdrun-gpu to be compiled, which
otherwise fails (as reported on gmx-developers).

Change-Id: I497ba07ee6883ef78d23022450f6c3d971b2127e
Remove unnecessary "move" on shared pointer

Change-Id: I79d2d01307c014f4d40cfffc9dbd04067ed4f0fc
New CPU detection & AVX/SSE code, removed raw assembly files.

Removed all raw assembly files and deprecated altivec support.
Removed support for NASM and other assemblers, and replaced
previous SSE detection code with a new module using CPUID instead.
Added detection for SSE2, SSE4.1, AVX 128-bit with FMA, and AVX 256-bit.
Added Cmake detection of build platform based on CPUID, and output this
to the log file. The executables now compare the compile-time platform
and selected acceleration with the run-time platform and most suitable
acceleration and warns the user if they do not match. The compiler
detection code has also been reordered slightly to produce more readable
warnings when OpenMP is not available, and correctly disable pragma
warnings.

Added intrinsics code and math functions for SSE2, SSE4.1, AVX128/256
both in single and double precision. All math functions and permutation
code have been tested & verified. Single precision math functions are
correct apart from the least significant bit, and double precision has
roughly twice the accuracy.

This has forced me to temporarily disable the SSE & Fortran acceleration.
SSE will be added back soon based on new intrinsics-only kernels currently
in testing, and we will test if Fortran still makes sense then.

Finally, the patch includes a modification to gmx_rmsdist where
a regression issue was introduced recently by using sqrtf() for
the norm function. This caused the intel compiler to produce slightly
different results at high optimization leves, which got evident here.

Closes #926 - Raw assembly code has been removed.
Refs #923 - Old kernels removed, new will be added shortly.
Fixes #914 - Cmake now does architecture-speficic optimization.
Fixes #912, #913
Fixes #857 - We detect rdtscp support with CPUID and use it if possible.
Fixes #750
Closes #537, #574 - Altivec is now deprecated.

Change-Id: Icfca5a940762f8d82ae67b59c65b2d2ac683256d
gmx_dyecoupl: check selected groups from user

check if the user accidentally selected the same group twice. Abort
with error, since this will not produce any meaningful results.

Change-Id: Iace69c473e5f1b815e35d20a39845533297ad208
Fix gmx_fatal for serial compilation

With neither GMX_MPI nor GMX_THREAD_MPI gmx_fatal
called gmx_abort which called gmx_fatal.

Change-Id: Id18c3bc94f19a8008fa2aaa8335c221f115fcd8b
Remove (part of) underscore-prefixed C++ symbols.

This commit is mostly the result of (using GNU sed syntax)
  sed -i -re 's/\<_([a-zA-Z]+)\>/\1_/g'
on the affected files. Some additional manual renaming was done.
optionsassigner.cpp was manually edited a bit more to update comments
and to remove unnecessary use of bit flags.
Also added a few 'explicit' keywords to constructors.

selection/ and trajectoryanalysis/ directories still contain a lot of
these, but this commit is large enough as it stands.

Change-Id: I7f4bf42ec5d9d762fefcff289e38b6b6b231b82b
Clean up option and selection flags.

Rename the enums used for flags such that they are more likely unique.
Also a bit of other clean-up to limit the use of the option flags more
into the generic parts.  Removed a few unnecessary flags.  Made
efClearOnNextSet work more correctly for classes that don't use
OptionStorageTemplate, although currently it didn't cause any issues
(noticed some issues while developing SelectionFileOption, but the final
version worked without these fixes).

Change-Id: I78c243c4f73b87b285eb54d6ff3ae42699678962
Rename format.h to more generic stringutil.h.

There were already some string helper functions not directly related to
formatting, and this header is a natural place to add more of such
things.

Change-Id: I46f7bd46393d27e49d46589b8d7b5c2362bcdc8c
Add string utility functions for suffix handling.

Added endsWith() and stripSuffixIfPresent() functions to stringutil.h.
Allows for much clearer and easier-to-write string manipulation code
where this kind of functionality is needed.

Change-Id: I853234ce3d8a11b88ee50225a66e061302e10de7
Use push parser for selection parsing.

The push parser is new in Bison 2.4 (current parser.cpp files generated
with 2.5), and has two benefits in our case:
- Clearer control flow, since the interactive prompt loop is now outside
  the parser, so it doesn't need to behave like a state machine.
- Allows better exception handling: since it is possible to directly
  return from Flex actions, we should also be able to throw exceptions.
  But without this change, they would go through the generated part of
  the Bison parser, causing memory leaks since the code is generated for
  C.  With this change, the Flex scanner is called directly from C++
  code, eliminating this problem.

Since the Bison and Flex parsers are now decoupled, it should also be
possible to clarify the code further, by having a separate data
structure for parser-specific data instead of using yyscan_t.  For now,
kept the changes to a minimum.

Related to #880.

Change-Id: I43ea11561d3dd0577dd95eae3794ca621953d038
Make the selection parser exception-proof.

The parser now catches and stores any exception that occurs during
parsing, terminates the parser cleanly, and rethrows the exception.

The functions called from the parser are still not exception-safe, and
would require quite some work to make so, because they are code written
originally in C and do a lot of dynamic memory allocation, returning
some of the allocated memory to the caller.  But the generated code
should now work with exceptions.

Fixes #880.

Change-Id: I2d534d106a6fe20d949b3f24b0d7f9980c545fcf
Fixed gcc inline assembly issue with PIC and older gcc compilers

Some gcc versions had problems with the recently introduced inline
assembly for cpuid (clobbering of ebx register), and since we used
a slightly different inline assembly instruction test in cmake we
did not detect it properly. This patch both makes the inline asm
itself much more portable, and we also test with exactly the same
instruction in cmake so we don't set the flag for supporting inline
asm unless we know this instruction works.

Change-Id: Ib479e2706024abb5e3f66d0249291ce55f1257b1
Increase coverate of selection unit tests.

Add some tests and adjust existing tests to cover parts of the selection
compiler and evaluation functions that the coverage run showed as not
covered.
Fixed one issue found (can be backported to 4.5 if necessary).

Part of #651.

Change-Id: If92b5b1eb8cf6b3acb510ba43f64fc82b63ab82a
Merge "Simple patch for openmm_wrapper.cpp" into release-4-6