alexxy/gromacs.git
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 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 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 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 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 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

10 years agoFixed minor admin issues
Mark Abraham [Fri, 5 Jul 2013 16:41:09 +0000 (18:41 +0200)]
Fixed minor admin issues

- The installguide.xhtml file is intermediate output, and
  should not be versioned
- There is no need for HTML files to have date stamps to maintain
- Bumped some version numbers

Change-Id: I2783501f697ee1eae557fdbf365a7aaf5d640500

10 years agomore pkg-config fixes
Christoph Junghans [Sat, 6 Jul 2013 00:48:29 +0000 (18:48 -0600)]
more pkg-config fixes

* fixed a typo from I57897609b9bbc558db01c237d3e24d78aa25a5ca
* fixed name of libmd in libmd.pc

Change-Id: I6be35d8f1c0d53d4e4298967f0dc63de2205a663

10 years agoBump version after 4.6.3 release
Mark Abraham [Mon, 1 Jul 2013 18:25:08 +0000 (20:25 +0200)]
Bump version after 4.6.3 release

Change-Id: I1d99c36e090b25ae70d7476715e97b972ae2778c

10 years agoFixed some inconsistencies in pkg-config files
Christoph Junghans [Thu, 4 Jul 2013 19:20:23 +0000 (13:20 -0600)]
Fixed some inconsistencies in pkg-config files

Change-Id: I57897609b9bbc558db01c237d3e24d78aa25a5ca

10 years agoSplit AnalysisDataStorageFrame into two.
Teemu Murtola [Sun, 2 Jun 2013 12:03:23 +0000 (15:03 +0300)]
Split AnalysisDataStorageFrame into two.

Main changes:
- Move parts of AnalysisDataStorageFrame that are only used internally
  by the data storage into a separate class, which is internal to
  datastorage.cpp.  The remaining public interface now only contains
  methods that are required to construct the in-progress frame/point
  set.
- Make AnalysisDataStorageFrame have a separate vector of column values,
  which then get transfered into the actual storage when necessary.
  This part is required for handling multipoint storage.
- Only keep AnalysisDataStorageFrame objects for in-progress frames.
  Without this part, the memory usage of full storage would double; now
  the memory usage only increases proportional to the number of
  concurrent data frames.
- Recycle the AnalysisDataStorageFrame objects for subsequent frames.
  Avoids memory allocation, as the temporary column values don't need to
  be reallocated for each frame.

These changes clarify the responsibilities in the code, and allow for a
much cleaner implementation of multipoint storage (subsequent commit).

The implementation may not be as clean as possible, but it will see
further changes in subsequent commits.

Refactoring in preparation for #869 and #1010, no functional change.

Change-Id: I40928ff10c5aded3b094604b37349b9fd174d267

10 years agoSwitch remaining main() functions and copyrite.c to C++.
Teemu Murtola [Sat, 29 Jun 2013 04:59:18 +0000 (07:59 +0300)]
Switch remaining main() functions and copyrite.c to C++.

Required to be able to use gmx::ProgramInfo from these (done in
separate commit), and simplifies the compilation of mdrun as well.

Resolved compiler/cppcheck/clang warnings that were present in these
files.  Some include file clean-up, motivated by the fact that force.h
causes warnings when included in C++ files, and fixing that requires
fixing #1294, where the solution is not yet decided on.

Change-Id: I69f4200c1c1783340d88381a6aca82151d1230cb

10 years agoRemove g_highway and vbox.c.
Teemu Murtola [Fri, 28 Jun 2013 11:52:10 +0000 (14:52 +0300)]
Remove g_highway and vbox.c.

g_highway hasn't been included in the build for a long time (never for
CMake), so I don't think anyone will miss it.  No need to keep it up to
date with changes done in program initialization for the wrapper binary.

vbox.c seems unused.

There are some other source files under src/ngmx/ that contain a main()
and are not included in the current build, but those seem some kind of
test programs, and don't seem to use much outside src/ngmx/, so left
them alone for now.

Related to #673.

Change-Id: I8b24f58450969e432dff677b8a9659e7bc544e00

10 years agoFurther copyrite.h cleanup.
Teemu Murtola [Fri, 28 Jun 2013 04:13:13 +0000 (07:13 +0300)]
Further copyrite.h cleanup.

- Rename thanx() to gmx_thanx().
- Make it responsibility of the wrapper binary to call gmx_thanx(),
  removing most existing calls.
- Remove unnecessary copyrite.h includes (many of them made unnecessary
  by the above change).
- One fix in qm_gamess.c that caused uncrustify to not parse the file
  correctly.

Change-Id: Ie74cdefa14f03b921f94d4b5931eb8e35a09f5af

10 years agoCorrected definition of EEL_USER
Mark Abraham [Tue, 25 Jun 2013 13:59:00 +0000 (15:59 +0200)]
Corrected definition of EEL_USER

Looks like a copy-paste typo occured at some point in the nbnxn
development. EEL_USER is only used in runner.c, and only to issue a
fatal error with user-supplied non-bonded potentials. That clearly
should be not applicable to eelPMESWITCH.

Fixes #1289

Change-Id: I4e987c81aec81a920779dd29d7c52e8b6d233b45

10 years agoComprehensive hwinfo structure concurrency fix.
Sander Pronk [Tue, 4 Jun 2013 20:31:08 +0000 (22:31 +0200)]
Comprehensive hwinfo structure concurrency fix.

The hwinfo structure and structures contained therein are inherently
global to any mdrun processes/ranks. This patch makes sure that
- The hwinfo structure is shared among all threads
- Only one thread creates a hwinfo structure
- The hwinfo structure is safe to read for all threads after they
    obtain it

In addition, it fixes the detection for pthread_setaffinity in thread_mpi.

This fixes concurrency issues with thread affinity settings with or
without MPI, and makes runner.c slightly easier to read because the
concurrency logic is pushed to gmx_detect_hardware.c

Fixes #1270, #1254

Note that #1254 issue 3 seems to be an OpenMPI bug.

Change-Id: I236e81923324d7873f3d8633889b91c7c02a7843

10 years agoScript for running uncrustify for modified files.
Teemu Murtola [Wed, 13 Feb 2013 11:51:07 +0000 (13:51 +0200)]
Script for running uncrustify for modified files.

Comments in the script explain how to use it manually or automatically.
The script uses the git filter attribute to indentify which files to run
uncrustify for.  This makes it possible to configure a git filter for
running uncrustify instead of using the script.  This is also described
in the script comments.

The script is easily extensible to do other types of automatic
reformatting, e.g., to check/add copyright headers.

Also contains a pre-commit hook for running uncrustify.  Currently only
checks the formatting; does not yet automatically reformat anything, as
it is a bit unclear what is the best way to do that.

Related to #845.

Change-Id: I389f2ebf43182d4827d1ec10cb6c1332bd4bf8de

10 years agoFix overeager VdW radii change note.
Teemu Murtola [Fri, 28 Jun 2013 03:34:13 +0000 (06:34 +0300)]
Fix overeager VdW radii change note.

Only print the note about changed VdW radii if the VdW radii are
actually used (and not for all tools that use any guessed property such
as masses).

Also ran the file through uncrustify.

Change-Id: I012ebe5c312c19082d0b066ae14e803196565a16

10 years agoMinor tweaks to qm_orca.c
Justin Lemkul [Wed, 19 Jun 2013 13:07:58 +0000 (09:07 -0400)]
Minor tweaks to qm_orca.c

Formatting fixes for readability and better screen output.  Also replaced
gmx_call() by gmx_fatal() for more sensible error reporting.

Change-Id: I7669fe2b1c83c6bf8fb5d24760d8acdb0919c46c

10 years agoFixes to config.h.cmakein to set GMX_QMMM_ORCA.
Justin Lemkul [Wed, 19 Jun 2013 11:47:30 +0000 (07:47 -0400)]
Fixes to config.h.cmakein to set GMX_QMMM_ORCA.

Installing using ORCA for QM calculations would proceed without
any issue, but the mdrun executable was nonfunctional because
GMX_QMMM_ORCA was never #defined, so the code was not correctly
compiled.

Fixes #1286

Change-Id: I230ded2d3cdbd9c5fc3e865d0b20049effb16766

10 years agoMore flexible position input for nbsearch routines.
Teemu Murtola [Fri, 17 May 2013 09:25:57 +0000 (12:25 +0300)]
More flexible position input for nbsearch routines.

In addition to single positions, it is now possible to do a full
pairwise search between two set of positions.  Introduced a helper class
that encapsulates all information about the positions, such that all
methods can take this class as input, and all different forms of
initializing the positions only needs to be implemented once in this
class.  Also made it possible to pass selections directly to the
neighborhood search routines and removed deprecated
Selection::positions(), which was only useful in combination with the
nbsearch code.

Part of #866.

Change-Id: I1829d981ddff16a98c5a2bae873cc3589ef44d4a

10 years agoC++-ify analysis nbsearch more.
Teemu Murtola [Sun, 12 May 2013 11:38:35 +0000 (14:38 +0300)]
C++-ify analysis nbsearch more.

- Use static_cast instead of C casts throughout.
- Use more C++-style comments.
- Use the same pattern for startPairSearch() as for initSearch() to
  allow multiple concurrent searches.
- Use std::vector instead of explicit memory allocation for the grid
  cell management.  Memory is still managed explicitly for rvec and ivec
  arrays, since they can't be put into std::vector.
- Make most members of the implementation classes private to clarify the
  code (the implementation class is now explicitly responsible for
  managing its internal state).

Part of #866.

Change-Id: I2af5552b696644f954957f96705baabd891284a9

10 years agoRemove C API for analysis neighborhoor search.
Teemu Murtola [Sat, 11 May 2013 05:41:34 +0000 (08:41 +0300)]
Remove C API for analysis neighborhoor search.

Makes it easier to refactor the C++ API, when no consideration needs to
be put into maintaining the C interface.  If really necessary, this can
be reimplemented on top of the C++ API later.

Nearly the whole nbsearch.cpp file changes, but most of this is
mechanical replacement.  Kept the order in the code as same as possible
to make it easier to see that the logic is not changing.

The high-level changes are:
 - Move members of gmx_ana_nbsearch_t to the appropriate implementation
   classes and suffix them with an underscore.
 - Move static helper functions into members of the appropriate
   implementation classes.  This and the above are responsible for
   majority of the changes, as 'd->member' becomes 'member_' on most
   lines.
 - Move the declarations of the C++ implementation classes to the
   beginning of the file.
 - Move all Doxygen documentation to the classes.
 - Restructure the C++ classes a bit to remove some workarounds that
   were necessary to use the C API underneath.  Most notably, the forced
   search mode is now passed directly to the initialization function,
   removing some extra boolean flags, and the const methods in
   AnalysisNeighborhoodPairSearch are now really const.
Also some minor refactoring included here:
 - Remove use of cbrt(), and thus dependency on config.h.
 - Some conversion to C++ patterns: use of static_cast and moving
   variable declarations close to the first use.
Will continue the clean-up in subsequent commits to make it easier to
review that this part really does not change the old functionality.

Part of #866.

Change-Id: I40be305704e17d58f8cb906ad5fa69ea179ece15

10 years agoBetter concurrency support for analysis nbsearch.
Teemu Murtola [Sun, 5 May 2013 09:55:31 +0000 (12:55 +0300)]
Better concurrency support for analysis nbsearch.

AnalysisNeighborhood::initSearch() now supports concurrent calls from
multiple threads such that each call creates an independent search.
A pool of search objects is kept allocated to avoid constant
reallocation of the data structures.

This allows using the neighborhood search routines transparently in
thread-parallel analysis tools after that is implemented in the
framework.  The changes in the template demonstrate how this simplifies
the tool code.

Part of #866.

Change-Id: If469284671ec66e249e138e59da7cc87a8f4ac65

10 years agoFix analysis neighborhood search for 2D/screw PBC.
Teemu Murtola [Sun, 5 May 2013 03:48:16 +0000 (06:48 +0300)]
Fix analysis neighborhood search for 2D/screw PBC.

The gridding implementation did not work correctly in these cases, but
could get triggered.  For now, a simple all-pairs search is always used
in these cases.

Related to #866 and #651.

Change-Id: Iad066f3ea5964e97e1a29a0a20c5725f205509c8

10 years agoProper C++ API for analysis neighborhood search.
Teemu Murtola [Thu, 18 Apr 2013 19:02:01 +0000 (22:02 +0300)]
Proper C++ API for analysis neighborhood search.

Replace the dummy C++ wrapper with a more C++-like API for the
neighborhood search routines that are part of the selection code.
Subsequent commits will implement a few additional features to the API,
but split those off from here to keep things easier to review.

Implementation underneath is still the same as earlier.
Will remove the old C functions in a separate commit.
Changed the free volume tool to use the C++ API in preparation for this.

Added some basic tests for the functionality using the new API, which
should increase the percentual coverage in this part of the code
significantly.

Part of #866 and #651.

Change-Id: I139866b82cb048f1676d187b0cf6e5d270d4d32b

10 years agoFix some issues found by cppcheck-1.58.
Teemu Murtola [Thu, 30 May 2013 04:05:26 +0000 (07:05 +0300)]
Fix some issues found by cppcheck-1.58.

Some are real (although unlikely) bugs, others are just removal of
unnecessary code or stylistic changes. Fixes about 1/3 of the issues
this version of cppcheck finds; the remaining aren't as easily fixed and
most look like false positives.

Change-Id: Ic7ba3cc26be9906e037ecec9f8e63739ac3786be