alexxy/gromacs.git
9 years agoMerge "Merge release-5-0 into master"
David van der Spoel [Sat, 7 Jun 2014 19:51:18 +0000 (21:51 +0200)]
Merge "Merge release-5-0 into master"

9 years agoMerge release-5-0 into master
David van der Spoel [Sat, 7 Jun 2014 09:54:10 +0000 (11:54 +0200)]
Merge release-5-0 into master

Conflicts:
share/top/gurgle.dat

Change-Id: Ide32a9bfed25cda8eeb7869f1c5a878225c85723

9 years agoClean up FileNameOptionStorage implementation
Teemu Murtola [Sat, 10 May 2014 13:22:15 +0000 (16:22 +0300)]
Clean up FileNameOptionStorage implementation

Get rid of a separate registry, and instead use a static array that
maps OptionFileType to filenm.h types.  FileTypeHandler can now be
created directly with relatively small cost (no memory allocation),
and provide wrappers for the functionality in filenm.h.

Also, use an enum value from filenm.h as the internal type of
FileNameOptionStorage, as the option is not going to get decoupled from
those defines any time soon.  Rename some related variables for clarity.

Change-Id: I8f090c3098adb1f3d48788021f3715bb51a6b80a

9 years agoImprove (Selection|FileName)OptionManager handling
Teemu Murtola [Fri, 9 May 2014 04:40:21 +0000 (07:40 +0300)]
Improve (Selection|FileName)OptionManager handling

The way the managers get passed to the option storage classes is now
reversed: the manager is passed already to the constructor.  This has
several benefits:
 - Already the constructor can use the manager if necessary.
 - It is possible to easily assert on all incorrect usage scenarios.
 - There is much less boilerplate code associated with propagating the
   manager into the storage classes.  There is also less code in
   general: even with an addition of a new file and its copyright
   header, as well as more extensive documentation, there are still
   fewer total lines with the new approach.

The minor disadvantage is that also option types that do not use a
manager get the container passed as an argument to createStorage(), but
they can just ignore the parameter, so the above benefits should clearly
outweigh this.

There was an outdated comment in options.h about the usage of
addSubSection(), which is fixed here.  It is now necessary to add
subsections before any options are added to them, but this is likely a
reasonable constraint for some other future stuff as well.

Change-Id: I4a5e69d3fd596dbe265613f81399219f8b8b19c8

9 years agoReplace all command line parsing with Options
Teemu Murtola [Tue, 6 May 2014 03:32:47 +0000 (06:32 +0300)]
Replace all command line parsing with Options

- Add a more elaborate conversion mechanism in pargs.cpp, that also
  converts the values back for option types where the C and C++ types do
  not match.
- Arguments added in parse_common_args() no longer need to go through
  the conversion, but instead use Options mechanisms directly.
- Time unit option is now handled through TimeUnitManager.  It requires
  extra refactoring to make oenv to use this also internally, but that
  would remove more duplication.
- A few more tweaks to FileNameOption behavior.  The implementation is
  not perhaps the cleanest currently, but refactoring will follow.

There can be some glitches in uncommon cases or on error paths in the
new approach, but in general, error handling should be much more
user-friendly.  Part of future FileNameOption refactoring aims to
improve this part futher.  The only way to find issues is for people to
actually use the new code.

Change-Id: Iea51bd379a3cd04ad62ac76822fcb9f4251ee9d4

9 years agoMove residuetype handling to its own file.
Teemu Murtola [Thu, 5 Jun 2014 04:08:22 +0000 (07:08 +0300)]
Move residuetype handling to its own file.

Change-Id: I430dcb08db65479d4865e032a24effbacc87d28e

9 years agoRemove support for "old" index file format
Teemu Murtola [Thu, 5 Jun 2014 03:28:12 +0000 (06:28 +0300)]
Remove support for "old" index file format

The format wasn't documented anywhere, was at least 10+ years old, and
error handling in the reading code was non-existent.

Change-Id: I5abf97bfaa938f819228cace1eba948b8e45f796

9 years agoMove index.* to topology/
Teemu Murtola [Mon, 2 Jun 2014 18:36:21 +0000 (21:36 +0300)]
Move index.* to topology/

- Move index.h and index.c to topology/.
- Remove some unused and duplicate includes.
- Convert the source file to C++ (scanf issues suppressed for now).

Change-Id: I99374f5d2e53b6c26bf6441b630234177c83affb

9 years agoMerge release-4-6 into release-5-0
Mark Abraham [Thu, 5 Jun 2014 21:34:10 +0000 (23:34 +0200)]
Merge release-4-6 into release-5-0

Conflicts:
src/gromacs/gmxana/gmx_energy.c
Eliminated time parameter (removed in release-5-0),
used gmx_ffclose (fixed in release-5-0).

src/gromacs/mdlib/update.c
Eliminated fplog parameter (removed in release-5-0), otherwise added
new MTS-fixing functionality from release-4-6.

src/programs/mdrun/md.c
Added new code path for MTS (from release-4-6), eliminated
wcycle and bInitStep parameters (from release-5-0).

Change-Id: I303bb649ed2373656aa4420d0afb27f738a9ea30

9 years agoFix constraint virial with multiple time stepping
Berk Hess [Wed, 14 May 2014 20:36:29 +0000 (22:36 +0200)]
Fix constraint virial with multiple time stepping

With multiple time stepping the additional nstcalclr-1 force
contribution was constrained to remove it from the virial.
This procedure neglected the non-linear contribution due to
the rotation of constraints. Now the contribution of this force
component to the coordinate update is constrained instead and
the corresponding virial contribution is subtracted from the
constraint virial.

Fixes #1400

Change-Id: If3217f52808bf7491998324f8dc3161bc003ec1b

9 years agoNew quotes
Mark Abraham [Mon, 2 Jun 2014 11:30:22 +0000 (13:30 +0200)]
New quotes

Change-Id: Ia8494c51d7bce41594152644a4a25b9188d41da8

9 years agoMerge "Merge release-5-0 into master"
Mark Abraham [Thu, 5 Jun 2014 06:53:11 +0000 (08:53 +0200)]
Merge "Merge release-5-0 into master"

9 years agoUpdated C-/N-terminal partial charges in Amber03.ff.
Rossen Apostolov [Thu, 22 May 2014 13:03:54 +0000 (15:03 +0200)]
Updated C-/N-terminal partial charges in Amber03.ff.

At the time of porting the AmberFFs were validated against
AMBER 8 and the results have matched precisely. However,
that specific AMBER version had a bug due to which CT/NT charges in ff03
were in fact using ff94 charges. The bug correspondingly propagated
to the Gromacs ports. In newer versions of AMBER this has been fixed.

The current GROMACS patch uses charges as specified in the
all_aminoct03.lib and all_aminont03.lib files as
taken from the AmberTools14 distribution.

In that distribution (14) seem to be no updates to the ff9x parameters.

Fixes #1466.

Change-Id: Ie6cfea5702500ff6cd5019edb22f224d29135425

9 years agoMerge release-5-0 into master
Roland Schulz [Tue, 3 Jun 2014 15:06:20 +0000 (11:06 -0400)]
Merge release-5-0 into master

Conflicts:
share/top/gurgle.dat

Change-Id: I95bb9d2ce43ed7fdfe6cfd535e4f88fac9dfb5ea

9 years agoUse RNG correctly for v-rescale thermostat
Mark Abraham [Sun, 25 May 2014 19:38:41 +0000 (21:38 +0200)]
Use RNG correctly for v-rescale thermostat

Two integers were passed in the wrong order. I suspect from the
construction of the RNG that the only effect of this is to permit a
rare re-use of a random number in a different RNG stream (i.e. no
effect in practice).

Change-Id: I1fb8eddbe7c8b029dc3686be80f3f083108fc28c

9 years agoConvert repl_ex.c to C++
Mark Abraham [Wed, 28 May 2014 21:57:45 +0000 (23:57 +0200)]
Convert repl_ex.c to C++

Moved matching header to start, eliminated unused variables, fixed
int64 format string, eliminated an unnecessary header.

Change-Id: I6985a41279c0be6e3c0c468a921dfe50a87bed4f

9 years agoConverted md.c to C++
Mark Abraham [Tue, 27 May 2014 13:14:53 +0000 (15:14 +0200)]
Converted md.c to C++

Removed unused variables, added missing headers, added missing
extern "C" specifiers. Removed assignments of unused values.

Made the code always call init_nlistheuristics(), in order to suppress
a clang-static-analyzer check that thinks (for example) MULTISIM(cr)
can change its value over MD loops. Calling that init function is
cheap, outside the MD loop, has no effect because those code paths are
always protected by a check for nstlist == -1, and probably those code
paths will go away shortly.

Change-Id: I8abb8ef28c121c7b5432bf38d958c0b2a55ed9da

9 years agoFixed g_energy Einstein viscosity
Berk Hess [Mon, 2 Jun 2014 20:48:18 +0000 (22:48 +0200)]
Fixed g_energy Einstein viscosity

The g_energy -vis Einstein viscosity output was obviously incorrect.
This bug has been introduced in version 4.5.
Fixes #1516

Change-Id: I5ffc1a232f0c64769cc438c977b757e8d8b55b98

9 years agoFixed wrong journal reference in manual
David van der Spoel [Mon, 2 Jun 2014 07:08:15 +0000 (09:08 +0200)]
Fixed wrong journal reference in manual

Smith, P. E., van Gunsteren, W. F. The Viscosity of SPC and SPC/E Water.
Should be Chem Phys Lett instead of Comp Phys Comm.

Change-Id: Ic59b01585271d00993df2d34e9f1369c681bc3fd

9 years agoMove atomprop.* to topology/
Teemu Murtola [Sat, 31 May 2014 19:11:47 +0000 (22:11 +0300)]
Move atomprop.* to topology/

- Remove some unnecessary includes.
- Convert the source file to C++ and fix some issues.
- Some header cleanup in touched files.

This introduces a fileio<->topology cyclic dependency, but that needs to
wait for later resolution.

Change-Id: I88e70cd9024d86c56c4d4435fa91c42af9af7c29

9 years agoAdded grompp checks for zero atom masses in state B
Erik Lindahl [Thu, 22 May 2014 21:44:53 +0000 (23:44 +0200)]
Added grompp checks for zero atom masses in state B

Grompp already issued fatal errors if atoms had zero mass, or
if vsites had non-zero mass, in state A. This patch adds
state B to the same check.

Refs #1433.

Change-Id: Iec3d764ff7db6e7bdc3901d51b475cf2c35fe137

9 years agoAdd quote on the kT-kj/mol conversion factor
Szilárd Páll [Thu, 22 May 2014 21:20:56 +0000 (23:20 +0200)]
Add quote on the kT-kj/mol conversion factor

Great advice to all those struggling with remembering numbers by Anders
Gabrielsson.

Change-Id: I65fe5247b9342f6f48de709ad5bdbc69a52abc9a

9 years agoFixed typo in manual
Erik Lindahl [Thu, 22 May 2014 20:19:55 +0000 (22:19 +0200)]
Fixed typo in manual

Change-Id: Ic772c4b7bfc2128fff05c1e686999ba739725c53

9 years agoTwo quotes contributed by Vedran Miletic
Erik Lindahl [Thu, 22 May 2014 19:34:06 +0000 (21:34 +0200)]
Two quotes contributed by Vedran Miletic

Change-Id: Ib5dfc367c99bba312e669de8db1ddc68f65a9480

9 years agoFix bug writing TNG output from dump.
Magnus Lundborg [Tue, 27 May 2014 11:19:04 +0000 (13:19 +0200)]
Fix bug writing TNG output from dump.

The output was incorrectly located in an if statement.
Partial fix of #1510

Change-Id: I85823d9369f208f21f4bafe19705e9e4dd2da027

9 years agoBug fix in the TNG library to improve reading.
Magnus Lundborg [Mon, 26 May 2014 15:59:55 +0000 (17:59 +0200)]
Bug fix in the TNG library to improve reading.

Reading single frame frame sets did not work properly.
Fixes #1502 and partial fix of #1510.

Reread frame set after getting stride length.

Extra check to avoid reading past end of file when
checking what data blocks are present.

Change-Id: I5275382bd49b5b46ebfdebe535c53d2f09015bc0

9 years agoPermit trjconv to read and write velocities with TNG files
David van der Spoel [Sat, 24 May 2014 07:10:13 +0000 (09:10 +0200)]
Permit trjconv to read and write velocities with TNG files

Partial fix of #1502

This set velocity reading and writing on for tng file in trjconv.
However there still is a problem with the number of frames being
reduced at each conversion.

Change-Id: I91e7f5245ca75ebb9dd8e4450f94015b5c3f2bfa

9 years agoMove mtop_util.* and topsort.* to topology/
Teemu Murtola [Sat, 31 May 2014 04:18:31 +0000 (07:18 +0300)]
Move mtop_util.* and topsort.* to topology/

- Remove unnecessary includes of these headers.
- Some minor cleanup in the moved files.

Change-Id: I7ad70f4c1870307713db35b8b243bed1dc9cbdd2

9 years agoFinalize change from GMX_CPU_ACCELERATION to GMX_SIMD
Mark Abraham [Tue, 27 May 2014 07:58:26 +0000 (09:58 +0200)]
Finalize change from GMX_CPU_ACCELERATION to GMX_SIMD

Change-Id: I6c947d80f36c2fd8e1608520cb505d0586719644

9 years agoRemove more uses of typedefs.h
Teemu Murtola [Thu, 29 May 2014 04:25:07 +0000 (07:25 +0300)]
Remove more uses of typedefs.h

- Replace typedefs.h with individual headers and/or forward
  declarations, with focus on headers and code outside
  gmxlib/mdlib/gmxana/gmxpreprocess.
- Remove unused dlb.h.
- Fix some source files that were relying on transitive includes.

Change-Id: Icf32798d664f6753eb0c0cb2a88e178bc21c9d78

9 years agoMerge release-5-0 into master
Roland Schulz [Tue, 27 May 2014 08:25:50 +0000 (04:25 -0400)]
Merge release-5-0 into master

Change-Id: Ibc8f81443d1eaac18b62f544fa149e0924073891

9 years agoMerge release-4-6 into release-5-0
Roland Schulz [Mon, 26 May 2014 08:49:25 +0000 (04:49 -0400)]
Merge release-4-6 into release-5-0

Conflicts:
CMakeLists.txt - fixed use of GMX_CPU_ACCELERATION
src/gromacs/gmxana/gmx_lie.c
src/gromacs/pulling/pull.c

Change-Id: I45a70eee6f7ec4dd922b6c04c740c40f50159a45

10 years agoMove general functions out of typedefs.h
Teemu Murtola [Sun, 25 May 2014 18:44:50 +0000 (21:44 +0300)]
Move general functions out of typedefs.h

- Move overallocation routines to smalloc.h.  Perhaps the DD routines
  could go higher up the dependency stack, but then again, they weren't
  particularly high earlier.
- Move gmx_step_str() to cstringutil.h.  This could probably go away
  completely in favor of GMX_PRId64, but here it will force less
  dependencies on code that still uses it.

These changes allow files that use one of these functions to still get
rid of all unnecessary dependencies that typedefs.h brings.

Change-Id: Ic7973799c14f1748867965fda5bf8e33fae4fd0c

10 years agoRemove some typedefs.h dependencies
Teemu Murtola [Sun, 25 May 2014 04:28:31 +0000 (07:28 +0300)]
Remove some typedefs.h dependencies

- Replace several typedefs.h dependencies with either forward
  declarations or includes of the individual headers that are required.
- Some other cleanup in the selection code, removing stuff that is no
  longer necessary for C++.

Change-Id: I6b9b3fe5cbbcc8f6bac29c9306cc4c4c57e59479

10 years agoMove types/topology.h to topology/
Teemu Murtola [Sun, 25 May 2014 03:20:55 +0000 (06:20 +0300)]
Move types/topology.h to topology/

- Make the types forward-declarable, and use that in a few headers.
- Adapt files that were including the file directly.
- Move functions that operate on these structs from typedefs.[ch] to
  topology/ as well, and make callers of those functions include
  topology.h.

typedefs.h still brings this header with it.  That will be cleaned up
separately in parts.

Change-Id: Iff50b854c335d10b97fd79c65d21791e5ae432a1

10 years agoSimplified section "Porting".
Rossen Apostolov [Fri, 23 May 2014 12:25:42 +0000 (14:25 +0200)]
Simplified section "Porting".

Fixes #1069.

Change-Id: I01578dfe27585f5c5cc81ce9f564e9586c60a3ed

10 years agoMove types/idef.h to topology/
Teemu Murtola [Sat, 24 May 2014 18:13:58 +0000 (21:13 +0300)]
Move types/idef.h to topology/

- Move bondedtable_t to fcdata.h, which is the only header that used it.
- Make other types forward-declarable.
- Some minor cleanup in the moved file.
- Adapt files that were including idef.h directly.  Everything else
  still depends on getting this through typedefs.h / types/topology.h.

Change-Id: Ib11c1e34dde83180e1bfa8415d579ced96aeee4d

10 years agoAllow trjconv to keep some box dimensions unchanged.
Rossen Apostolov [Fri, 23 May 2014 14:30:06 +0000 (16:30 +0200)]
Allow trjconv to keep some box dimensions unchanged.

Giving -1 to option box will preserve the original box size
for the given dimension.

Fixes #871.

Change-Id: I339aedcf09da8ecb4eb8f32e8057f953a21e0f5f

10 years agoMove types/atoms.h to topology/
Teemu Murtola [Sat, 24 May 2014 04:20:48 +0000 (07:20 +0300)]
Move types/atoms.h to topology/

- Make all the structs forward-declarable, and use that in a few
  headers.
- Adjust existing few includes.
- Move functions that operate on these types from typedefs.[ch] to
  topology/ as well.

Nearly all code still depends on including this through
typedefs.h->types/topology.h, but that can wait.

Change-Id: If870711a061756a77451f52598d91e72d8948d92

10 years agoMove types/ishift.h to pbcutil/
Teemu Murtola [Sat, 24 May 2014 03:41:51 +0000 (06:41 +0300)]
Move types/ishift.h to pbcutil/

- Remove the include from typedefs.h, and add it to files that are using
  it.

Change-Id: I752648c73ba767eff30c113c84aabd5c7d7494ac

10 years agoMove invblock.* to topology/
Teemu Murtola [Fri, 23 May 2014 18:51:22 +0000 (21:51 +0300)]
Move invblock.* to topology/

- Remove unnecessary includes of invblock.h.
- make_invblock() actually seems unused, but left it there for now.
  Perhaps the whole functions could be merged to block.h, but that will
  be easy to do later as well.

Change-Id: I5dc133b0bb66c9ec66704c3406f19ab217dade68

10 years agoMove types/block.h to topology/
Teemu Murtola [Fri, 23 May 2014 04:07:48 +0000 (07:07 +0300)]
Move types/block.h to topology/

- Move t_block and t_blocka definitions to topology/.
- Move functions that operate only on these types from typedefs.[hc] to
  the same place.
- Include the new block.h from all source files that reference the
  functions.
- Clean up a few headers that were including types/block.h directly.
  Most other code still depends on getting the type definitions
  indirectly through typedefs.h, but that can be fixed during subsequent
  changes.

Change-Id: I458e9cdc00a8d81665630f8123589b64d123790a

10 years agoMove symtab.* to topology/
Teemu Murtola [Thu, 22 May 2014 19:01:43 +0000 (22:01 +0300)]
Move symtab.* to topology/

- Adapt #includes and some minor cleanup in touched files.
- Convert symtab.c to C++ to get rid of a "macros.h" dependency, and
  clean up the includes otherwise as well.
- Adjust valgrind memory leak suppression to suppress on an extern "C"
  function.

This new subdirectory is an initial home for everything related to basic
topology and index group handling.  More files will follow.

Change-Id: Id5b1a626ef4a90836f70a8b4c7f24ff52c768a5d

10 years agoMerge t_symtab into symtab.h
Teemu Murtola [Wed, 21 May 2014 19:22:33 +0000 (22:22 +0300)]
Merge t_symtab into symtab.h

- Remove types/symtab.h.
- Make the type forward-declarable and use that in headers.
- Remove some unnecessary includes of symtab.h, and added some that were
  missing.  These may not be 100% accurate, since types/topology.h still
  brings symtab.h into nearly every file.

In principle, it should be straightforward to make the type internal to
symtab.c (I don't think the contents of the struct are used anywhere
outside that file), but the problem is that it is very difficult to find
all places where t_topology or gmx_mtop_t is allocated with snew()
without calling open_symtab() afterwards, since all those should change
to also initialize the symtab member to a non-NULL pointer.

Change-Id: I3b932f508bb010c4bda06f80ad98a4836eeb8484

10 years agoMove pbc.* to pbcutil/
Teemu Murtola [Tue, 20 May 2014 19:30:03 +0000 (22:30 +0300)]
Move pbc.* to pbcutil/

- Remove unnecessary includes of pbc.h.
- Reorder some of the includes in C++ code manually; elsewhere, just a
  manual replacement of the include paths.
- Some minor cleanup.

This introduces a cyclic fileio<->pbcutil dependency, but that needs to be solved separately.

Change-Id: I13becc82aaa217288ea45df72bb6198377de9d0f

10 years agoMove tools code to where it is used
Mark Abraham [Wed, 21 May 2014 17:47:52 +0000 (19:47 +0200)]
Move tools code to where it is used

All the actual clients of calch.c and princ.c were respectively
in gmxpreprocess and gmxana, so it makes more sense for them
to be there, together with their headers. Removed some
unneccesary #includes of those headers.

Change-Id: I47f6d2f1e3a4670ebba907b874590e362f070eac

10 years agoFix memory issue in solvate
Roland Schulz [Thu, 22 May 2014 22:16:13 +0000 (18:16 -0400)]
Fix memory issue in solvate

Caused by SIMD padding introduced by new group kernels.

Fixes #1499

Change-Id: I5126217c9b752f1c1fd04d01e2644987fdc52d5b

10 years agoAdd ASAN build configuration
Roland Schulz [Sun, 11 May 2014 20:26:14 +0000 (16:26 -0400)]
Add ASAN build configuration

Also renamed ThreadSanitizer to TSAN

Change-Id: I4373a626acc3962bfb8f163297ab146684bd5ea6

10 years agoMove cinvsqrtdata.c to math/ and remove Fortran remnants
Teemu Murtola [Thu, 22 May 2014 03:57:13 +0000 (06:57 +0300)]
Move cinvsqrtdata.c to math/ and remove Fortran remnants

There is no longer any Fortran code that needs to use the arrays, so
simplify the code.

Change-Id: I304ab21129412f53b8c9696ac0739cbafbcb0b7e

10 years agoNormal modes don't work currently with virtual sites or shells.
Rossen Apostolov [Tue, 6 May 2014 14:23:25 +0000 (16:23 +0200)]
Normal modes don't work currently with virtual sites or shells.

Refs #879.

Change-Id: I1c45b5a4b4c97feff222dccbbbb884e0153ad0c5

10 years agoFix static group list indices in selection prompt
Teemu Murtola [Thu, 22 May 2014 03:20:47 +0000 (06:20 +0300)]
Fix static group list indices in selection prompt

In 4.6, the list was zero-based, and this is what the selection parser
uses when resolving numeric group references, so it should still be.
Also the list shown by various functions in index.c is zero-based.
The printing code had been inadvertently changed to one-based in cleanup
of the handling of group names within the selection code.

Fixes #1506

Change-Id: I9a573b921802d2276e3bdb653359a961c90ff29a

10 years agoAvoid energy drift with verlet-buffer-tolerance
Berk Hess [Fri, 9 May 2014 22:05:46 +0000 (00:05 +0200)]
Avoid energy drift with verlet-buffer-tolerance

Added a warning with weak coupling and SD when tau_t and
verlet-buffer-tolerance as so large that the temperature might
be off by more than 0.2%.
Turned off nstlist tuning in mdrun with nstlist=1.
Also fixed Andersen checks in mdrun that were useless, since they
were done before temperature coupling groups were set.

Change-Id: I41bd316449c9e03e21d33dd82ebeab034d019fc6

10 years agoAdd fatal errors for VV and twin-range MTS
Mark Abraham [Tue, 13 May 2014 15:52:50 +0000 (17:52 +0200)]
Add fatal errors for VV and twin-range MTS

Michael never implemented the multiple-time stepping with the VV
integrator family and constraints (see code that calls
combine_forces() from update_coords() in src/mdlib/update.c). Probably
that means the multiple-time-step regime was not tested with VV
either. Strictly speaking, these new fatal errors have scope that is
wider than is clearly warranted, but it is not clear the
no-constraints VV path was only ever as bad as the broken leap-frog
path is (see #1400).

I suspect VV+constraints will work with the incoming fixes for
leap-frog, but until someone wants to use it (and why would they?),
then I'm not going to test that it works as well as it does with
leap-frog.

Change-Id: Ib61d0fb7661bca2101c04423a6af1744420c06ab

10 years agoClarified docs for use of mdrun -nstlist
Mark Abraham [Tue, 20 May 2014 13:18:58 +0000 (15:18 +0200)]
Clarified docs for use of mdrun -nstlist

Change-Id: I86118d59116bb183bf81d21bdef8f9c75c12700a

10 years agoMerge t_pbc definition into pbc.h
Teemu Murtola [Tue, 20 May 2014 04:25:27 +0000 (07:25 +0300)]
Merge t_pbc definition into pbc.h

- Remove types/pbc.h, and merge its contents into pbc.h.
- Make t_pbc forward-declarable, and use this in header that only
  included one of the pbc.h files to just get this definition.
- Add some missing pbc.h includes.
- Fix some other include dependencies that were previously covered
  transitively.
- Minor cleanup in touched files.

Change-Id: I0a69980b244c23905c44448c1a095d497807cd04

10 years agoRefactor string handling for GPU usage report
Mark Abraham [Sat, 17 May 2014 13:27:25 +0000 (15:27 +0200)]
Refactor string handling for GPU usage report

This prepares for future addition of reporting the list of available
compatible GPUs in the auto-selection case, which is needed for gmx
tune-pme to function well. Current outputs are only of IDs of
available GPUs, or IDs of those that will be used. The latter depends
on the number of PP ranks, so it doesn't help gmx tune-pme find out
how to run the optimization. At some point, delegating this kind of
task to hwinfo called from gmx tune-pme might be preferable.

The only functionality changes here are of reporting GPU ids by
referring to them as IDs, and the string of the ones used is of style
"0,1,4" rather than "#0, #1, #4". The use of the template function and
constructing the temporary vector prepares for the next commit.

Change-Id: Ic37989ce2f8e6396f450e1b5457ea7ea70b3849b

10 years agoMove mshift.* to pbcutil/
Teemu Murtola [Mon, 19 May 2014 18:16:13 +0000 (21:16 +0300)]
Move mshift.* to pbcutil/

- Remove unnecessary includes of mshift.h.
- Replace mshift.h includes in headers with forward declarations of
  t_graph where applicable.
- Add some missing mshift.h includes to source files that were getting
  it transitively from one of the above headers.
- Convert mshift.c to C++ and get rid of macros.h dependency.

Change-Id: Ie0671cd6d683f5092243e5fdcb102641fdb6ecf6

10 years agoMerge t_graph definition into mshift.h
Teemu Murtola [Mon, 19 May 2014 17:08:59 +0000 (20:08 +0300)]
Merge t_graph definition into mshift.h

- Remove types/graph.h, and merge its contents into mshift.h.
  This is a natural place for the structure, as the header already
  contains most functions that operate on the graph.
- Make t_graph forward-declarable, and use that in headers that
  previously got t_graph from typedefs.h.
- Add some missing mshift.h includes to source files that now need it.

Some additional cleanup of mshift.h dependencies will be done in
subsequent commits, when the header itself is moved.

Change-Id: Ia8c5817c11474c857a6845810e5e7f5a75f1c47c

10 years agoFix copyright years for new code
Mark Abraham [Tue, 20 May 2014 20:46:30 +0000 (22:46 +0200)]
Fix copyright years for new code

These files are new and of code new to GROMACS, so it is
only correct to copyright 2014.

Change-Id: I5d56116f1330fc83380919b111cefa4bf533fb08

10 years agoMove rmpbc.* to pbcutil/
Teemu Murtola [Sun, 18 May 2014 17:25:06 +0000 (20:25 +0300)]
Move rmpbc.* to pbcutil/

- Remove unnecessary includes of rmpbc.h.
- Add includes for rmpbc.h in files where it was missing and was
  previously transitively covered through gstat.h (which itself didn't
  need rmpbc.h).
- Some additional include reordering in files that were manually edited.

More PBC-related files will get to this directory in subsequent commits.

Change-Id: I3f3a963bb2444c0899ea24d2d4cd6a58c3077a82

10 years agoImprovements to the g_lie help description.
Justin Lemkul [Tue, 8 Oct 2013 11:38:04 +0000 (07:38 -0400)]
Improvements to the g_lie help description.

Information was sparse, likely to avoid restating published
protocols, but some expansion was definitely warranted,
given the amount of questions that have recently been
posted to the mailing list and Redmine.

Refs #1353

Change-Id: Ib4057ae671ccac70061498b1d40ebcba84c497ee

10 years agoAdded a note about using direction-periodic pulling.
Rossen Apostolov [Tue, 6 May 2014 13:28:58 +0000 (15:28 +0200)]
Added a note about using direction-periodic pulling.

Refs #1352.

Change-Id: I867fe1372082063bb221880e8021089f9ded14e7

10 years agoAdded a note about unsupported Verlet cutoff + Buckingham.
Rossen Apostolov [Wed, 14 May 2014 10:10:55 +0000 (12:10 +0200)]
Added a note about unsupported Verlet cutoff + Buckingham.

Refs #1192.

Change-Id: I2da3bf8c768de40531e1ffdf6f8cec73c9e53314

10 years agoAdd note about correct calling of wallcycle counter
Mark Abraham [Fri, 16 May 2014 11:05:27 +0000 (13:05 +0200)]
Add note about correct calling of wallcycle counter

The code could be refactored to use a series of explicit OpenMP
barriers so that the wallcycle_start/stop are more clearly matched,
but that's too hard for now. The comments make it harder for anyone
to misunderstand or mistakenly change the code.

Change-Id: Iec00e50e26a60efe09afb6f5744d401a9d9c06a3

10 years agoConvert gmx_detect_hardware.c to C++
Mark Abraham [Sat, 17 May 2014 12:23:00 +0000 (14:23 +0200)]
Convert gmx_detect_hardware.c to C++

Minor fixes to keep new compilers and static analysis happy. The
change to the return behaviour of sizeof_cuda_dev_info does not
matter, because it is only used if it is non-zero.

Change-Id: If2c9c2676667316637a30af9ead71fb9f77058c2

10 years agoFix indenting of .tpr parameter dump in mdrun log file
Mark Abraham [Tue, 13 May 2014 07:25:29 +0000 (09:25 +0200)]
Fix indenting of .tpr parameter dump in mdrun log file

This got broken recently in I39550bff60

Fixes #1447

Change-Id: I3e9765e56081d28dd0855d8d8f3fdf39b900993b

10 years agoClean up matio.*
Teemu Murtola [Sun, 18 May 2014 04:32:03 +0000 (07:32 +0300)]
Clean up matio.*

- Remove unnecessary includes of matio.h.
- Move t_matrix and related type definitions from types/matrix.h to
  matio.h, since this is the only header that needs them, and all users
  also need the contents of that header.
- t_rgb is an exception to the above rule.  Moved that to types/rgb.h
  for now, and adapted other users.
- Remove clear_matrix() as unused.
- Fix a file handle left open in do_dssp.
- Make several functions not declared in matio.h static in matio.cpp.
- Don't use gmx_fio_close() on a handle not opened with gmx_fio_open()
  in readcmap().
- Most of the *cmap() functions are unused (only do_dssp calls one of
  the reading functions, and no one calls the writing functions), but
  left them there for completeness.

Change-Id: Iffc9c9e6d06ce8884e1835c07e9c0f9227412725

10 years agoMove 3dview.* to programs/view/
Teemu Murtola [Wed, 23 Apr 2014 18:58:41 +0000 (21:58 +0300)]
Move 3dview.* to programs/view/

This is the only place where the t_3dview structure is used, and it
seems quite tailored for this use.

Change-Id: Iee0cb3aae947b2bb3f98763ea91949a560faf602

10 years agoClean up math/
Teemu Murtola [Wed, 23 Apr 2014 18:51:05 +0000 (21:51 +0300)]
Clean up math/

- Remove some unnecessary includes.
- Remove autoconf remnants.
- Split 3dview.* to 3dview.* for t_3dview and 3dtransforms.* for the
  basic 4-vector operations.
- Rename most mat4/vec4 operations to be more descriptive and make some
  3dview operations static, as they were not used outside the source
  file.
- Add some documentation for 3dtransforms.h (but not for all functions,
  so the file itself is not documented).

This removes some legacyheaders/ dependencies from math/, and allows
moving 3dview.* to programs/view/, which is the only user for them.

Change-Id: Ieb51d1d800c07f053eb5a28dfef2a249d5fcfceb

10 years agoClean-up gmx_eof
Roland Schulz [Wed, 30 Apr 2014 07:37:36 +0000 (03:37 -0400)]
Clean-up gmx_eof

- Changed name to gmx_one_before_eof so that the different
  behavior from feof is obvious.
- Changed one usage of gmx_eof to feof where the std
  behavior is OK
- Moved to confio and made static because it is only
  used there.
- Removed the special treatment for pipes. It was incorrect.
  gmx_before_eof is only used for gro file reading and
  those could not be read from compressed files anyhow.
  Their is no possible correct implemenation for pipes
  (which cannot be seeked) and even if it wouldn't help
  because gro file reading also uses rewind which
  doesn't work for pipes.

Change-Id: I77fd34253817cd591011b8a2ec39ae95ce7b7378

10 years agoMore elaborate default handling for FileNameOption
Teemu Murtola [Mon, 5 May 2014 18:33:27 +0000 (21:33 +0300)]
More elaborate default handling for FileNameOption

- FileNameOption now prefers existing files when completing the default
  basename to a full filename for input options, like t_filenm parsing
  does.
- Add FileNameOptionManager that allows interaction between different
  file-related options.  Use it to add support for -deffnm-like option
  to set a default base name for all FileNameOptions.

To do the above, and make the -deffnm option independent from the
command line order, the default file names are now handled during
Options::finish().  So there are cases when the value returned by a file
name option changes after this call.

Change-Id: I73d3badae5409e9f066f06dec307b2c10ac89bfd

10 years agoUnit tests for parse_common_args() file options
Teemu Murtola [Sun, 27 Apr 2014 03:49:11 +0000 (06:49 +0300)]
Unit tests for parse_common_args() file options

Some tests were already there, but extended the set to consider the
paths that check for file existence on the file system.
The tests should now cover most happy paths within parse_file_args().
Many unhappy paths behave quite unintuitively, so they are not tested
to avoid enforcing such unintuitive behavior.

Change-Id: I21c2dc40a3861784d55b6419dd148d6dda26dde5

10 years agoFixes a complicated bug in g_anaeig.
David van der Spoel [Fri, 16 May 2014 05:40:37 +0000 (07:40 +0200)]
Fixes a complicated bug in g_anaeig.

If the number of frames for a covariance analysis is fewer than the
number of degrees of freedom, g_covar would happily print nonsense
eigenvalues in the eigenval.xvg file. This would then lead g_anaeig
to give NaN entropy values. By limiting the number of output lines in
the eigenvalue file this should be resolved. In addition a warning is
printed.

Change-Id: I01693a0fa9f3ba5b5784543a04d0d88b33a755c2

10 years agoAdded cmake profiling support
David van der Spoel [Tue, 13 May 2014 13:46:53 +0000 (15:46 +0200)]
Added cmake profiling support

Support for using gprof with gromacs executables is added to
allow basic profiling using
gmx command [options]
gprof gmx

Removed explicit -fomit-frame-pointer, since this has been default
behaviour in gcc at most optimization levels since at least version
4.4. This lets "-O3 -pg" in the Profile build-type CFLAGS fight it out
themselves.

Change-Id: I99710f9cdd406f866d663a9610e0e9cccb87c07c

10 years agoMove physics.* to math/units.*
Teemu Murtola [Tue, 22 Apr 2014 04:14:58 +0000 (07:14 +0300)]
Move physics.* to math/units.*

- Remove some unnecessary #includes.
- Remove the dummy tests; easy to rewrite as usable tests using GTest if
  someone needs those.  They were anyways testing code that no one is
  still calling, even though it was introduced several years ago.
  Now gmxlib is free of *_test.c files.

Now, only one file using atom_id is keeping math/ dependent on
legacyheaders/.

Part of #1415.

Change-Id: I31312b92cf9f5d5129fbd90f31fcf27be2f7afaf

10 years agoMerge "Merge release-5-0 into master"
Roland Schulz [Wed, 14 May 2014 16:25:27 +0000 (18:25 +0200)]
Merge "Merge release-5-0 into master"

10 years agoProhibit AVX_256 with buggy gcc 4.6.1
Mark Abraham [Tue, 13 May 2014 14:16:44 +0000 (16:16 +0200)]
Prohibit AVX_256 with buggy gcc 4.6.1

Fixes #1259

Change-Id: I7c523a90ccd0dd8fd3df6cb1914429e22a27ab5d

10 years agoMerge release-5-0 into master
Roland Schulz [Sat, 10 May 2014 16:34:36 +0000 (12:34 -0400)]
Merge release-5-0 into master

Change-Id: Ib309c33a5923d50757122b789df9430aaa1ee98d

10 years agoMerge release-4-6 into release-5-0
Roland Schulz [Fri, 9 May 2014 19:08:58 +0000 (15:08 -0400)]
Merge release-4-6 into release-5-0

Conflicts:
CMakeLists.txt (applied to cmake/gmxManageSharedLibraries.cmake)

Replaced gmx_llabs by llabs as mentioned in TODO.

Change-Id: I37e8cf5d6725cc9836e6dc29ca44e7ef915417c4

10 years agoFix clang 3.5 warnings regarding *abs*
Alexey Shvetsov [Sun, 20 Apr 2014 13:01:54 +0000 (17:01 +0400)]
Fix clang 3.5 warnings regarding *abs*

Fix abs() family functions type usage mismatch.

Change-Id: I85ed2931d681aa1ad024678b4209a524abc2cc61
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
10 years agoMinor tweaks to the DD setup
Berk Hess [Thu, 8 May 2014 13:17:00 +0000 (15:17 +0200)]
Minor tweaks to the DD setup

Dynamic load balancing is now turned on when the total performance
loss is more than 2% (lower than that will not help).
The check for large prime factors should be done on the PP node
count when -npme is set by the user.

Change-Id: Ib81b56a7cb071540b143a4bfc98758788a8ac07d

10 years agoFix comparison of array to NULL
Roland Schulz [Sat, 3 May 2014 16:27:14 +0000 (12:27 -0400)]
Fix comparison of array to NULL

Static char array is never NULL. Detected by clang 3.5. Also fixes
output of read_atype and print error for incorrect format.

Change-Id: I834fca2d8fdd49167a88dc15bc7a2e72f4d97269

10 years agoMerge "Merge branch release-4-6 into release-5-0" into release-5-0
Roland Schulz [Fri, 9 May 2014 19:04:43 +0000 (21:04 +0200)]
Merge "Merge branch release-4-6 into release-5-0" into release-5-0

10 years agoFix OpenMP scope error
Roland Schulz [Fri, 9 May 2014 09:57:08 +0000 (05:57 -0400)]
Fix OpenMP scope error

Change-Id: I5cea5df876a48e5868b5160170e8450e697f3b4b

10 years agoFix GCC 4.9 warnings
Roland Schulz [Fri, 9 May 2014 16:57:53 +0000 (12:57 -0400)]
Fix GCC 4.9 warnings

Change-Id: I277d0f03f67dfbb5ca5785adc7e8f31880202b41

10 years agoFix OpenMP unproteced update bug
Roland Schulz [Fri, 9 May 2014 16:33:13 +0000 (12:33 -0400)]
Fix OpenMP unproteced update bug

Change-Id: Id881b3e2726fa9c9be7a37f7e909bb7b268e44a7

10 years agoFix GCC 4.8 warnings
Roland Schulz [Thu, 8 May 2014 02:40:31 +0000 (22:40 -0400)]
Fix GCC 4.8 warnings

Those warnings only present without OpenMP were not fixed prior.

Defines GMX_ATTRIBUTE_NORETURN for GCC and Clang. TODO is
left because it still doesn't define it for all compilers.

Change-Id: I7197e58f87c01de7d2deeba91a82026af74ba213

10 years agocmake: enable shared libraries by default on Hurd
Pino Toscano [Mon, 5 May 2014 21:01:28 +0000 (23:01 +0200)]
cmake: enable shared libraries by default on Hurd

Since the toolchain is mostly the same as used on e.g. GNU/Linux
(glibc, gcc, binutils, etc), they can be safely enabled.

Change-Id: Ic663c8c344b5dfa2910e9c30260588e1917038c1

10 years agoFix incorrect limits in FloatOptionStorage
Teemu Murtola [Thu, 1 May 2014 18:20:22 +0000 (21:20 +0300)]
Fix incorrect limits in FloatOptionStorage

This typo didn't cause any problems in Gromacs, since currently, no code
path enters here.  But if user code would use FloatOption or RealOption,
it would trigger.  Found while taking this code into actual use in
master.

Change-Id: I712faf365359964f6f767991664da7981072e5bd

10 years agoFix usage of gmx_eof
Roland Schulz [Wed, 30 Apr 2014 07:37:36 +0000 (03:37 -0400)]
Fix usage of gmx_eof

gmx_eof has different behavior from gmx_eof and feof
should be used here.

Change-Id: I877c15d0edde64fe06ae2eedbda980f117509449

10 years agoMerge branch release-4-6 into release-5-0
Mark Abraham [Tue, 29 Apr 2014 20:52:24 +0000 (22:52 +0200)]
Merge branch release-4-6 into release-5-0

Conflicts:
src/gromacs/mdlib/coupling.c

Resolved in favour of release-4-6, except that the underlying
RNG calls are now made to the new cycle-based RNG.

Run uncrustify

Change-Id: I56286e19632ac28958a0d4ef60ff09b875aa3005

10 years agoRemoved truncation of nrdf in v-rescale thermostat
Berk Hess [Wed, 23 Apr 2014 13:15:08 +0000 (15:15 +0200)]
Removed truncation of nrdf in v-rescale thermostat

The resampling function for the v-rescale thermostat expected an
integer value for nrdf, but a real was passed, which was truncated.
With a single coupling coupling group nrdf is analytically an int,
but could be off by a bit. The could lead to incorrect kinetic
energy fluctuations (averages were correct).
Now fractional nrdf's are properly handled for nrdf > 3.
For nrdf < 3 a check is added for integer values with a small margin
for rounding.
Fixes #1218

Change-Id: I4c60c337f9874d0bff51220ad09429140be2a056

10 years agoMade ORCA compile.
Justin Lemkul [Thu, 24 Apr 2014 14:45:41 +0000 (10:45 -0400)]
Made ORCA compile.

There are probably larger issues here with the QM/MM interface.
I made no effort to test the validity of any simulation done with
ORCA (since I don't have ORCA and I don't do QM/MM), so issues
definitely remain.

Change-Id: Ibd5dd83d05a3b42c641f0fc9def75c4641e3a7d4

10 years agoMove mtxio.* to fileio/
Teemu Murtola [Mon, 21 Apr 2014 04:11:00 +0000 (07:11 +0300)]
Move mtxio.* to fileio/

This removes some cyclic module-level dependencies, and is more in line
with the current layout, where all I/O code specific to some file
formats is in fileio/.  math/ in general probably also needs to be lower
in the dependency stack than fileio/, so it is not possible to keep the
code in the old place without introducing a cyclic dependency.

Change-Id: If0c0632a3d5b3cd4ffe82f38f743e9afdc7ffdff

10 years agoReduced usage of typdefs.h
Roland Schulz [Mon, 21 Apr 2014 00:57:32 +0000 (20:57 -0400)]
Reduced usage of typdefs.h

Preliminary step to move types out of legacyheader.

Renamed parameter called "matrix" because cppcheck gets
confused if a parameter is called the same as a type.

Part of #1415

Change-Id: I9207a7b8de7f092bab890da128abbb48a8d97b79

10 years agoMove rvec and friends to math/vectypes.h
Teemu Murtola [Sun, 20 Apr 2014 18:33:08 +0000 (21:33 +0300)]
Move rvec and friends to math/vectypes.h

Adjust a few more types/simple.h includes to use only its component
parts.  Now, math/ has only very few legacyheaders/ dependencies left.

Part of #1415

Change-Id: Iffeafa4fac5c5e0c744cf6deecac4eedaee2caf5

10 years agoMove 'real' definition to utility/real.h
Teemu Murtola [Fri, 18 Apr 2014 14:16:13 +0000 (17:16 +0300)]
Move 'real' definition to utility/real.h

- types/simple.h still includes the new header to avoid touching all
  code depending on this.
- Go through most files outside gmxlib and mdlib that included
  types/simple.h, and checked whether headers from utility/ could
  fulfill the needs.  Replaced at least in places where this helped
  fully remove legacyheaders/ dependencies.
- Some minor changes elsewhere to remove legacyheaders/ dependencies
  from modules.  Now linearalgebra/ and statistics/ don't depend on
  legacyheaders, improving the layout of the dependency graph
  significantly.

In the long run, this may be better outside utility/ to better
distinguish code that depends on 'real' from parts that do not.
Currently, it would create a lot of cyclic dependencies everywhere else.

Part of #1415.

Change-Id: I2aa1890357377d0d14c05b3968e1b36e1023458f

10 years agoFix cppcheck 1.64 warnings
Roland Schulz [Sat, 19 Apr 2014 08:51:39 +0000 (04:51 -0400)]
Fix cppcheck 1.64 warnings

Related to #1487

Change-Id: I223289d71e0dfc426f382d1bcb53b3509202779f

10 years agoMore efficient TNG selection group creation
Magnus Lundborg [Wed, 16 Apr 2014 06:29:18 +0000 (08:29 +0200)]
More efficient TNG selection group creation

Do not create a TNG selection group if no selection is specified
explicitly, or if the selection contains all atoms in the system.

Change-Id: Ibe2a14e55aff829fdb74de074447f00f0e85f090

10 years agoFixed nbnxn FE list allocation issue
Berk Hess [Wed, 16 Apr 2014 08:11:50 +0000 (10:11 +0200)]
Fixed nbnxn FE list allocation issue

With free-energy calculations, the nbnxn search code could write
beyond the list bound, which could cause a segv.
Fixes #1474

Change-Id: I4c202fc14b04980f05ad1b3ea001732fdfaa9f00