alexxy/gromacs.git
10 years agoMoved ngmx to C++, renamed it to view.
David van der Spoel [Sat, 31 Aug 2013 12:44:53 +0000 (14:44 +0200)]
Moved ngmx to C++, renamed it to view.

Part of #673
Moved all files to src/programs/view and made executable
part of the gmx binary as "gmx view".
Removed warnings.
Replacing min and max by std::min and std::max.
Removed warning in asize macro.
Changed typedef enums to C++ enums.
Changed gmx_bool to bool.
Removed g_showcol, g_xrama, xstat, test_ngmx_dialog

Change-Id: I88fc541e27705c498703006f461dd2b9b1e6a3f5

10 years agoRemove repeat sfree(state->nosehoover_xi)
Mark Abraham [Thu, 19 Sep 2013 16:28:21 +0000 (18:28 +0200)]
Remove repeat sfree(state->nosehoover_xi)

I2acb48b829c introduced a repeat sfree of nosehoover_xi,
this patch removes the old one. As reported by Christian Wennberg.

Change-Id: Ifef1096f23c595873ae7a35f0fad688783ab1ed8

10 years agoCMake cleanup.
Teemu Murtola [Sun, 28 Jul 2013 04:38:48 +0000 (07:38 +0300)]
CMake cleanup.

- Remove unused config.h defines and some detection code for them.
- master always has a C++ compiler, so remove unnecessary checks for
  CMAKE_CXX_COMPILER_LOADED.
- Remove unused/unnecessary CMake code.
- Some whitespace cleanup.

Change-Id: If24b3fe07b0598bbd69eec55c5aabf5debb7fc89

10 years agoMerge branch 'release-4-6'
Teemu Murtola [Fri, 20 Sep 2013 03:23:30 +0000 (06:23 +0300)]
Merge branch 'release-4-6'

Merged up to the nbnxn kernel split (i.e., left the current last commit
in release-4-6 yet unmerged).

Conflicts:
    CMakeLists.txt
        (master had changed indentation and added code in suffixing that
         was moved in release-4-6)
    src/gromacs/gmxlib/statutil.cpp
        (code changed in 4.6 removed from master)
    src/gromacs/mdlib/expanded.c (took both changes)
Extra changes:
    src/gromacs/mdlib/nbnxn_search.c (added back a cppcheck suppression)

Change-Id: Ib1d95e53d69714404e594de45442b41d48b5c584

10 years agoMake uncrustify.sh more verbose on errors.
Teemu Murtola [Sat, 14 Sep 2013 11:36:37 +0000 (14:36 +0300)]
Make uncrustify.sh more verbose on errors.

Capture the output of uncrustify instead of silencing it, and print it
out if uncrustify fails to run for any reason.

Change-Id: Iaefd89b586feb7e3148ad48a2b0f65d69ca7ac17

10 years agoUniform code path for writing out console help.
Teemu Murtola [Sun, 8 Sep 2013 17:34:42 +0000 (20:34 +0300)]
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

10 years agoFramework for help export from wrapper binary.
Teemu Murtola [Thu, 5 Sep 2013 03:22:08 +0000 (06:22 +0300)]
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

10 years agoRemove forcefield-scan feature
Mark Abraham [Mon, 16 Sep 2013 10:41:21 +0000 (06:41 -0400)]
Remove forcefield-scan feature

Refs #1292

Change-Id: I05d8dec45665d5dc3b72b72d312240abbd2983c7

10 years agoAdd option to build a standalone mdrun binary only.
Teemu Murtola [Sun, 25 Aug 2013 04:24:28 +0000 (07:24 +0300)]
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

10 years agoMove mdrun into the wrapper binary.
Teemu Murtola [Sat, 24 Aug 2013 18:59:05 +0000 (21:59 +0300)]
Move mdrun into the wrapper binary.

Part of #685.

Change-Id: I92d9ad5705356b2ab1e132383a5fee79ade0f4d0

10 years agoMake parse_common_args() not exit.
Teemu Murtola [Sun, 1 Sep 2013 11:30:01 +0000 (14:30 +0300)]
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

10 years agoRemove unused -man output formats.
Teemu Murtola [Sat, 31 Aug 2013 19:25:34 +0000 (22:25 +0300)]
Remove unused -man output formats.

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

Related to #969.

Change-Id: I32e5cec872527a779fad9fe742135bcfb30a13a7

10 years agoMake gmx_ana_pos_t a C++ class.
Teemu Murtola [Thu, 29 Aug 2013 17:39:22 +0000 (20:39 +0300)]
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

10 years agoAdd some legends to C++ tool output.
Teemu Murtola [Sat, 24 Aug 2013 17:41:29 +0000 (20:41 +0300)]
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

10 years agoRemove duplicate .nr members from selection structs.
Teemu Murtola [Wed, 28 Aug 2013 18:04:54 +0000 (21:04 +0300)]
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

10 years agoRemove gmx_ana_indexmap_t::bMapStatic.
Teemu Murtola [Wed, 28 Aug 2013 17:38:57 +0000 (20:38 +0300)]
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

10 years agoMove gmx_ana_pos_t::g into gmx_ana_indexmap_t.
Teemu Murtola [Tue, 27 Aug 2013 16:14:38 +0000 (19:14 +0300)]
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

10 years agoSupport for parallel data modules.
Teemu Murtola [Mon, 24 Jun 2013 17:30:32 +0000 (20:30 +0300)]
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

10 years agoAbstractAnalysisData module handling into a separate class.
Teemu Murtola [Sun, 16 Jun 2013 03:32:21 +0000 (06:32 +0300)]
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

10 years agoMerge "Merge branch release-4-6 into master"
Teemu Murtola [Sun, 1 Sep 2013 09:39:18 +0000 (11:39 +0200)]
Merge "Merge branch release-4-6 into master"

10 years agoUpdated g_cluster
David van der Spoel [Sat, 3 Aug 2013 17:28:27 +0000 (19:28 +0200)]
Updated g_cluster

Rewrote the monte-carlo algorithm to do something useful,
namely generate a smooth trajectory through all the
frames where the ends of the trajectory are at maximum
RMSD from each other.

Change-Id: I9a5ebd127e5d34a19a79becfd8f830b11c82839f

10 years agoClean-up and improvements in C++ tools.
Teemu Murtola [Fri, 23 Aug 2013 04:25:39 +0000 (07:25 +0300)]
Clean-up and improvements in C++ tools.

- Make gmx-select accept multiple selections for all output options.
- Make gmx-gangle and gmx-distance accept dynamic selections.
- Remove -dump option from gmx-select and remove commented code related
  to the same in the other tools.

Part of #665.

Change-Id: I5e3c4caf2928a95c2620d969b4f447272ad9b051

10 years agoFix detection and suggestion in gmx_cpuid for IBM QPX
Mark Abraham [Tue, 30 Jul 2013 14:12:37 +0000 (16:12 +0200)]
Fix detection and suggestion in gmx_cpuid for IBM QPX

Also made some variable names more descriptive.

Change-Id: I0eaac7ff6ce5cb0da82d9c54d10c555850a3dad1

10 years agointroduced nbnxn data structure for bounding boxes
Berk Hess [Mon, 22 Jul 2013 12:54:49 +0000 (14:54 +0200)]
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

10 years agoFixes for Bluegene/Q
Mark Abraham [Fri, 26 Jul 2013 08:36:35 +0000 (10:36 +0200)]
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

10 years agoConsolidated NBNxN SIMD kernel utility routines
Mark Abraham [Thu, 27 Jun 2013 17:11:00 +0000 (19:11 +0200)]
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

10 years agoFix minor wallcycle output issues
Mark Abraham [Mon, 19 Aug 2013 15:22:56 +0000 (17:22 +0200)]
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

10 years agoFixed GMX_DD_DUMP_GRID
Mark Abraham [Thu, 15 Aug 2013 07:31:15 +0000 (09:31 +0200)]
Fixed GMX_DD_DUMP_GRID

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

Change-Id: I682154a0986fdbd73ae414264982a68fed164c87

10 years agoFine-tune copyright printing.
Teemu Murtola [Mon, 29 Jul 2013 04:46:30 +0000 (07:46 +0300)]
Fine-tune copyright printing.

Based on discussion in earlier changes, made the copyright on by
default.  It is now possible to suppress it while keeping other parts of
the startup header with -nocopyright.

Simplify the copyright printing code and make the output more in line
with the rest of the startup header (left-aligned etc.).  Move the
copyright to the beginning of the header to have all diagnostic
information available under it; that makes it easier for the user (and
for us in bug reports) to spot all the relevant information.

Also adjust the wording of the license text; LGPL does not automatically
place a user program that calls GROMACS under the same license, so
changed "This program" to "GROMACS".  Made a similar clarification to
the "Written by" text.

Part of #1209.

Change-Id: If104074995db891702dd9eb410fe811408add4ad

10 years ago[RFC] Really uniform startup path for all binaries.
Teemu Murtola [Tue, 23 Jul 2013 15:40:53 +0000 (18:40 +0300)]
[RFC] Really uniform startup path for all binaries.

Main changes:
- Move MPI_Init() call from init_par() to a separate initialization
  method that is now called from the beginning of the wrapper binary.
  Similarly, make it the wrapper binary's responsibility to call
  MPI_Finalize().  Also make this behave uniformly for the wrappers that
  implement main().
- Call MPI_Abort() on exceptions.
- Move the LegacyCmdLineWrapper from legacymodules.cpp to
  cmdlinemodulemanager.cpp, rename it, and add methods to access it in
  other contexts as well.
- Merge g_pme_error into the wrapper binary.  Make mdrun and other
  remaining binaries to use this code path for initialization, even
  though they still remain independent binaries.
- Remove unnecessary code from statutil.*, now that the common options
  are handled by CommandLineModuleManager.

All executables now start up through CommandLineModuleManager::run(),
making it easy to adjust common behavior.

RFC because I don't have easy access to an environment where I could
test MPI or X11 code; thus I would appreciate it if someone could test
these parts (if Jenkins verification is not sufficient).

Part of #685.

Change-Id: I2cb9b0745c084b3d77f95ca163aa6745af01c1bc

10 years agoStatistics for gmx-distance.
Teemu Murtola [Tue, 20 Aug 2013 17:36:58 +0000 (20:36 +0300)]
Statistics for gmx-distance.

Add support for calculating statistics more or less like g_bond has into
the new C++ gmx-distance tool.  The output format may not be as nice,
but one can at least get the same numbers out.

Extended the averaging analysisdata modules to handle multiple data sets
to support this, which required changing the data structure slightly
(this is the source of most modifications to existing data in XML files;
new tests/new output data of course adds additional entries).
Supporting changes in the plotting to handle missing values and errors,
and in test code to handle missing data points.

Part of #665.

Change-Id: If5f0b54d6d3eec0145625de9ab745e6ba9dc468a

10 years agoLifetime statistics into gmx-select.
Teemu Murtola [Sat, 17 Aug 2013 18:36:17 +0000 (21:36 +0300)]
Lifetime statistics into gmx-select.

This provides a lot more flexible alternative to g_dist -lt.

Added an analysisdata module that computes lifetime statistics and test
for it.  Currently tuned for this one application, but should be
possible to make more flexible if required.  Using this module, the
implementation in gmx-select is straightforward.

Part of #665.

Change-Id: I8bff89599c9d8a820c761b426c01ceafa9afcc5a

10 years agoRemove OpenMM
Mark Abraham [Fri, 5 Jul 2013 21:51:40 +0000 (23:51 +0200)]
Remove OpenMM

This code is not functional in release-4-6 branch, and nobody has
plans to fix it. Many things are already out of sync in the duplicated
code. This will get much worse as time passes, so simplifying the few
places that still touch the main code base has slight advantages. And
nobody will feel the need to clean up the duplicated code.

Change-Id: I06c2eb71042fd830fd888fbee1b5e3efcae0379d

10 years agofixed parallel normal modes with PME
Berk Hess [Mon, 12 Aug 2013 09:08:13 +0000 (11:08 +0200)]
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

10 years agoReplacement for g_bond and g_dist.
Teemu Murtola [Wed, 14 Aug 2013 18:21:03 +0000 (21:21 +0300)]
Replacement for g_bond and g_dist.

Added a proper implementation for the 'distance' tool.
It should now do most of what g_bond or g_dist can do.
The help text related to the distance histogramming is somewhat
different from g_bond, but the behavior is more or less the same; now
the help text just describes how it is actually implemented.

The main things missing are proper legends in the output files, some
statistics output (g_bond), and g_dist -dist and g_dist -lt.
g_dist -dist can already be done with g_select, and g_dist -lt also
makes most sense to implement separately into g_select instead.

Part of #665.

Change-Id: I293cf8f0d30480e1873d5dcdef414f0089f177a6

10 years agoProductive afternoon of meetings... more quotes!
Mark Abraham [Thu, 15 Aug 2013 15:30:33 +0000 (17:30 +0200)]
Productive afternoon of meetings... more quotes!

Change-Id: Ib83511d76e23db13cb3a995bc6c6c08a11ffd552

10 years agoSupport for multiple analysis data sets in modules.
Teemu Murtola [Wed, 12 Jun 2013 17:49:20 +0000 (20:49 +0300)]
Support for multiple analysis data sets in modules.

Main changes:
- Support for multiple data sets in the input data for most analysisdata
  modules.  For the clearest output, standard deviation values were
  moved from a separate column into the error value instead, which
  required updating a lot of unit test reference data.
- Support for computing multiple sets of angles using 'gmx gangle'.
- Extend the analysis data test utilities to handle multiple data sets
  when comparing against reference data.
- Add some unit tests for the new functionality.

Supporting changes:
- Add support for providing error values through AnalysisDataTestInput.
- AbstractArrayData now provides the means to use the full functionality
  of AnalysisDataValue for constructing the data.  AnalysisDataValue
  objects were already used internally for storage, so this amounts to
  exposing accessors for those objects instead of wrapping them in
  simple setters/getters for the value only.

Part of #1010.

Change-Id: I63abc05ab7e24362169e7d9ba0fa6ffc561be9d6

10 years agoBase support for multiple analysisdata data sets.
Teemu Murtola [Fri, 7 Jun 2013 11:17:52 +0000 (14:17 +0300)]
Base support for multiple analysisdata data sets.

Make it possible for an AbstractAnalysisData object to contain multiple
data sets.  See #1010 for the rationale for implementing this.

The main changes are:
- Support for specifying the number of data sets and the number of
  columns for each data set in AbstractAnalysisData and classes deriving
  from it.  At the same time, improved checking the constraints for
  analysis data modules, so that the restrictions for calling the
  various set*() methods are now more uniform.
- Modeling multiple data sets in the dataframe.h interfaces: now the
  point set has an additional attribute, specifying the data set.
  Data with multiple data sets now always has multiple point sets.
  There is exactly one per data set if it is not multipoint.
- Support for storage in AnalysisDataStorage. This is straighforward
  extension of multipoint storage.
- Support for creating the data sets in AnalysisDataStorage and
  AnalysisData.
- Adjust unit test framework to support at least basic testing of
  multiple data sets.

Will implement support for multiple data sets in the modules, including
the angle trajectory analysis module, in a separate change to keep the
amount of simultaneous changes limited.

Part of #1010.

Change-Id: Ieb373638d25ecd885d563c467bff893dd47b23b5

10 years agoRemove superfluous selection names from refdata.
Teemu Murtola [Thu, 2 May 2013 18:16:05 +0000 (21:16 +0300)]
Remove superfluous selection names from refdata.

Now that there are proper tests for handling the selection names,
removed the testing of the name from most other tests, since the name
was always identical to the selection text.

Part of #651.

Change-Id: I3844031f94336c9934d79fec711920eed04cea4a

10 years agoAdd check for unsorted index groups in selections.
Teemu Murtola [Thu, 2 May 2013 18:05:48 +0000 (21:05 +0300)]
Add check for unsorted index groups in selections.

Selections did not work properly if an index group was used that
did not have the atom indices in strictly ascending order.
Added a check for this, and tests that check that this now gives an
error.

Refactored the way index group references are resolved such that the
logic and the related error messages are now only in one place:
selelem.cpp.  This resolves TODOs about improving the error messages.
Also made this piece of code to use exceptions for error reporting.

Related to #651 and #655.

Change-Id: I2318823b1be74775d0a0f8bd4a3c58b0aed1aba1

10 years agoTreat exceptions better in interactive selections.
Teemu Murtola [Thu, 2 May 2013 17:55:42 +0000 (20:55 +0300)]
Treat exceptions better in interactive selections.

If a user input error occurs in an interactive selection parser, the
message is now printed and parsing continues, like it used to work
before exceptions were introduced here.  Although most code still does
not use exceptions for user error reporting, this makes the code more
future-proof (and a subsequent commit will add some exceptions that take
advantage of this).

Refactored exception message formatting to support this, removing a TODO
related to duplicated code in the process.

Related to #655 and #838.

Change-Id: I4ba23c6dd1005f61d50515e6857a5dc23fc1768a

10 years agoReordered FFTW fatal error; avoids using unset variables
Mark Abraham [Fri, 9 Aug 2013 14:44:11 +0000 (16:44 +0200)]
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

10 years agoFixed reference SIMD code to work with MSVC
Mark Abraham [Tue, 30 Jul 2013 15:18:08 +0000 (17:18 +0200)]
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

10 years agoAdd unit tests for index groups in selections.
Teemu Murtola [Wed, 1 May 2013 17:55:45 +0000 (20:55 +0300)]
Add unit tests for index groups in selections.

Add tests for using the "group" keyword in selections to select external
index groups, and in particular for directly providing an index group as
the selection value.

Fixed a master-only issue in handling the selection name in the latter
cases.  Also fixed master-only memory leaks and other issues in
gmx_ana_indexgrps_init().

Part of #651.

Change-Id: I0d908213f109ced9ab6708e55c6acf53371f6aa1

10 years agoAdd unit test coverage for simple selection keywords.
Teemu Murtola [Tue, 30 Apr 2013 03:51:34 +0000 (06:51 +0300)]
Add unit test coverage for simple selection keywords.

"molindex" and "atomtype" keywords are now covered by separate tests.
Also updated one test to use the "z" keyword to have that covered.
Added a comment in sm_simple.cpp about unreachable code that is not
currently covered by tests.

Part of #651.

Change-Id: Id9ac9ea8e7d144214537265d9ed89335684934f1

10 years agoFile utils to C++.
Teemu Murtola [Sun, 14 Jul 2013 03:45:55 +0000 (06:45 +0300)]
File utils to C++.

Preparation for moving get_libdir() into gmx::ProgramInfo.

Change-Id: Ic13b0567e7528e43ea03298f835b3d842ab44c28

10 years agoAdd an option to disable all asserts for coverage.
Teemu Murtola [Wed, 24 Jul 2013 10:08:47 +0000 (13:08 +0300)]
Add an option to disable all asserts for coverage.

Related to #1300; see there for rationale.

Change-Id: I76c1a4e676a543922b0e027e6693416175797d76

10 years agoFixing problem caused by overflow in expanded ensemble.
Michael Shirts [Fri, 2 Aug 2013 02:39:28 +0000 (22:39 -0400)]
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

10 years agoRefactored preparation of buffer for NBNxN table loads
Mark Abraham [Tue, 30 Jul 2013 16:18:03 +0000 (18:18 +0200)]
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

10 years agoProperly finalize MPI on mdrun -version. Fixes #1313
Carsten Kutzner [Wed, 31 Jul 2013 16:34:51 +0000 (18:34 +0200)]
Properly finalize MPI on mdrun -version. Fixes #1313

Change-Id: I1ae5f342da96980df322770d134555e2dc9fe712

10 years agoFixed example code function name
Mark Abraham [Tue, 30 Jul 2013 19:19:56 +0000 (21:19 +0200)]
Fixed example code function name

Change-Id: If0c54a8c42be7b978805bf3f94e46904de6e8826

10 years agocmake: Improve some error messages
Christoph Junghans [Tue, 30 Jul 2013 16:45:03 +0000 (10:45 -0600)]
cmake: Improve some error messages

Lessons learned from the Q-bio summer school

Change-Id: I521a08ba3a83566582137740a0d097c0637d7d3e

10 years agoRemoved unused variables
Mark Abraham [Sat, 27 Jul 2013 23:17:36 +0000 (01:17 +0200)]
Removed unused variables

Change-Id: Iee3ae450996ae125e65f9e4c0dd4cc42128fdf63

10 years agoHandle wrapper binary options also for symlinks.
Teemu Murtola [Tue, 23 Jul 2013 04:08:19 +0000 (07:08 +0300)]
Handle wrapper binary options also for symlinks.

Now the -quiet, -version, and -copyright options also work when the
binary is invoked through a symlink (so, e.g., g_angle -quiet suppresses
the startup headers).  They also work for the user tools, implemented
using the single-module wrapper.

Extended the command-line parser to support parsing only recognized
options and removing those from the command line while leaving the rest
untouched.

Related to #685 and #1209.

Change-Id: I740f70386d89694246c3e25ba0a1c1c4df17dc6b

10 years agoBetter command-line option handling for tests.
Teemu Murtola [Sun, 21 Jul 2013 05:34:18 +0000 (08:34 +0300)]
Better command-line option handling for tests.

The options are now registered using global initializers (somewhat ugly,
but is the same mechanism as used by GTest for registering the test
cases).  This makes them all available on startup in initTestUtils(),
allowing it to print help text for them.  It also properly allows having
multiple option definitions in the same binary.  This did compile with
the previous approach as well, but didn't always work because of
limitations in the command-line parser.

The command-line parser now accepts, but does not require, a GNU-style
-- prefix for command-line options, and gives an error for unknown
options starting with --.  While at it, also made the parser accept
options that start with digits, and even options consisting of only
digits (the latter requires one to use a double dash).

Add a helper for ignoring return values of
__attribute__((warn_unused_result)) functions (works only for C++), and
remove unused function from ngmx.cpp that had previously had a dummy
variable for this purpose (the dummy variable was removed when
converting to C++).

Change-Id: Id1674510c4feb88ffc1d193274a6357cebef3916

10 years agoMerge branch release-4-6 into master
Mark Abraham [Fri, 26 Jul 2013 14:47:13 +0000 (16:47 +0200)]
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

10 years agoUpdated dlist.c to recognize more atom names.
Justin Lemkul [Thu, 25 Jul 2013 20:43:13 +0000 (16:43 -0400)]
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

10 years agonb_kernel_sparc64_hpc_ace_double: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sun, 14 Jul 2013 19:13:04 +0000 (23:13 +0400)]
nb_kernel_sparc64_hpc_ace_double: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: I55ffc910f53826529550c836af5d0c85c773074b
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agonb_kernel_sse4_1_double: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sun, 14 Jul 2013 19:11:04 +0000 (23:11 +0400)]
nb_kernel_sse4_1_double: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: I46b28dbf3a367c877fa7a90801936c9f40ffc8f7
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agonb_kernel_sse2_double: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sun, 14 Jul 2013 19:09:01 +0000 (23:09 +0400)]
nb_kernel_sse2_double: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: I2fa97a6b3e85666707e3dab11bc0da556233caba
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agonb_kernel_avx_256_double: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sun, 14 Jul 2013 19:07:26 +0000 (23:07 +0400)]
nb_kernel_avx_256_double: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: Ia6ca3b66816da852ef13fea145d0c42ac5d17c91
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agonb_kernel_avx_128_fma_double: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sun, 14 Jul 2013 19:05:11 +0000 (23:05 +0400)]
nb_kernel_avx_128_fma_double: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: I3b7849c28b0d6c2e7a446086e7c506cdad881004
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agonb_kernel_sse2_single: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sun, 14 Jul 2013 12:57:39 +0000 (16:57 +0400)]
nb_kernel_sse2_single: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: I878b5c89378eec7f88304fda23dd8747a348a8a9
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agonb_kernel_sse4_1_single: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sun, 14 Jul 2013 12:39:51 +0000 (16:39 +0400)]
nb_kernel_sse4_1_single: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: Ifabba35a46ac8e8fe11b6044b63e6c65947d4912
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agonb_kernel_avx_128_fma_single: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sun, 14 Jul 2013 12:19:09 +0000 (16:19 +0400)]
nb_kernel_avx_128_fma_single: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: I4cd73a5863349a44b11fa9480685ef25df4bed26
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agonb_kernel_avx_256_single: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sun, 14 Jul 2013 11:56:47 +0000 (15:56 +0400)]
nb_kernel_avx_256_single: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: I48b8a816f75bc905c41656924fd0285c8a5aca48
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agoClarified logic in g_wham
Mark Abraham [Tue, 16 Jul 2013 07:39:29 +0000 (09:39 +0200)]
Clarified logic in g_wham

The fragment "!i==0" is less clear than "i!=0," and clang 3.4-SVN even
issues warnings about a possible problem. Checked with Jochen Hub (the
original author) and he agrees the new form is appropriate.

Change-Id: I640e2104b3aa2d740895ee1145e56b731b11350f

10 years agoFind mkl.h on more icc versions
Mark Abraham [Mon, 1 Jul 2013 15:01:09 +0000 (17:01 +0200)]
Find mkl.h on more icc versions

Refs #1110

Change-Id: I0b6bc2497fc2a504b6c29b0697ee9e354fe6cffd

10 years agononbonded and nb_kernel_c: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sun, 14 Jul 2013 11:10:24 +0000 (15:10 +0400)]
nonbonded and nb_kernel_c: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: I75cd722907de96082295dd119217b7b5fea13b19
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agomdlib: clean up -Wunused-parameter warnings
Alexey Shvetsov [Mon, 1 Jul 2013 07:22:01 +0000 (11:22 +0400)]
mdlib: clean up -Wunused-parameter warnings

Clean up (most) of unused params, nbnxn stuff still need cleanup
Also this commit removes some dead (unused) functions

Change-Id: I9aae68266f66a149565c3e5f6e06810db4de287b
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agoUpdate management of linear algebra libraries
Mark Abraham [Mon, 11 Mar 2013 12:30:59 +0000 (13:30 +0100)]
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

10 years agoAdd unit tests for selection position calculation.
Teemu Murtola [Mon, 29 Apr 2013 03:35:41 +0000 (06:35 +0300)]
Add unit tests for selection position calculation.

Add unit tests for most functionality of poscalc.*.  These tests also
cover centerofmass.*.

Fixed two issues:
- POS_MASKONLY calculations had an inconsistent group set in the output
  positions (which was visible in the selection interface, returning
  incorrect set of atoms for the selection).
- Force calculation was incorrect.
These do not affect g_select, so only fixed for 5.0.

Part of #651, related to #1221.

Change-Id: I4dc6475f53fb3b1559bae9296f8c9f3e6dd14bf7

10 years agoAdd five new quotes
Mark Abraham [Tue, 16 Jul 2013 20:51:38 +0000 (22:51 +0200)]
Add five new quotes

(Also bumped line count, which was one too small previously.)

Change-Id: Ic545ae456b3bd2e6df2eadc296b43cda49aec5bc

10 years agoFix pthread detection for GMock
Teemu Murtola [Mon, 22 Jul 2013 15:11:56 +0000 (18:11 +0300)]
Fix pthread detection for GMock

FindPthreads.cmake was removed recently because it was an orphan.
It turns out that isn't true, because GMock was using it.
Rewrote that part of the build system to use the standard
FindThreads.cmake instead.

Also clarified that the CMakeLists.txt is part of the Gromacs build
system instead of being part of Google Mock.

Fixes #1310

Change-Id: I5055569b8534586c4faf3732d0e97c63ad7de408

10 years agoFixes #1312 uninitialized error in g_enemat.
David van der Spoel [Wed, 24 Jul 2013 13:48:58 +0000 (09:48 -0400)]
Fixes #1312 uninitialized error in g_enemat.

Change-Id: Ia0ac6d095dd560f08576aad1b435c92b6de52b3b

10 years agoimplemented plain-C SIMD macros for reference
Berk Hess [Fri, 12 Apr 2013 17:11:09 +0000 (19:11 +0200)]
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

10 years agoRemoved buggy -seppot output
Mark Abraham [Tue, 2 Jul 2013 12:00:15 +0000 (14:00 +0200)]
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

10 years agoMerge "Merge branch release-4-6 into master"
Roland Schulz [Wed, 24 Jul 2013 07:01:05 +0000 (09:01 +0200)]
Merge "Merge branch release-4-6 into master"

10 years agoMerge branch release-4-6 into master
Mark Abraham [Fri, 19 Jul 2013 07:41:13 +0000 (09:41 +0200)]
Merge branch release-4-6 into master

Nothing controversial. Rename detection failed on
gmx_detect_hardware.h, so that resolution is done by hand.

Conflicts:
CMakeLists.txt
admin/mkhtml
src/gromacs/gmxlib/gmx_detect_hardware.c
src/gromacs/mdlib/nbnxn_search.h
src/programs/mdrun/runner.c

Conflict resolved in src/gromacs/legacyheaders/gmx_detect_hardware.h:
include/gmx_detect_hardware.h

Conflicts to do with pkgconfig are mostly not applicable to master
branch (except for change to libgromacs.pc.cmakein to add
@GMX_LIBS_SUFFIX@). Others resolved by deleting the files or change
sets:
src/gromacs/libgromacs.pc.cmakein
src/CMakeLists.txt
src/kernel/libgmxpreprocess.pc.cmakein
src/mdlib/CMakeLists.txt
src/mdlib/libmd.pc.cmakein
src/tools/libgmxana.pc.cmakein

Change-Id: I0c02d3a235b909e4d9ea628bb392ff9173bfc902

10 years agoConvenience methods for implementing main().
Teemu Murtola [Mon, 15 Jul 2013 04:23:06 +0000 (07:23 +0300)]
Convenience methods for implementing main().

Added a method to TrajectoryAnalysisCommandLineRunner that allows a
one-line main() method in user tools, removing some boilerplate code
that could break with Gromacs changes.  Forward the actual
implementation to CommandLineModuleManager, allowing it to do the same
processing as it does for the wrapper binary/symlinks to it.  This
allows for some simplification of TrajectoryAnalysisCommandLineRunner.

An extra method that runs any
  int (*method)(int argc, char *argv[])
method that calls parse_common_args() as main() through
CommandLineModuleManager could also be added, but left out of this
change for now.

Change-Id: I0b0d626fda50abe04c16e90a1c876262dcff81a4

10 years agoImprove program name reporting.
Teemu Murtola [Sun, 30 Jun 2013 09:52:48 +0000 (12:52 +0300)]
Improve program name reporting.

Now, the wrapper binary reports the name of the program as
'gmx-<module>' as soon as a module has been selected.  Error and help
messages are clearer, as well as the header printed during program
start-up.

Change-Id: I2754539ae6815405aeb22e42ad8b5452e525dbb3

10 years agoFix Doxygen warnings.
Teemu Murtola [Mon, 22 Jul 2013 04:47:10 +0000 (07:47 +0300)]
Fix Doxygen warnings.

Ibf32de31 introduced some undocumented members into
gmx::BinaryInformationSettings, which were causing Doxygen warnings.
Jenkins does not catch these in legacyheaders/...

Related to #1209.

Change-Id: I3c5c0c9818966290d3b298422905604b136d01c3

10 years agoUniform "generated by" information in output files.
Teemu Murtola [Fri, 5 Jul 2013 02:58:36 +0000 (05:58 +0300)]
Uniform "generated by" information in output files.

Extend the printBinaryInformation() function to make it possible to
write the lines in a particular comment format.  Use the function to
print out "Generated by" information in several output formats.  Removed
command_line() from statutil.h as it is no longer used.  Replaced most
uses of Program() with ShortProgram() where the actual path was not
relevant.

Also use printBinaryInformation() to print out information into the
mdrun log file.  Again print the copyright header to the beginning of
the log file.

Related to #1209.

Change-Id: Ibf32de318421a10d39f217517005fea408d19fbf

10 years agoMore files to C++.
Teemu Murtola [Wed, 3 Jul 2013 11:00:39 +0000 (14:00 +0300)]
More files to C++.

Switch a few more files to C++ compilation and resolve issues found: add
several extern "C" declarations, remove unused variables, move some
static variables from headers to source files.  Move gmx_ctime_r()
declaration to string2.h; it must be better to have one extra
declaration in an installed header than a mass of repeated declarations
in source files.  Remove a hack in smalloc.h; the code that prompted
that seems to have been removed in the kernel reorganization for 4.6,
and we are anyways not yet compiling a lot of legacy code with C++.
Suppress most scanf() warnings in these files.  Make cppcheck correctly
parse #ifdef __cplusplus blocks.  Add gmx_isnan().

The motivation for this selection of files is that these files write
output files where either command_line() or Program() is used to
indicate the currently running program.  Will replace those calls with a
uniform mechanism in a subsequent commit.

Change-Id: Ic1e90fcc08b1be6d4d6d257215f9523625ab347a

10 years agoOptions for controlling startup output.
Teemu Murtola [Thu, 4 Jul 2013 19:27:17 +0000 (22:27 +0300)]
Options for controlling startup output.

Add a -quiet option to the wrapper binary.  This option suppresses all
startup headers and the gmx_thanx() call in the end.  Restructure
CommandLineModuleManager::run() to avoid multiple paths that all need to
call gmx_thanx() and potentially also print the startup header.

Make -quiet suppress the startup header also in parse_common_args().
Reordering required by this causes invalid command-line option error
messages to be printed before the header gets printed, but this only
affects those few binaries that don't go through the wrapper binary.

Make gmx_print_version_info() callable through printBinaryInformation(),
and do this in the wrapper binary and in parse_common_args() in
response to -version.

Print the copyright in response -copyright in the wrapper binary.  Easy
to add to parse_common_args() as well, but even better would be to merge
the remaining few programs into the wrapper binary.

Part of #1209.

Change-Id: I0c7dddc91065b12f347da12acd82047e2d94b44c

10 years agoBe less verbose with program options.
Teemu Murtola [Fri, 5 Jul 2013 03:33:16 +0000 (06:33 +0300)]
Be less verbose with program options.

Don't print the list of program options by default when running the
Gromacs binaries.  The command line printed as part of the startup
header should provide any diagnostic value there is to this output.
Replace the previous -quiet option (that disabled this output) with
a -verbose option that enables this output again.  Left the mostly no-op
-quiet option there (there is still a special case of -quiet -h used by
gmx_tune_pme), because it will get new use shortly.
Removed the hidden -verb option whose value wasn't used.

Related to #1209.

Change-Id: I9730e1eb08a2ee35d26fd603f48e89f561dee50a

10 years agoPre-emptively fix some C++ warnings.
Teemu Murtola [Tue, 2 Jul 2013 16:51:38 +0000 (19:51 +0300)]
Pre-emptively fix some C++ warnings.

Moved sepdvdlformat from force.h into a source file to avoid warnings
about an unused variable.  These appeared as soon as a C++ source file
included force.h.  As an additional benefit, makes printing this
information more typesafe; this is how #1294 was found.

Change-Id: Id856fbe193d9b4a74ecfb49cba9eab03bad0a7ba

10 years agoUniform and less verbose startup for all binaries.
Teemu Murtola [Sat, 29 Jun 2013 12:24:39 +0000 (15:24 +0300)]
Uniform and less verbose startup for all binaries.

Now all binaries call gmx::ProgramInfo::init() as more or less the first
thing.  Removed set_program_name() as unnecessary, since the above call
does all that.  Make CommandLineModuleManager responsible of also
printing any common startup header, and add a method to suppress this
stderr output in unit tests.

Replace CopyRight() with a less verbose method and move the
responsibility of calling it to parse_common_args().
Added a PCA_STANDALONE flag for parse_common_args() to know when to do
this (can be removed once all programs are part of the wrapper binary).

Left the CopyRight() function still there, in case we want to add a
-license command-line option or similar to print that information.
Currently, it is not called from anywhere.  Removed GMX_NO_CREDITS and
some other unnecessary code from CopyRight().

Most stuff in contrib is broken by this.  There may be more changes
coming to the initialization sequence, and it will be simple to adapt
those programs that people want to get working again, but it is not
worth doing it more than once.

Part of #1209.

Change-Id: I5403dd259ab5f314cce3283aac275a6c26d4818d

10 years agoExtract Doxygen comments within #ifdef __cplusplus.
Teemu Murtola [Tue, 2 Jul 2013 05:51:15 +0000 (08:51 +0300)]
Extract Doxygen comments within #ifdef __cplusplus.

Also add documentation for some undocumented thread_mpi members exposed
by this.

Change-Id: I93ff0770d4032b92dc829257f773c11a93d78caa

10 years agoFixed pdb2gmx -vsite hydrogen -o conf.pdb
Mark Abraham [Tue, 2 Jul 2013 16:33:39 +0000 (18:33 +0200)]
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

10 years agolinearalgebra and fft: clean up -Wunused-parameter warnings
Alexey Shvetsov [Mon, 1 Jul 2013 04:20:01 +0000 (08:20 +0400)]
linearalgebra and fft: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: Iaad4b2d1a98584d6d72cdd1ecf43b788d9753715
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agogmxlib: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sat, 29 Jun 2013 21:11:09 +0000 (01:11 +0400)]
gmxlib: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: Ibbe8d775ca1c37338f968d124d773808a1784eae
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agoSupport for storing multipoint analysis data.
Teemu Murtola [Mon, 10 Jun 2013 18:24:23 +0000 (21:24 +0300)]
Support for storing multipoint analysis data.

Main changes:
- The storage frames now store a vector of "point set info" objects,
  which partition the vector of values into point sets, and annotate
  those sets with extra information (currently, the index of the first
  column).
- The implementation of the frame access wrappers in dataframe.* are
  adapted similarly, and methods are added to allow access to multiple
  point sets within a single frame.
- Added tests for multipoint storage.
- Other changes are adapting to these interface changes.

Still doesn't work perfectly; full support for addColumnModule()
requires reworking the logic in dataproxy.cpp.

Part of #869.

Change-Id: I21141bad83b3f2bb72ece9146aaec02792e6cd0e

10 years agoAdded citation to free volume paper.
David van der Spoel [Thu, 11 Jul 2013 13:25:07 +0000 (15:25 +0200)]
Added citation to free volume paper.

Change-Id: Idcc8d29813e13f259048e7ad6cc1f72b70cd7229

10 years agogmxpreprocess: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sat, 29 Jun 2013 10:10:44 +0000 (14:10 +0400)]
gmxpreprocess: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: I1805a829682baf54047390442bfcfa2a95cd0ee1
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agogmxana: clean up -Wunused-parameter warnings
Alexey Shvetsov [Sat, 29 Jun 2013 05:52:29 +0000 (09:52 +0400)]
gmxana: clean up -Wunused-parameter warnings

Clean up (most) of unused params

Change-Id: Ic9a521924e467d3779ed8c137f7afce44b200378
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agoFixed possible dereference of null pointer
Mark Abraham [Thu, 11 Jul 2013 23:32:16 +0000 (00:32 +0100)]
Fixed possible dereference of null pointer

getpwuid() can return null. For example, Shun Sakuruba reported that
on Cray XE6 compute nodes have passwd.h, but users will not have
passwd entries.

Fixes #1301

Change-Id: I66e8064438fc02591629b0d381bc00afd06795c0

10 years agoMake uncrustify.sh compatible with more recent env
Alexey Shvetsov [Mon, 1 Jul 2013 03:13:25 +0000 (07:13 +0400)]
Make uncrustify.sh compatible with more recent env

recent mktemp wants template in gmxuncrust.XXXXX format
also canonical *nix based which doesnt have -s arg

Change-Id: Ic054c4eef3d4a49b7bae96b1012ec323a347567d
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agoFixed typos in #include guard #defines
Mark Abraham [Tue, 9 Jul 2013 10:15:25 +0000 (12:15 +0200)]
Fixed typos in #include guard #defines

Change-Id: Ifb366f7b10de3a23952ef427bd0e2cb7e282ccea

10 years agoRemove orphan CMake file
Mark Abraham [Tue, 9 Jul 2013 09:39:34 +0000 (11:39 +0200)]
Remove orphan CMake file

This was added in Erik's original CMake commit, updated once,
and has never been used.

Change-Id: Idf920bd87e1bf37d532a5b460be64ef852c43844