fixed recent bug with CUDA texture objects

On GPUs with CUDA architecture 3.0, mdrun would exit with an error.
This bug was introduced very recently in 43b41cb8
Fixes #1361

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

Conflicts:
	CMakeLists.txt
	admin/installguide/installguide.tex
	cmake/gmxDetectAcceleration.cmake
	cmake/gmxSetBuildInformation.cmake
Resolved generally in favour of release-4-6, but some changes in
master branch associated with new CMake functionality was kept in the
expected way. Behaviour detecting hardware (particularly on non-x86
platforms) is not optimal in this commit, but is fixed in
I94e0756856e7.

	src/gromacs/gmxlib/checkpoint.c
	src/gromacs/legacyheaders/typedefs.h
	src/gromacs/mdlib/expanded.c
Resolved in favour of release-4-6 (expanded ensemble fixes)

	src/gromacs/mdlib/pme.c
Resolved in favour of release-4-6 (SIMD generalization)

	src/gromacs/mdlib/pme_sse_single.h
Deleted (superseded by src/gromacs/mdlib/pme_simd4.h)

	src/mdlib/CMakeLists.txt
Relocated new comment to correct place in src/gromacs/CMakeLists.txt
(BUILD_OWN_FFTW fixing)

	src/mdlib/nbnxn_cuda/nbnxn_cuda_types.h
Replaced src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_types.h with this file,
but preserved corrected comments from master branch

	src/gromacs/legacyheaders/mdrun.h
	src/programs/mdrun/md.c
Resolved in trajectory_writing.c (removed df_history parameter that is
now useless)

Change-Id: I44ffdc7eb15039b98910f6b3f32252f5849ecfce
Added documentation for gmx_runtime_t struct

Now it is clear what should be done to simplify things, noted inline
with TODO comments.

Change-Id: If66157d9fe924ca1f02b6ffbdd4526feb9ac9784
Cleaned up run time measurement

Removed all use of clock(), in favour of using clock_gettime for
per-node timer and (where available) per-thread timer. This is better
than using gettimeofday(), which is deprecated by POSIX. clock() has
no real advantages, and requires us to keep bumping our own counter if
we use it (in particular, on any remaining 32-bit
machines). Eliminated related dead code.

Cleaned up struct gmx_runtime_t and related code by
* renaming variables more descriptively
* removing variables that should be local variables in a function
* eliminating variables associated with using clock()

The behaviour of print_perf is preserved (tested real MPI, thread MPI;
serial looks like it should work also); namely that the "(%)" should
be a crude reflection of machine load.

Change-Id: Icdf506150045bee88cf04200b25cd010a9bb5419
Encapsulate gmx_wallclock_accounting_t into new timing module

Started a timing module where things like gmx_wallcycle.c and
gmx_cyclecounter.c will eventually also live.

Renamed s/runtime/wallclock_accounting/ to avoid ambiguity with
"compile time," "simulation time," etc.

This patch preserves the release-4-6 behaviour of the reported times
with all supported combinations of MPI, thread-MPI, GPUs, OpenMP.  I
think the old behaviour of -ntomp_pme != -ntomp was buggy with respect
to timing, and this patch fixes that.

Change-Id: I22cba17cdf866e17d9d0732de204b85b0ab31994
Fix NBNxN SIMD reference kernels

nbfp_stride was added independently by both 25eb0e14 and 5deee8a0.

Removing static is not OK for gcc. Mark will resolve later whether
this was even needed for his upstream work.

Change-Id: I97ea4131163512354b5e339dd19549c3e49e9de2
Simplify code structure for C++ analysis tools

Move all the code for declaring the actual analysis tool into the source
file, and leave only a stub info object in the headers.  Make the class
declared in the header provide a static factory method to allow this.

This has several benefits:
 - Easier to write and maintain the tools, as all the logic is in one
   file only.
 - Clearer about the intended level of encapsulation of the tools.
 - Makes the tools in the library more closely resemble those written
   using the template.  The only difference now is that the main()
   method is replaced by the info object, and that the info object
   provides the names to pass to TrajectoryAnalysisModule constructor.

Change-Id: Ib545cc1d8900fe88cb58811df2cd4a63a6a99b2f
Create fileio module

This patch contains only code motion. There are no functional code
changes. Moves lots of I/O code into src/gromacs/fileio. This means
lots of changes to avoid having everything as a compile-time dependency
of everything else because everything is pulled in via typedefs.h,
etc. Note that src/gromacs/legacyheaders/filenm.h and
src/gromacs/legacyheaders/types/filenm.h have been consolidated into
src/gromacs/fileio/filenm.h.

I/O code in files named stat*[ch] now lives in various new files in
fileio.

Files outside of the module now #include its header files in a proper
way, e.g. #include #include "../fileio/filenm.h" or
"gromacs/fileio/filenm.h" according to whether they are an installed
header, or not. Files within the module are blessed and do not need
that qualifier.

This module installs most of its headers (because they're almost all
inter-dependent; gmxfio_int.h is not installed because it is
only useful internally, vmdio.h is not installed because it
relies on a header from src/external)

Files in new module
* conform to preferred include-guard format.
* have up-to-date copyright headers thanks to Teemu's automatic
  script
* that are installed headers refer to other GROMACS include files via
  relative paths

Moves mdrun trajectory writing into wrapper function.

Removes small pieces of I/O code that was hiding behind "#if 0".

Some pieces of I/O code specific to the gmxpreprocess module have
remained there.

Moved a cppcheck suppression to follow matio.cpp to its new home.

Minor fix to xdrf.h logic, since it is now the subject of a CMake
test.

Refs #1292, #1193, #1137

Change-Id: I820036298d574966d596ab9e258ed8676e359184
Misc. Doxygen updates for src/gromacs/utility/.

Add some missing documentation, fix problems noticed, make the
documentation appear more uniform etc.
The biggest improvement is a better overview of the whole directory.
Some Markdown syntax used (requires Doxygen >=1.8), but not much.

Change-Id: Ib4505219536679b17f323c65a9c3f005b655e229
Some overview content for Doxygen documentation.

Make the main page more useful by providing some explanation of the
purpose of the documentation and adding a (currently very short) list of
links to more detailed pages, making it easier to start consuming the
documentation.

Added a page that contains some information from the wiki
http://www.gromacs.org/Developer_Zone/Programming_Guide/Library_Structure

Once the documentation is more complete, some wiki pages (including the
above) could go away.

Requires Doxygen >=1.8, because separate Markdown pages are used.

Change-Id: I2bf6e00976b47b0d34c79f4ea09452d40701f753
Overview Doxygen pages for analysis framework.

Main content:
- General overview page for the whole framework.
- Reorganized the way the documentation for the analysis template is
  generated.
- Separate page for describing the concepts for the analysisdata module
  in more detail.
- Separate page for giving an overview of the selection engine.
  Also minor clean up for related documentation pages.
- Add missing installation rule for analysisdata/modules/lifetime.h.

The module pages could now use some restructuring to reference the
information here and provide relevant details instead of duplicating any
of it.  Left for later.

Change-Id: I159a2d913fe6f9114c60804d30fa3714b23df262
improved the nbnxn buffer size estimate with GPUs

The nbnxn Verlet buffer estimate now takes into account that
constrained atoms rotate, and don't move linearly, around the atom
they are constrained to. This significantly lower the buffer size
estimate for long neighborlist life times (as used with GPUs).
The buffer for most CPU runs is not affected (significantly).
Because of the smaller buffer, mdrun now uses smaller list increase
limits for increasing nstlist when using GPUs. This improves
performance.

Also activated and tested the virtual site effective mass calculation
(vsites were ignored in the drift calculation).

Change-Id: I2cb349f483610eabcc97bfbc23d17f189dec19d6
Fixed memory leak in gmxdump.

Release memory allocated when reading xtc.

Change-Id: I51ab413e598ce937e836b183b29775bc246055cd
Renamed and removed last references to GMX_CRAY_XT3

These systems were around in 2006, so probably out of commission by
now. XT5 had replaced catamount with something else. Not sure about
XT4, which might still be around. In any case, the machinery to test
for Cray's catamount should be named more generally, spam the
CMake status and cache less, and use the standard CMake mechanism
to avoid repeating try_compile().

Change-Id: Ic23b195f500662a6a0c4e27b4dc1c9c647b03fc1
corrected volume with serial NPT replica exchange

Replica exchange with replicas run in serial would only update
x and v, not the other state data. This gave incorrect volumes
with NPT replica exchange.
Fixes #1362

Change-Id: Ib726fbb75e800c624ef61f31e76a5d4a4e408b9c
mdlib: Clean up -Wunused-parameter warnings

Change-Id: I555d418ca21e03ba891b0cf9f9eebbe2fb19a316
Merge release-4-6 into master

Change-Id: I584e5fb2d70e90e5ac8a1439268ee185b0a4105f
Fix build with GMX_CYCLE_SUBCOUNTERS

Was broken by 4d2f9bcee0734a

Changed that the function signature isn't depending on the
compile options.

Change-Id: I7c3e9d6bdcadc80b02dd0f523358c8122f0f9fcc
Merge "Merge release-4-6 into master"
Markup substitution through HelpWriterContext.

Make all calls to process the in-source strings to help output go
through HelpWriterContext.  This makes it easy to implement common
functionality using C++ mechanisms.

Moved all the HTML link processing stuff into HelpWriterContext as well
and cleaned up links.dat.  The generated HTML pages should no longer
contain broken links (but links between program pages are not there
yet).

The markup substitution itself is still done by functions in wman.cpp;
will move those into private functions in helpwritercontext.cpp as a
separate change.

Related to #685 and #969.

Change-Id: I37d45549214e49a6edab82fb64ec7b38b9e72094