Merge "Merge branch release-4-6 into master"
Set upper case of FFTW variable at the right place.

Fixes #1327

Change-Id: Ie9ef1fffceefef7d46f1e7a5a8ca3ceb22a81854
AbstractAnalysisData module handling into a separate class.

Move all logic related to maintaining the list of attached modules,
checking their compatibility with the data, and notifying them from
AbstractAnalysisData into a separate AnalysisDataModuleManager class.
AbstractAnalysisData now contains an instance of this class, and
provires a moduleManager() protected method for derived classes to
access it.

Module notification methods are no longer responsible of keeping the
frame count.  Instead, made the frameCount() method pure virtual and
added a method in AnalysisDataStorage to conveniently implement this
method.

Moved the responsibility of calling all data notification methods into
AnalysisDataStorage (including notifyDataStart() and
notifyDataFinish()). This allows modules that use AnalysisDataStorage to
not even know of the implementation details of the module manager.

Improved the semantics of setColumnCount() etc. such that they now
immediately check the compatibility of data modules and throw if there
is a problem.

Rationale:
 - Remove implementation details from the installed abstractdata.h
   header: AbstractAnalysisData is one of the main public interfaces in
   the module, and it exposed unnecessary complexity in the header. Now
   only the subclasses that actually need it see these details.
   In particular with #869, the module notification interface is only
   going to get more complex.
 - Reduce the responsibilities of AbstractAnalysisData: now it only
   keeps track of the dimensionality of the data (and notifies the
   module manager of relevant changes). Now it is closer to a pure
   interface, which is possibly should be.
 - Makes it possible to remove friendship between AbstractAnalysisData
   and AnalysisDataStorage. This allows further simplification in
   datastorage.cpp.

Related to #869.

Change-Id: Ic42d4b27bb6d1e445e3f74aa06ae52b354bf4403
Support for parallel data modules.

Main changes:
 - Add parallelDataStarted() to AnalysisDataModuleInterface to
   initialize modules for parallel processing of data.  If this method
   is called, and the module returns true, then the module accepts that
   frame notification methods can be called in relaxed order: the frames
   can be started in any order, and multiple frames may be active
   simultaneously.
 - Implement this method in the existing modules, either explicitly or
   by using convenience base classes.
 - Add notification methods to AnalysisDataModuleManager to notify
   parallel frames.  These methods are called as soon as the data is
   available to notify those modules that accept parallel data.
   Existing methods were changed to only notify the serial modules.
 - Make AnalysisDataStorage call the new notification methods
   appropriately.  In most cases, this absorbs the complexity that these
   new methods bring.
 - Update (part of) the unit tests to make it possible to test this
   relaxed frame ordering.

Part of #869.

Change-Id: I3cccf78a09221b8181c3d8b217a793c996d0c522
Move gmx_ana_pos_t::g into gmx_ana_indexmap_t.

Instead of storing a gmx_ana_index_t structure by reference in the
positions, embed this information in the index mapping structure, as
that is really what it is required for.  This localizes the
responsibility of maintaining that state better, and allows removing
code that was there just to provide such an artificial group structure.
The logic still remains mostly the same: the array of atoms is still
stored by reference instead of copying where possible.

This also makes it simpler to handle cases where the output atoms from
the mapping would actually not equal the input group (e.g., that they
would need to be in a different order).

Prerequisite for #1221.

Change-Id: I9e3e0455d1129fd6c3dd8056b2f088114764f331
Remove gmx_ana_indexmap_t::bMapStatic.

This state can be deduced from other variables in the structure,
removing duplicate state and simplifying the code.

Change-Id: Ia0d90ca544184e2af15a321c447f688d864b1d8d
Remove duplicate .nr members from selection structs.

gmx_ana_indexmap_t::nr and gmx_ana_pos_t::nr were leftovers from C times
when these structures were directly exposed to user tools, and the
number of positions was provided as convenience in these members.
Both duplicated the value of (m.)mapb.nr.

Change-Id: If5211d7b513eb3ebcd87d4293d19c19c78952564
Add some legends to C++ tool output.

Mostly add the selection name as legend for those plots where there is
one or two columns per selection.  The complex legend logic from g_bond
is still missing, since it is not clear how to best represent a generic
selection position as a short string.

Change-Id: I41b3b62a2e40f024e8c9c0b5be50e573881b5d7a
Make gmx_ana_pos_t a C++ class.

Add a constructor and destructor for it, and adjust memory management
where necessary.  Simplifies the code somewhat, and allows making
gmx_ana_indexmap_t a C++ class.

Change-Id: I7b6c9a3d8e14b35655980ef28b32cb82de281dc0
Remove unused -man output formats.

Currently, only HTML, LaTeX, man pages, and console output are
actually used.

Related to #969.

Change-Id: I32e5cec872527a779fad9fe742135bcfb30a13a7
Make parse_common_args() not exit.

Instead, return value of false is interpreted as a need to return
immediately.

Stuff in src/contrib/ is broken by this, and existing user tools may
behave a bit weirdly if they don't check the return value.  If this is a
big deal, can add some extra backwards-compatibility glue, but not done
here.

Uncrustified the touched source files to fix indentation after batch
modification.  This resulted in some additional clean-up, but didn't try
to separate that out from here.

Change-Id: I76c268297481bd125d14f4b4f7fa888f4da99f46
Move mdrun into the wrapper binary.

Part of #685.

Change-Id: I92d9ad5705356b2ab1e132383a5fee79ade0f4d0
Add option to build a standalone mdrun binary only.

This makes it again possible to build a leaner version of mdrun, without
the whole wrapper binary.  Enabling the option also removes unnecessary
stuff from libgromacs, and suffixes it with _mdrun.

This also replaces install-mdrun: 'make' builds only mdrun and
'make install' installs only mdrun when the new option is enabled.

Part of #685.

Change-Id: I8d309fadebfcdabc484d632a213ac52c558bfbf4
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
Remove forcefield-scan feature

Refs #1292

Change-Id: I05d8dec45665d5dc3b72b72d312240abbd2983c7
made free energy PME kernel 40% faster

Also removed double assignments and unused variables.

Change-Id: Ia8202ee90f70da86474cc946707f016d8ad69286
Framework for help export from wrapper binary.

- Add a separate CommandLineHelpContext.  This class layers extra
  information on top of a HelpWriterContext, specific for command-line
  help export.
- Add a global instance of the above to be able to pass it into
  write_man() through functions unaware of its existence.  Make
  write_man() use the instance if present.
- Add -export option for 'gmx help', and an interface that needs to be
  implemented to export a particular format.

Related to #685 and #969.

Change-Id: Ica16895f8136a09bc5995812c4da5363d097c2b1
Uniform code path for writing out console help.

Now both 'gmx help <module>' and 'gmx <module> -h' trigger exactly the
same code path, making things a lot easier to work with.
Some notable things:
 - Moved the responsibility to parse the -hidden argument into the
   wrapper binary, from where it gets passed down in
   CommandLineHelpContext.  Quite a few files are touched by this.
 - The -h option now causes all other options to the module get ignored.
   g_tune_pme requires some other approach to deal with option
   validation, but even adding a separate command-line option for only
   this purpose is probably better than the multiple code paths that
   were there before this change.
 - Related to the above, the help output could be significantly
   simplified, since it no longer depends on the command-line.
 - Removed the -verbose option that caused the options to be printed
   during a normal run.  Possible to add back if people want it, but it
   simplifies things if it isn't needed.

Related to #685 and #969.

Change-Id: Ibe735711f650eafaecf28ffb1ed92da97dcb81b6