alexxy/gromacs.git
9 years agoConvert file format descriptions to rst
Teemu Murtola [Sat, 7 Feb 2015 05:11:25 +0000 (07:11 +0200)]
Convert file format descriptions to rst

Convert the old HTML files about file formats to reStructuredText, and
merge them on a single page.  This is more or less a blind conversion.
No attempt is made to make them appear particularly nice, or to fix
outdated information.  But this works towards the goal of reducing the
number of distinct document generation mechanisms, and should make it
easier to restore functionality of linking to file formats from
generated pages for programs.

Now the only thing that remains in the old-html directory is the
flowchart.

Change-Id: I88bfbdf48f3ba870c9501ef933c03a947ea43635

9 years agoGenerate man pages through Sphinx
Teemu Murtola [Sun, 1 Feb 2015 20:29:40 +0000 (22:29 +0200)]
Generate man pages through Sphinx

Instead of writing direct nroff markup from 'gmx help -export man',
generate the man pages using Sphinx from the same source that is used
for the HTML help.  This makes the code a lot more maintainable, and
enables using the same markup everywhere; where necessary for more
flexible formatting, the code can now be simply changed to emit direct
reStructuredText, and that get reasonably formatted in both contexts.
This should allow actually improving the man page contents in the
future.

For man pages, GMX_BUILD_HELP now only controls whether the installation
tries to install man pages or not; they are never built automatically,
as it now takes a substantial amount of time and requires Sphinx that
most people will not have available.

Currently the layout of the man pages (in particular gromacs.7) is not
very nice, but the situation is comparable to what it was earlier.

Change-Id: I3b581933369e573af5cbd614950c2a667a1c6fa4

9 years agoReplace tool HTML help with Sphinx-generated docs
Teemu Murtola [Sun, 1 Feb 2015 05:25:41 +0000 (07:25 +0200)]
Replace tool HTML help with Sphinx-generated docs

Instead of generating HTML pages directly, make 'gmx help -export rst'
export reStructuredText that is used as input for Sphinx to generate the
help pages as part of the Sphinx documentation.  Make other docs refer
to these with a native Sphinx construct :ref:`gmx something`, as it
seems not possible to make `gmx something`_ really work.
:doc:`/programs/gmx-something` works even nicer, but is a bit too much
typing.

Make various minor corrections to existing help documentation so that
they can be converted to rst without errors; the output is still very
ugly in several places (but it wasn't any better in the old HTML...).
This change does not aim to fix all problems; it will probably be easier
once we have more freedom in using different rst constructs.
Links to file formats do not work, but those should be easier to fix
once the file format descriptions are also in rst.

Remove installation of the old share/html/ pages, as there is very
little stuff left there.

Change-Id: Ie9d7f1435656d9cf1f60a7e1c4c3c2e440af227d

9 years agoImplemented documentation with sphinx
Mark Abraham [Fri, 16 Jan 2015 16:37:13 +0000 (17:37 +0100)]
Implemented documentation with sphinx

Added sections for install guide, main file of old online reference,
and stubs, tools and getting-started sections of user guide.

Removed corresponding parts of old documentation.

Remaining markdown files in the user guide will be converted
to rst in other patches.

Refs #1242

Change-Id: I798f57e39eea47301fb51750099d7988d81fc72d

9 years agoMerge release-5-0 into master
Roland Schulz [Thu, 12 Feb 2015 18:38:31 +0000 (13:38 -0500)]
Merge release-5-0 into master

Change-Id: I23579c289b8a057a94cf64b142759934b9402ee5

9 years agoFix removal of symlinks created during installation
Vedran Miletić [Sun, 1 Feb 2015 19:43:19 +0000 (20:43 +0100)]
Fix removal of symlinks created during installation

Installation of gromacs creates 2 symlinks for libgromacs.so, which become
broken once library is removed. During uninstall, CMake macro EXISTS will follow
symlink and conclude files do not have to be removed.

This patch adds IS_SYMLINK checking in addition to EXISTS.

Change-Id: Id7ef6768549a6fc09fb017e5be9ac286e4f7a026

9 years agoMerge release-4-6 into release-5-0
Roland Schulz [Thu, 12 Feb 2015 10:10:31 +0000 (05:10 -0500)]
Merge release-4-6 into release-5-0

Conflicts:
src/gromacs/mdlib/pme.c (just copyright)

Change-Id: I419b260004806229c6eb9f993413b480041f20cc

9 years agoRe-fixed PME bug with high OpenMP thread count
Berk Hess [Fri, 6 Feb 2015 13:05:44 +0000 (14:05 +0100)]
Re-fixed PME bug with high OpenMP thread count

    PME energies and forces could be incorrect with combined MPI+OpenMP
    parallelization. This would, only, happen when
    pmegrids->nthread_comm[YY] >= 2, which can only occur with high OpenMP
    thread count with multiple prime factors that are large wrt the grid.
    It's unlikely that this issue affected production runs.
    This bug was fixed in 27189bba, but 6ba80a26 broke it again.

    Fixes #1572.

Change-Id: Ic01bed4193062f8ca885fcb6bf347f2ef0de909f

9 years agoDon't set CFLAGS for Phi in toolchain
Roland Schulz [Wed, 22 Oct 2014 01:23:29 +0000 (21:23 -0400)]
Don't set CFLAGS for Phi in toolchain

The recommended way to set those flags is with CMAKE_*_FLAGS_INIT but
that is only passible in a platform file because those set in a toolchain
file get overwritten.

This fixes that extra CFLAGS passed on the command line don't get ignored.
Also move setting of fftw out of platform file because those should
be project independent.

Change-Id: I5f4d70efd8369bdef5f5060959e3568026d6820c

9 years agoWork-around for ICC 15 on Phi
Roland Schulz [Thu, 5 Feb 2015 06:28:51 +0000 (01:28 -0500)]
Work-around for ICC 15 on Phi

Change-Id: Id72e6fb124974f0d8572a1715bc1f25e536f7c69

9 years agoMake FindBoost quite
Roland Schulz [Thu, 29 Jan 2015 18:04:52 +0000 (13:04 -0500)]
Make FindBoost quite

Prevent boost from printing version on each cmake run. Makes
it consistent with other Find usage (xml, z, ...)

Change-Id: Ic1f99865c68222683b993b13b6e545e66bd7f536

9 years agoSupport more complex fixed position selections
Teemu Murtola [Wed, 28 Jan 2015 20:06:26 +0000 (22:06 +0200)]
Support more complex fixed position selections

Make it possible to create selections like
  [0,0,0] plus [0,1,0]
to specify a fixed set of positions.  This can be useful at least for
'gmx gangle' to calculate angles from a fixed reference vector.
Such selections were already understood properly by the parser, but
caused various crashes elsewhere in the code.  Fixed those crashes by
consistently managing the memory for the involved t_block structures
(always allocate one value in the index array, even if the block is
empty), and by not assuming that a plus-like keyword always has a child
element in the evaluation tree.

Fixes #1619.

Change-Id: I513cddbe882f269ad867c726a54583ee48b41b4d

9 years agoRe-enabled SIMD for angles and dihedrals
Berk Hess [Fri, 16 Jan 2015 09:05:14 +0000 (10:05 +0100)]
Re-enabled SIMD for angles and dihedrals

The SIMD acceleration for angles and dihedrals was accidentally
disabled recently during code reorganization, since the SIMD header
file was not includes and thus the SIMD macro was not set.

Fixes #1673

Change-Id: I04ddde71c9dd1a846ecf088a5c973e9a23846a52

9 years agoImplement user guide
Mark Abraham [Thu, 10 Jul 2014 13:06:49 +0000 (15:06 +0200)]
Implement user guide

Renamed former user manual to reference manual.

The content for the new user guide has mostly migrated in from the
wiki, install guide, and mdrun -h, and updated as appropriate. This
guide is intended for documenting practical use, whereas the reference
manual should document algorithms and high-level implementations, etc.

Established references.md to do automatic linking of frequently
used things. This can be automatically concatenated by pandoc
onto any Markdown file to do easy link generation.

Section on mdrun and performance imported and enhanced from the
Acceleration and Parallelization wiki page.

Added section on mdrun features, e.g. rerun and multi-simulation.

Section on getting started imported from online/getting_started.html
and updated - there used to be a tutorial here, but there isn't any
more. Linked to more up-to-date tutorials.

Added TNG to docs/manual/files.tex.

Removed gmx options, now that its content is in the user guide (in
tools.md).

Moved old mdp_opt.html to docs/mdp-options.html, for now. Removed from
reference manual, left pointer to new location. This is not an ideal
format or location either, but it's a step closer to being able to
generate it from the code. Some trivial fixes to content. Generating
links and references to follow in a future commit.

Moved environment-variable section from reference manual to user guide.
Minor fixes here.

Removed superseded reference manual sections on running in parallel or
with GPUs. Renamed install.tex as technical-details.tex, because that
is all that is left there. Moved section on use of floating-point
precision to chapter on definitions and units, and thus eliminated the
former Appendix A.

Cross-references from user-guide.pdf don't work well yet, but that
should be dealt with when we decide on the final publishing platform.

Some TODO comments for documentation sections remain for work in
future patches, but please note the other new content in existing
child patches, so we don't duplicate any work.

Change-Id: I026d67353863ae069c6c45b840a61fcaf205a377

9 years agoCorrect CUDA kernel energy flag
Berk Hess [Mon, 2 Feb 2015 14:11:11 +0000 (15:11 +0100)]
Correct CUDA kernel energy flag

The CUDA kernels calculated energies based on the GMX_FORCE_VIRIAL
flag. This did not cause errors, since (currently) GMX_FORCE_ENERGY
is always set when the virial flag is set. But using the latter flag
gives a small performance improvement when using pressure coupling.

Change-Id: If874e651058dc06c464f0fa810b17ba83146c9a3

9 years agoMerge branch release-5-0
Mark Abraham [Mon, 2 Feb 2015 16:06:08 +0000 (17:06 +0100)]
Merge branch release-5-0

Implemented usingGpu() for use by md.cpp in the new rerun behaviour,
because nonbonded_verlet_t is now opaque in master
branch. Unfortunately there is not yet a good home for its
implementation, so it's next to the "constructor" in forcerec.cpp.

Fixed typo in copyright header of gmx_detect_hardware.cpp

Conflicts:
src/gromacs/mdlib/forcerec.cpp
Added gromacs/simd/simd.h to the right place, per fix in release-5-0

src/gromacs/mdlib/tpi.cpp
Added gromacs/simd/simd.h to the right place, per fix in release-5-0

src/programs/mdrun/runner.cpp
Trivial conflict from introducing GPU-usage variables
on line before removal of time variables.

Change-Id: I6157d962d183fae4e6874057da01f44ce10e733c

9 years agoAvoid near-silent generation of zero energies
Mark Abraham [Fri, 23 Jan 2015 14:28:01 +0000 (15:28 +0100)]
Avoid near-silent generation of zero energies

There is note printed about this case for Verlet+GPU+energy groups,
and this is OK for normal simulations because the decomposition of the
energy into groups is unimportant. However, a user doing such a rerun
is probably seeking the energy decomposition, and in that case getting
zeroes is unexpected behaviour.

Instead, default to not using GPUs with mdrun -rerun -nb auto and more
than one energy group. In that case with mdrun -rerun -nb gpu, give a
fatal error and suggest the probable solutions.

Change-Id: I3006ed3ded31620d4faf4fc4a24cc85e9322c5c2

9 years agoFix FP exception in FE
Roland Schulz [Mon, 26 Jan 2015 08:29:13 +0000 (03:29 -0500)]
Fix FP exception in FE

Part of #1677

Change-Id: I212d52a232763e3f3b3652ea488ba5e05683aab1

9 years agoFix use of simd.h
Mark Abraham [Mon, 19 Jan 2015 10:55:35 +0000 (11:55 +0100)]
Fix use of simd.h

TPI correctness check was inactive.

Use of SIMD preprocessor symbols in forcerec.c was OK because it got
simd.h from nbnxn_simd.h, but also fixed the erroneous use of
transitive inclusion of simd.h just in case that helps someone.

Fixes #1673

Change-Id: Iaf42a4ec420139485de3e509662ca0892fa662c5

9 years agoAdd input file options that accept missing files
Teemu Murtola [Fri, 16 Jan 2015 20:26:44 +0000 (22:26 +0200)]
Add input file options that accept missing files

Add a flag to t_filenm and to FileNameOption that makes input options
not fail when the user-provided file does not exist.  Add tests for the
functionality.  Use the flag for -cpi option to support using the same
command line for initial and continuation runs.

Fixes #1672.

Change-Id: I62945266ff15449fb153d5153cd550b3a257df69

9 years agoRemoves some unnecessary ternary conditionals
John Baxter [Thu, 22 Jan 2015 21:33:45 +0000 (14:33 -0700)]
Removes some unnecessary ternary conditionals

In .../src/gromacs/mdlib/minimize.cpp calls to
the evaluate_energy() function.

Details:

The gmx_global_stat_t type argument in calls to
evaluate_energy() use this ternary expression:

evaluate_energy(..., gstat ? gstat : NULL, ...);

However, .../src/gromacs/legacyheaders/sim_util.h
shows gmx_global_stat_t is a typedef equivalent
to struct gmx_global_stat*, a pointer type; since
a pointer is TRUE if and only if it is not NULL,
the following is equivalent:

evaluate_energy(..., gstat, ...);

This patch performs this substitution.

Change-Id: I5bfc50dd8927fe1e797e06144535f61731fb7eb1

9 years agoWorkaround for MemorySanitizer
Roland Schulz [Fri, 16 May 2014 20:23:11 +0000 (16:23 -0400)]
Workaround for MemorySanitizer

MSan has false positives in qsort (Issue 54) and getlogin_r (83).

Change-Id: Ia63e918b59570e8dfb03222174bf83da24c6e219

9 years agoFix unitlized memory read in checkpoint
Roland Schulz [Tue, 27 Jan 2015 07:04:39 +0000 (02:04 -0500)]
Fix unitlized memory read in checkpoint

Older versions didn't prefix the version string
with VERSION and thus the scanf isn't returning
two fields for those.

Change-Id: I0c8734bd18a62ca5fd6841f2c57fa5a9698bc88c

9 years agoRemove old selection parser error handling code
Teemu Murtola [Sat, 8 Nov 2014 10:39:28 +0000 (12:39 +0200)]
Remove old selection parser error handling code

Now that the parser fully uses exceptions for error handling, the old
mechanism can go, simplifying the code in a few places.

Clean-up for #655.

Change-Id: I92c472a5298e89dce80e022d1e2101d822d90045

9 years agoImprove selection error messages (use exceptions)
Teemu Murtola [Sat, 8 Nov 2014 10:20:25 +0000 (12:20 +0200)]
Improve selection error messages (use exceptions)

Make all selection parsing error handling use exceptions for error
reporting, and improve the understandability and context-sensitivity of
the messages.  Make the code in params.cpp exception-safe.

Resolves #655 (except for some pending cleanup of now-unused code).

Change-Id: If7bc1da91041232db23389c660cc2cd9c50addda

9 years agoCleans up steepest descent initial potential hack
John Baxter [Thu, 22 Jan 2015 00:27:50 +0000 (17:27 -0700)]
Cleans up steepest descent initial potential hack

Addressed Bug #1676, in which there was a hack to
the do_steep() function in minimize.cpp where the
initial value of s_min->epot was set to
s_try->epot + 1; this patch ensures that the first
step's s_min->epot value is the true minimum
potential energy value and adds explicit checks
for the first step where necessary to ensure that
the behavior of do_steep() is unchanged.

Change-Id: I19c64a4948dfa24805345d7e593397d12ad4cc48

9 years agoChange some listed-forces headers to be library-only
Mark Abraham [Mon, 19 Jan 2015 11:20:28 +0000 (12:20 +0100)]
Change some listed-forces headers to be library-only

Some analysis tools call functions declared here, so they can't be
module-only (yet). Clients of libgromacs should only use functions
from listed-forces.h.

Moved ftype_is_bonded_potential() accordingly.

This will also make it easier to re-instate SIMD support for angles
and dihedrals, because there has to be an intra-module header that
declares the SIMD versions of those functions, and it cannot also be
an installed header if it depends on simd.h.

Refs #1673

Change-Id: Ia2815b57f712fbeb1e294dbea3231c6c9bfc32dc

9 years agoIgnore test-only dependency cycles
Teemu Murtola [Thu, 22 Jan 2015 15:38:08 +0000 (17:38 +0200)]
Ignore test-only dependency cycles

Make check-source and the dependency graph generation ignore
module-level dependencies where only tests in the source module depend
on the destination module.  This could possibly be more fine-grained (in
valid cases, the tests should only depend on a well-defined set of
low-level modules, not on any higher-level module), but for now this is
likely fine.

Change-Id: I9d218f632c6155ad6ba21a218bfc7ec940593b51

9 years agoUpdate FindCUDA work-around
Mark Abraham [Fri, 23 Jan 2015 12:33:48 +0000 (13:33 +0100)]
Update FindCUDA work-around

My patch for this issue is in the latest 3.1.1 release for
CMake after all.

Change-Id: I925f58b02b1f2056de84e53d37584051244e770e

9 years agoChanged "struct swap" to "struct t_swap"
John Baxter [Wed, 21 Jan 2015 23:04:31 +0000 (16:04 -0700)]
Changed "struct swap" to "struct t_swap"

Fixes #1674

Change-Id: Ia3917dd2ee9d30d2d280bd00fba8953b2eb5b432

9 years agoCorrected RDTSCP warning text
Berk Hess [Wed, 21 Jan 2015 11:33:40 +0000 (12:33 +0100)]
Corrected RDTSCP warning text

Change-Id: If66e2d3535df8bb96be29e628546ebb8706afd57

9 years agoMake data file path search more reusable
Teemu Murtola [Thu, 15 Jan 2015 19:53:16 +0000 (21:53 +0200)]
Make data file path search more reusable

Instead of returning the path to share/top from ProgramContextInterface,
return the installation prefix.  Make it the responsibility of the
caller to append the relative path to the data files it needs.  Clean up
config.h defines related to this to make them more generic.

This makes it possible to reuse the same logic to find files also in
other locations than share/top.  DataFileFinder is not yet similarly
reusable, but that is a topic for another change.

Change-Id: I7c7fc3730417e71ff43d1b6fadf00a0eb465d794

9 years agoRemoved gmx_header_config.h
Mark Abraham [Thu, 8 Jan 2015 13:29:04 +0000 (14:29 +0100)]
Removed gmx_header_config.h

Now we no longer install a header just to get platform
independence for functionality that is not actually
part of the the installed API.

Moved DIR_SEPARATOR into its own non-installed header.

Moved snprintf MSVC-workaround define into its own non-installed
header.

Moved GMX_NATIVE_WINDOWS definition to config.h

Removed checks related to the use of gmx_header_config.h

Refs #950, #1454

Change-Id: I6aebcddd6772dfa82bf1214c6ed42f9da6ac22e0

9 years agoConvert forcefield search to C++
Teemu Murtola [Sun, 11 Jan 2015 11:34:03 +0000 (13:34 +0200)]
Convert forcefield search to C++

- Convert gmx_directory_*() to a C++ class in directoryenumerator.*
  (code moved from futil.* and converted to C++).
- Add some errno checks to detect error conditions better.
- Add a function to enumerate files/directories in all GMXLIB
  directories to DataFileFinder, and use this to replace functionality
  in fflibutil.cpp.
- Convert the code to enumerate forcefields into a C++ function with a
  more descriptive name, and convert the choose_ff() function to C++ to
  avoid complicated logic where the same directory is searched multiple
  times with different functions.

This is mainly a rewrite of the code in C++, with only minor functional
changes:
- Unit tests of this code no longer get confused by GMXLIB being set
  (currently, there are no such tests, though).
- Force fields are searched using the same logic as other data files
  (the default directory is always searched).
- Some I/O errors are now handled with more descriptive errors instead
  of silently ignoring directories that cannot be listed.

Change-Id: Ib3d070af5907ea00dfa9409e753868251eb8c7da

9 years agoAdded two quotes from Julie Bernauer habilitation
Erik Lindahl [Tue, 13 Jan 2015 14:02:02 +0000 (15:02 +0100)]
Added two quotes from Julie Bernauer habilitation

Change-Id: Ic2cc616346326b992a9b8bc16e25b5b7df53719c

9 years agoAdd tip4pew parameters to oplsaa.ff
James Barnett [Wed, 14 Jan 2015 15:50:44 +0000 (09:50 -0600)]
Add tip4pew parameters to oplsaa.ff

The parameters come from:
Horn et al. (2004). J. Chem. Phys. 120, 9665-9678
http://dx.doi.org/10.1063/1.1683075

Change-Id: I634b54df422934b00378f27d068f1493e3690fa9

9 years agoRemove AnalysisNeighborhood::setUseBoundingBox()
Teemu Murtola [Tue, 13 Jan 2015 18:48:41 +0000 (20:48 +0200)]
Remove AnalysisNeighborhood::setUseBoundingBox()

Originally, this was added to provide more control for the caller about
how the search is done, with main user probably being more comprehensive
tests.  This method was possible because at that time, all the
coordinates were clamped to the edges of the grid when determining the
cell, so it was at most a bit inefficient if some positions were outside
the grid.

But now, there is no clamping, so this method no longer works correctly:
the grid must cover all the reference positions (i.e., be at least the
size of the bounding box), so that the reference positions really are
within the grid cell to which they belong.  Otherwise, when the grid
cells to search are pruned based on their distance from the test
position, some pairs could be missed.

Change-Id: I94ae4081f456c08ff89779ef20b91be0ca061d96

9 years agoMerge "Merge branch release-5-0"
Teemu Murtola [Sat, 17 Jan 2015 17:34:03 +0000 (18:34 +0100)]
Merge "Merge branch release-5-0"

9 years agoFix BlueGene/Q build with recent CMake
Mark Abraham [Mon, 5 Jan 2015 08:24:06 +0000 (08:24 +0000)]
Fix BlueGene/Q build with recent CMake

Works around broken FindCUDA.cmake in CMake 3.0 and 3.1, when cross
compiling, when the (optional) CMAKE_SYSTEM_PROCESSOR is not set.

Change-Id: I130ac95a84d4a67a7dbf6164ea93c37cda61066a

9 years agoImprove and clarify mdrun behavior with nsteps<0
Szilard Pall [Wed, 10 Dec 2014 20:18:37 +0000 (21:18 +0100)]
Improve and clarify mdrun behavior with nsteps<0

Instead of silently ignoring nsteps<-2 values passed on the command
line, mdrun now issues fatal error for these invalid inputs only
ignoring -2 (which is the default).
Also clarified the use of "infinite" runs with nsteps=-1.

Change-Id: I60956fca8490cd47aafc7fefce58f4b541cd926d

9 years agoMerge branch release-5-0
Mark Abraham [Thu, 15 Jan 2015 10:15:57 +0000 (11:15 +0100)]
Merge branch release-5-0

Conflicts:
src/programs/mdrun/md.cpp
Deletion in release-5-0 while fixing md-vv allocation bug was in the
same place as deletion in master when removing integrator iteration.
Resolved by deleting both.

Uncrustified and bumped copyright years.

Change-Id: If605ab0b406f81297acd3bd7ead0b4bde38d54d3

9 years agoFix allocation issue with VV integrator
Berk Hess [Mon, 12 Jan 2015 14:24:35 +0000 (15:24 +0100)]
Fix allocation issue with VV integrator

Allocation of temp buffers for VV and VVAK now uses state->natoms
instead of top_global->natoms.
Fixes #1669.

Change-Id: I64947405c138f601db7daa4f9628a04cff9fa8bb

9 years agoFix and suppress warnings on BlueGene/Q
Mark Abraham [Tue, 9 Dec 2014 12:42:15 +0000 (13:42 +0100)]
Fix and suppress warnings on BlueGene/Q

Extended the solution of I7158e16557 to the Program() function.

Suppressed warning about memory limits during compilation

Change-Id: Ib48fd7614817b8729fce0b0add9b7d68ce5608ff

9 years agoRefactor OpenMP initialization
Mark Abraham [Wed, 28 May 2014 09:23:46 +0000 (11:23 +0200)]
Refactor OpenMP initialization

Created two subfunctions so we have separated responsibilities.

Change-Id: I31a6766543e509ba1605db1a164f35746ecaa7e1

9 years agoRemove temporary symlinks from pre-5.0 tool names
Mark Abraham [Thu, 8 Jan 2015 07:41:22 +0000 (08:41 +0100)]
Remove temporary symlinks from pre-5.0 tool names

Change-Id: I6c09eba804008294813f9445737602f563f9f944

9 years agoRemove mdrun -testverlet
Mark Abraham [Thu, 8 Jan 2015 10:34:06 +0000 (11:34 +0100)]
Remove mdrun -testverlet

This was only intended for quick performance testing of old .tpr files
during the transition period. The window where that was useful has
passed, and ongoing abuse of it has been observed. There is no need to
preserve this until the formal removal of the group scheme.

Fixes #1424

Change-Id: I589a8e316beeba6819cd01d9655bfc069bcbb174

9 years agoRefactor logic for finding share/top/ files
Teemu Murtola [Thu, 1 Jan 2015 06:28:29 +0000 (08:28 +0200)]
Refactor logic for finding share/top/ files

Refactor the logic of how gmxlibfn() finds the library files into a
separate C++ class that provides some support for customization.

By itself, this change only rewrites the existing logic into C++ with a
few minor functional changes:
 - unit tests no longer get confused if GMXLIB is set, and
 - the default data directory is searched even if GMXLIB is set,
   removing the need to duplicate all the files into custom directories
   and/or to manually specify the default directory.
However, it also lays the groundwork for further refactoring:
 - consolidating the other direct use of GMXLIB env.var. from
   fflibutil.cpp into the same place
 - more reusable logic for finding the files, e.g., for JIT compilation
   or for structuring the data files into more than one directory
 - removing one-off uses of functions like low_libopen

Change-Id: I4e14a7e7f11846b3828265c1c735da6bc57f97ff

9 years agoHandle ivec* correctly in DD error message
Mark Abraham [Thu, 8 Jan 2015 18:37:46 +0000 (19:37 +0100)]
Handle ivec* correctly in DD error message

Fixes #1659

Change-Id: I2d0f666801c61fb1ecb56048cd8a776f42d272ee

9 years agoFix floating-point exception
Mark Abraham [Thu, 8 Jan 2015 12:50:30 +0000 (13:50 +0100)]
Fix floating-point exception

complex/swap_x does only two steps of MD and has been observed to give
a floating-point exception on Jenkins from print_wallcycle(). The last
stderr and .log output suggested tot == 0 may have been the problem,
but it can't actually be reproduced. Even if it's not fixing the right
problem, this code is preferable to the old version.

Change-Id: Iad514158ae551aded45787e8d595d3876b9e37c8

9 years agoClosed some .xvg files that were being left open
Teemu Murtola [Thu, 13 Nov 2014 20:14:25 +0000 (22:14 +0200)]
Closed some .xvg files that were being left open

Closed donor properties file in gmx hbond after removing use of
function static file pointer.

Improved naming and scoping of some file pointers in
analyze_clusters().

Added done_ed() as a place to close the essential dynamics output
file. Later, destructor content for ED should go here (or preferably
RAII).

Removed pr_energy() from gmx_cluster since it was never called.

Change-Id: I4c288e924eb81e9e0f87b8e59ee64dacc0708567

9 years agoCustom program context for unit tests
Teemu Murtola [Mon, 29 Dec 2014 06:14:48 +0000 (08:14 +0200)]
Custom program context for unit tests

This improves the usability and robustness of the tests:
 - The data files in share/top/ are now always looked up from the source
   directory, without relying on any detection of the binary location.
 - It is possible to override the location of the source directory for
   some cross-compilation scenarios, which changes both the lookup
   location of share/top/ and the test input/reference files.

Change-Id: I1be5861ee594217bf27895563feb2c09fafe86c7

9 years agoSplit unit test init from testoptions.cpp
Teemu Murtola [Sun, 28 Dec 2014 12:36:07 +0000 (14:36 +0200)]
Split unit test init from testoptions.cpp

There is now much more functionality than just handling the options, so
it is clearer that the initialization is in its own file.

Change-Id: Ibd2857cb33578b80ad4cbcbdde4839b5d10eb3f7

9 years agoUse analysis nbsearch for surface area calculation
Teemu Murtola [Sat, 20 Dec 2014 08:13:42 +0000 (10:13 +0200)]
Use analysis nbsearch for surface area calculation

This improves the code in several ways:
 - Amount of code that does the actual computation is reduced by about
   75%, making it significantly easier to follow.
 - Computation with PBC no longer does an all-pairs search.
 - The grid search is correct for triclinic cells (the old
   implementation would not have given correct results if the bug that
   caused an all-pairs search would not have been there).
 - All optimizations in the generic nbsearch code benefit also this
   algorithm: it is no longer limited to using grid cells that are
   larger than the cutoff, reducing the search volume considerably.

Also remove some other micro-optimizations to make the code clearer.
These can be reintroduced if they have a measurable effect on the
performance; a TODO in the code explains what they were.

Change-Id: I8f68c56992305e4b82c128d33cac50315b9d2824

9 years agoUse xvgrclose() for files opened with xvgropen()
Teemu Murtola [Tue, 6 Jan 2015 07:59:42 +0000 (09:59 +0200)]
Use xvgrclose() for files opened with xvgropen()

Most callers used gmx_ffclose(), but there were also several that just
didn't close the file at all, or used plain fclose().  Not using
gmx_fio_fclose() left internal data structures inconsistent, which could
have an effect in unit test binaries that could execute some code more
than once (in particular, if the checkpoint code was triggered, as it
then got confused about the improperly closed files).

For consistency, changed gmx_fio_fclose() to xvgrclose(), except in
places where there were paths on which the file was not opened with
xvgropen().  Fixed some logic issues with opening/closing files in
different branches.

Change-Id: Iefda6880b06391b73423156888aee1d436e38199

9 years agoSupport subset of rvec array as input for analysis nbsearch
Teemu Murtola [Sat, 20 Dec 2014 10:29:25 +0000 (12:29 +0200)]
Support subset of rvec array as input for analysis nbsearch

Make it possible to perform a neighbor search such that instead of using
a continuous rvec array as the reference/test positions, it is possible
considers a subset of such an array, specified by a separate index
array.

Also, add support for accessing the components of the shortest distance
vector between found pairs through AnalysisNeighborhoodPair.  This frees
the caller from a separate pbc_dx() call in case that distance vector is
of interest.

Tests could still be extended and improved, but left for a later change.

Change-Id: I253ddda483122367d9c41a5ed8bb172e476a90bb

9 years agoMinimal C++ replacement for rvec
Teemu Murtola [Sun, 14 Dec 2014 14:19:11 +0000 (16:19 +0200)]
Minimal C++ replacement for rvec

Add a C++ class that acts as rvec, but also supports placement in STL
containers (i.e., is default-constructible, copy-constructible, and
assignable) and can be returned from functions.  There is some ugly
reinterpret_casting required for rvec arrays to make this work, which
requires that the compiler generates compatible layouts for the class
and rvec.  The tests ensure that this is the case, but it could be nice
to check some more exotic compilers as well, unless someone knows the
C/C++ standards well enough to say that this layout is always ensured.

Passing RVec as 'const rvec &' unfortunately also needs an explicit
function call because of issues with cppcheck and MSVC.

Minimal solution to #1017.

Change-Id: I79be58bf7be2a78f787f470044b3b5abf234ec0c

9 years agoClarify GMX_MPI management
Teemu Murtola [Sun, 4 Jan 2015 14:46:09 +0000 (16:46 +0200)]
Clarify GMX_MPI management

Clarify semantics of GMX_MPI within CMake code: its meaning no longer
changes halfway through the main CMakeLists.txt file to mean "MPI or
thread-MPI" from its original meaning of "user selected real MPI".
Instead of having this logic in CMake, set GMX_MPI in config.h
programmatically.

The semantics of GMX_MPI are still different in the source code compared
to CMake, but that cannot be solved before some conclusion is reached
in #1320.

There have been several bugs (at least most caught during code review)
from assuming that GMX_MPI could be used to access the user input value
everywhere in CMake, and it is very confusing to follow the CMake code
because of this issue (the same code can have different behavior,
depending on the point where it gets executed).

CMake code still mixes GMX_LIB_MPI and GMX_MPI to check for the same
thing, but at least that no longer causes bugs.  Removed an obsolete
if (GMX_MPI AND NOT GMX_THREAD_MPI) construct.

Fix a regex in gmxtree.py to properly parse '#if defined ...' in
config.h.

Related to #1320.

Change-Id: Icbdedd30eaa39978b6a302660207376fce1bba4e

9 years agoEnable fp-exceptions
Roland Schulz [Mon, 28 Jul 2014 04:58:12 +0000 (00:58 -0400)]
Enable fp-exceptions

This can help with finding errors quicker because mdrun crashes as soon
as a floating point value overflows or is invalid. fp-exceptions are
only enabled for builds with asserts (without NDEBUG), mainly because
it isn't always possible to avoid invalid fp operations for SIMD math
without a performance penalty.

Also, fix a few places where we had 1/0 or other invalid fp operations.

Fixes #1582

Change-Id: Ib1b3afc525706f4b171564fcaf08ebf3b2be3122

9 years agoMinor selection clarifications
Teemu Murtola [Fri, 2 Jan 2015 16:49:03 +0000 (18:49 +0200)]
Minor selection clarifications

- Disallow unquoted strings as selection names.  This prevents
  "help all" getting parsed as a valid selection with name "help", as
  well as some unwanted behavior with typos in the first word of a
  selection.  The selections are much more readable with the name
  quoted, and all examples use the quotes, so there should be no harm
  done in making the syntax stricter in this case.
- Clarify the generic help text printed out by 'gmx help selections'.
  Now the help text references the manual, which contains a bit longer
  introduction to selections, instead of trying to duplicate that
  content.

Change-Id: I76a0b54b19e631c96c167cb55ed2dac5cff328a4

9 years agoFix crash with 'z of ...' within an expression
Teemu Murtola [Fri, 2 Jan 2015 17:20:06 +0000 (19:20 +0200)]
Fix crash with 'z of ...' within an expression

When a 'z of ...' construct was used within an arithmetic expression in
a selection, there were out-of-bounds array writes occurring during
selection compilation.  Initialize the number of values produced by such
constructs correctly to avoid this.

Change-Id: I7fb62c086bc02a96e90e35ab0a2d9944518900db

9 years agoUpdate copyright year in copyrite.cpp
Teemu Murtola [Fri, 2 Jan 2015 16:54:09 +0000 (18:54 +0200)]
Update copyright year in copyrite.cpp

Also, fix uncrustify.sh so that it works for files that have
filter=includesort git attribute.

Change-Id: I108e1d5cb5ce85f78a99bc966b8ea492db747f0c

9 years agoConvert gmx-insert-molecules into proper C++ module
Teemu Murtola [Tue, 9 Dec 2014 16:56:31 +0000 (18:56 +0200)]
Convert gmx-insert-molecules into proper C++ module

This makes the module a bit more exception-safe (but not perfectly),
removes remaining legacyheaders/ dependencies from the code, and
demonstrates how the new helper class works (and acts as a
proof-of-concept for that generic code).

This new approach also makes it easier to start using selections in the
tool, but that is a potential future improvement.

Change-Id: I0bad97ff7638f9f583a096f212c070c0e34af1a2

9 years agoAdd helper for generic C++ command-line modules
Teemu Murtola [Tue, 9 Dec 2014 16:54:25 +0000 (18:54 +0200)]
Add helper for generic C++ command-line modules

Add a helper class (gmx::CommandLineOptionsModuleInterface) that makes
it easier to implement proper C++ command-line modules for the wrapper
binary.  The module only needs to implement the interface instead of
gmx::CommandLineModuleInterface, and the helper class then takes care of
command-line parsing and help, based on options initialized by the
module in initOptions().  This removes the need to duplicate
command-line parsing and help code into each module.

Change-Id: I3e213ce530532bd3f60e34fd261fe06797d10326

9 years agoFixed pbc=xy + 2 walls + Verlet scheme
Berk Hess [Mon, 15 Dec 2014 19:31:44 +0000 (20:31 +0100)]
Fixed pbc=xy + 2 walls + Verlet scheme

Fixes #1660.

Change-Id: Id28f5d164c24d9bc6cb80faa8f4cba5e95262995

9 years agoFix bug FE + GPU + 2/3D domain decomposition
Berk Hess [Wed, 17 Dec 2014 10:26:21 +0000 (11:26 +0100)]
Fix bug FE + GPU + 2/3D domain decomposition

Fixes #1661

Change-Id: Ia84f6c1219a2052df0ed1c5c4d7f66c37ed7f67b

9 years agoRework gmx-solvate to use analysis nbsearch
Teemu Murtola [Sat, 11 Oct 2014 19:56:24 +0000 (22:56 +0300)]
Rework gmx-solvate to use analysis nbsearch

- More understandable control flow, with less code.
- No memory leaks.
- No dependency on mdrun/group kernel specific neighborhood search, so
  no confusing messages about deprecated group kernels or LJ/Coulomb
  cutoffs.  All output is controlled by the tool code now.
- Eventual group kernel removal no longer needs to consider these tools.
- Now tool code is independent of t_forcerec.

Even without additional algorithm-level optimization allowed by the new,
more flexible pair search, the new code outperforms the old one by ~30%
(in a debug build) in the cases triggered by the unit tests.

Some useful functionality is refactored into topology/.  Subsequent
changes can clean that up and start using those parts also in
insert-molecules.

Change-Id: Ibad1090667e057a00c08a84bdb6bebbf2e55c5f4

9 years agoFix CMP0054 cmake 3.1.0 warnings
Roland Schulz [Tue, 28 Oct 2014 21:49:08 +0000 (17:49 -0400)]
Fix CMP0054 cmake 3.1.0 warnings

Change-Id: I5d91289a543240fa6f493b7f7738522f3c268c07

9 years agoMake 'gmx sasa' calculation thread-safe
Teemu Murtola [Sat, 29 Nov 2014 13:51:10 +0000 (15:51 +0200)]
Make 'gmx sasa' calculation thread-safe

Remove use of all static/global variables from the surface area
algorithm in surfacearea.cpp.  This makes 'gmx sasa' computation mostly
thread-safe (only the Connolly surface output isn't).  This in turn
gives the first analysis tool that does a non-trivial amount of
computation per frame in a thread-safe manner.  Once we have TBB or some
other proper threading library in use, it should then be straightforward
to also implement threading support for the analysis framework, and
actually have a tool where the benefit could be observable.

Simplify the implementation a bit, as there were quite a few state
variables in the orignal code that were never used.

Change-Id: If9fa4829620afbe09c1e206903190ba03af8a082

9 years agoRemove some backwards-compatibility glue for Jenkins
Teemu Murtola [Tue, 16 Dec 2014 19:30:05 +0000 (21:30 +0200)]
Remove some backwards-compatibility glue for Jenkins

- GMX_CPU_ACCELERATION has not been used in a long time.
- The Documentation job should now be easy to update to use
  'make check-source' instead of 'make doc-check'.  There have been
  various bumps to the regression tests that already make Jenkins vote
  -1 for all changes older than the introduction of 'check-source',
  so an additional negative vote from the Documentation job should not
  matter.

Change-Id: Ic9908b2cdb56b43823c4f2c5e53294688f1af89d

9 years agoMerge "Merge branch 'release-5-0'"
Roland Schulz [Wed, 17 Dec 2014 09:06:07 +0000 (10:06 +0100)]
Merge "Merge branch 'release-5-0'"

9 years agoFix cppcheck-1.67 warnings
Roland Schulz [Sun, 14 Dec 2014 20:25:53 +0000 (15:25 -0500)]
Fix cppcheck-1.67 warnings

Remove suppressions for previous cppcheck versions

Change-Id: Ifb03e7b2300b65ca8adb8e22b71da25ea472be52

9 years agoMake 'gmx sasa' volume computation translation-invariant
Teemu Murtola [Sat, 29 Nov 2014 05:48:10 +0000 (07:48 +0200)]
Make 'gmx sasa' volume computation translation-invariant

Compute the center of the molecule also when PBC is used, instead of
using the origin as the center.  The center is used for volume
computation, and this makes the output translation-invariant with PBC.
This also makes the results of PBC and no-PBC computation match for the
same structure in case there are no contacts over the PBC.

The whole volume algorithm is broken if the molecule is split across
PBC in the input structure (which is likely the case if one wants to use
-pbc), and that would require substantially more effort (essentially,
making each continuous surface whole before computing the volume), so
only added a note to 'gmx sasa -h' to explain this for now.

Change-Id: I1cf75505ceb403f5650f05453ec2bc7b979d1e9e

9 years agoMove code to prepare for GPU interface rework
Mark Abraham [Thu, 11 Dec 2014 16:31:25 +0000 (17:31 +0100)]
Move code to prepare for GPU interface rework

This is pure renaming, so hopefully rebases work better. Two of the
header files were being explicitly removed from the set installed, but
now that these headers are no longer in legacyheaders, this issue is
resolved.

Change-Id: I5bbc89c2e52e0d92704896c48eeed5d9c00fd61a

9 years agoMerge branch 'release-5-0'
Mark Abraham [Mon, 15 Dec 2014 23:29:20 +0000 (00:29 +0100)]
Merge branch 'release-5-0'

Conflicts:
CMakeLists.txt
Only changes from version numbers and test hashes, not relevant
for master branch

Change-Id: Ia10e2b82a4ffc3ac408813081c15fe6a858a93f3

9 years agoFix NVML detection on Windows
Roland Schulz [Mon, 15 Dec 2014 00:32:29 +0000 (19:32 -0500)]
Fix NVML detection on Windows

Change-Id: I681744dd21a8390cbe2b2ad23c1ad49f2633b241

9 years agoRemoving iteration + constraints framework
Mark Abraham [Sat, 29 Nov 2014 21:53:23 +0000 (22:53 +0100)]
Removing iteration + constraints framework

Getting rid of iteration + constraints required by the use of MTTK +
constraints, in order to simplify the main loop.

Eliminated related variables and arguments that are now unused.

Left some otherwise useless brace pairs in do_md(), so that
uncrustify-friendly formatting was preserved, so we can more easily
review this for correctness. Left TODOs to remove those braces later.

Implemented mdrun check so that an old .tpr with MTTK + any form of
constraints cannot be run.

Refs #1137

Change-Id: I22816de7db4420a66341fa8bf35d967a71ad6568

9 years agoVersion bumps after new release
Mark Abraham [Wed, 1 Oct 2014 12:31:12 +0000 (14:31 +0200)]
Version bumps after new release

Numbers bumped, -dev tag replaced.

Change-Id: I59bbe346656f1892e154f899bac361fcfeea65a1

9 years agoVersion 5.0.4
Mark Abraham [Tue, 9 Dec 2014 10:42:34 +0000 (11:42 +0100)]
Version 5.0.4

Removed -dev tags from versions. Bumped regressiontest hash.

Change-Id: Idcb1c288b0119c17a9ad644179e96c4734a798f6

9 years agoFix constraints checks in grompp
Mark Abraham [Sat, 29 Nov 2014 21:50:25 +0000 (22:50 +0100)]
Fix constraints checks in grompp

This adds F_CONSTRNC to the set of interactions that should trigger
checks on SHAKE and LINCS parameters, and permits the MTTK check to
test also for SETTLE for its warning. The latter will also be used to
prevent MTTK + any constraints in a subsequent patch.

Change-Id: I175a2f050623192ff35a4cf93605fcfdd909f41a

9 years agoMerge "Merge release-4-6 into release-5-0" into release-5-0
Mark Abraham [Mon, 15 Dec 2014 17:57:47 +0000 (18:57 +0100)]
Merge "Merge release-4-6 into release-5-0" into release-5-0

9 years agoUse new XML format with cppcheck
Teemu Murtola [Sun, 14 Dec 2014 15:10:54 +0000 (17:10 +0200)]
Use new XML format with cppcheck

The console output in Jenkins is full of warnings about the old format,
and apparently some issues are not reported in the old format.

Change-Id: I35a40444b39b697d765d65c14706ebe7d2dcf67d

9 years agoC++ interface for surface area calculation
Teemu Murtola [Sat, 29 Nov 2014 04:58:51 +0000 (06:58 +0200)]
C++ interface for surface area calculation

Convert nsc_dclm_pbc() to a C++ class that provides the same interface,
except that the number of surface dots is specified separately, not for
each calculation.  The internal implementation is still mainly the same,
but the new interface makes it possible to get rid of the global
variables storing the unit sphere surface dots.  This in turn is
requires for making the algorithm thread-safe.

Clean up the implementation a bit by making internal functions static
(they will later become members of the Impl class), and replacing some
error-handling-by-writing-to-stderr-using-global-variables with asserts
or silent proper behavior.

Add tests for all the different paths of the unit sphere surface dot
generation.  These help ensure that the algorithm stays unmodified when
it gets refactored for thread safety.

Change-Id: Icf39eb4d105555b2eafdfd70b219a73c294900af

9 years agoUse bitmask for bonded
Roland Schulz [Wed, 26 Nov 2014 01:40:30 +0000 (20:40 -0500)]
Use bitmask for bonded

Also move bitmask to utility and f_thread_t to forcerec-threading.h.
This introduces a cycle because listed-forces now depends on
mdlib/forcerec-threading.h. There is not yet a module where
forcerec-threading.h can go.

Change-Id: Ic220be2880f7263aa0e50b13f07ed509eb86e1b3

9 years agoFour new quotes from around the world.
David van der Spoel [Thu, 11 Dec 2014 19:54:05 +0000 (20:54 +0100)]
Four new quotes from around the world.

Change-Id: Ib2f597c1f0e55160365d9e074b02b7eacbb84298

9 years agoRemove heuristic group-scheme neighbour-list updates
Mark Abraham [Thu, 3 Oct 2013 19:05:00 +0000 (21:05 +0200)]
Remove heuristic group-scheme neighbour-list updates

-1 == nstlist used to trigger the use of an algorithm that did
neighbour searching only when particles had moved far enough that
there might be a need to update the list. This supported obtaining
better energy conservation with the group cut-off scheme. It has been
superseded by the Verlet cut-off scheme.

Part of #1292

Change-Id: I074790c1c5670e874b8b587a1d46e62e2edc8961

9 years agoFix latent bug in OpenMP initialization
Mark Abraham [Fri, 23 May 2014 19:07:54 +0000 (21:07 +0200)]
Fix latent bug in OpenMP initialization

mdrun worked fine because it only tries to call
gmx_omp_nthreads_init() once, but anybody trying to run thread-MPI
mdrun (e.g.) as a library or in tests would see a hang, because the
master rank never gets to the barrier because of the premature return.

Extracted a function, so that the return works as intended, which will
help us reason better about this code. Used quick return statements
for control flow, rather than nested conditionals, but there's no
other change to the functionality.

mdrun with OpenMP can now be called more than once. As a side effect,
even without OpenMP, the subsequent calls to mdrun now issue the
over-subscription warning - and all OpenMP runs report the OpenMP
settings.

Change-Id: Ie7019565ef9a513cf4dfb530e90452d4ef48289e

9 years agoAdd StringFormatter and formatAndJoin to stringutil
Mark Abraham [Sun, 18 May 2014 10:48:46 +0000 (12:48 +0200)]
Add StringFormatter and formatAndJoin to stringutil

The StringFormatter functor wraps formatString so that we can write
one-liners that take a container, format its objects to strings, and
join them with a separator into one string for e.g. logging output.

Re-implemented joinString in terms of formatAndJoin, by using an
IdentitfyFormatter, thus eliminating duplication of implementation.

Added some tests for joinString also.

Applied new functionality to reporting GPU status information.

Change-Id: I424543a1ca4e214c438cc39f104f087e7e70030a

9 years agoConvert gmx rdf to the C++ framework
Teemu Murtola [Thu, 26 Jun 2014 11:59:07 +0000 (14:59 +0300)]
Convert gmx rdf to the C++ framework

Convert the RDF calculation tool to the new framework.  Main changed
beyond mechanical conversion:
 - Remove -com and -rdf options in favor of using selections directly.
   Both functionality, and a lot more, is now directly supported with
   proper selections.
 - Remove -hq and -fade options, as both are just post-processing that
   can be trivially done based on the output xvg file alone.
 - Normalization is reworked to work with dynamic selections.
 - Add an -rmax parameter that allows specifying an upper cutoff for the
   RDF.  Combined with the use of the neighborhood search routines, this
   potentially makes the tool a lot faster if the RDF is not required up
   to half the box length.

Add basic unit/regression tests for a simple water box.  The reference
values are not verified in any way, so they mainly catch regression
bugs.

Change-Id: Ieed19fc39a84e299291232190333652ced26abee

9 years agoMerge release-4-6 into release-5-0
Mark Abraham [Thu, 11 Dec 2014 11:22:00 +0000 (12:22 +0100)]
Merge release-4-6 into release-5-0

Change-Id: I952a9b8dd61c0eb7456c640997093a1a5fea8fc3

9 years agoAdded grompp error for pulling to negative distance
Berk Hess [Thu, 11 Dec 2014 10:13:34 +0000 (11:13 +0100)]
Added grompp error for pulling to negative distance

Change-Id: Ida5f449709c95e7c89cff32957b9e57bc9d68212

9 years agoFix nstep command line override print
Szilard Pall [Wed, 10 Dec 2014 16:49:07 +0000 (17:49 +0100)]
Fix nstep command line override print

The commit addresses two issues:
- printing negative simulation length with "-nsteps -1";
- eliminates rounding when converting a non-integer time-step value from
  fs to ps units.

Fixes #1633

Change-Id: If1aac7e0f4e8e37f3e9777fa4eaa79744f3ccd65

9 years agoFix misc. analysis neighborhood search issues
Teemu Murtola [Sat, 6 Dec 2014 05:14:15 +0000 (07:14 +0200)]
Fix misc. analysis neighborhood search issues

- Avoid an overflow fp-exception in case of zero cutoff (original fix by
  Roland).
- If a bounding box of the reference positions has a zero size in
  some dimension, fall back to a single grid cell and simple searching
  in that dimension (this could possibly be improved after the search
  uses a rectangular grid).
- If the bounding box (or the PBC box) is very flat or has a forced
  single grid cell in some dimension, adapt the grid dimensions such
  that the cells really have ~10 particles on average.

Change-Id: I4f8e5df9c4c479e480052e575354c54319bac22f

9 years agoTrack locations for selection parsing products
Teemu Murtola [Wed, 5 Nov 2014 19:32:46 +0000 (21:32 +0200)]
Track locations for selection parsing products

SelectionTreeElement and all intermediate structures used for selection
method parameter parsing now track the location in the input string.
By itself, this change does nothing, but it enables the subsequent
change that switches to exceptions to use this information for much
better context information in the error messages.

The location is kept as a SelectionLocation instead of as a string to
avoid spending a lot of memory for these strings with complex
selections: in general, each node in the tree contains the concatenation
of the strings from its child nodes, and there can be quite a few nodes
at the top that all contain have the full selection as their location.

Related to #655.

Change-Id: I7b1a317e043c6ff791b25f5fa357d8166c577fae

9 years agoFix recent bug with trilinic 1D DD
Berk Hess [Mon, 8 Dec 2014 21:18:35 +0000 (22:18 +0100)]
Fix recent bug with trilinic 1D DD

A recent bug-fix (c8d919a3) for triclinic 1D domain decompostion
introduced a bug for boxes with box[YY][XX]!=0.
Fixes #1656.
Refs #1631.

Change-Id: I06b9376212390b73e90a3ce9704dee2bad9693fb

9 years agoVersion bumps after new release
Mark Abraham [Wed, 1 Oct 2014 12:31:12 +0000 (14:31 +0200)]
Version bumps after new release

Numbers bumped, -dev tag replaced.

Change-Id: I823a0a79a805c67988a461d891771ff999c6548f

9 years agoVersion 5.0.3
Mark Abraham [Tue, 9 Dec 2014 10:42:34 +0000 (11:42 +0100)]
Version 5.0.3

Removed -dev tags from versions. Bumped regressiontest hash.

Change-Id: Ieb2588deeb5c866d621af7cbe7e5709ac6f53220

9 years agoMake tune_pme understand the "-nsteps" option. Fixes #1650
Carsten Kutzner [Wed, 3 Dec 2014 10:34:38 +0000 (11:34 +0100)]
Make tune_pme understand the "-nsteps" option. Fixes #1650

All command line arguments that tune_pme does not understand are passed over
to mdrun. For a quick sanity check the mdrun options are used together with the
additional option "-nsteps 1", which then appears twice on the command line.

The solution is to let tune_pme understand the "-nsteps" argument, so that it
only occurs on the mdrun command line at launch time. The option for that was
already there but before called "-simsteps".

Change-Id: I8362ced75e67b0e28b4a5e1bd427ae6ae4e0e758

9 years agoMerge "Merge release-5-0 into master"
Mark Abraham [Mon, 8 Dec 2014 23:14:56 +0000 (00:14 +0100)]
Merge "Merge release-5-0 into master"

9 years agoRectangular grid for analysis nbsearch
Teemu Murtola [Fri, 24 Oct 2014 17:45:21 +0000 (20:45 +0300)]
Rectangular grid for analysis nbsearch

Previously, the grid-based analysis neighborhood search used triclinic
grid cells covering the triclinic unit cell.  This made PBC handling
easy, but all other math is more complicated, and the volume where pairs
are searched is sub-optimal for triclinic boxes.  Now, the grid is
composed of rectangular cells that cover the rectangular unit cell.

The most significant change to support this is that most computation for
what cells to loop over is now done in fractional cell coordinates to
support for non-integral shift of the cell grid at the edges of
triclinic boxes.  The fixed list of cell neighbors is replaced with
on-the-fly computation, since the non-integral shifts mean that the list
of neighbors is not always the same.  This approach also allows the list
of cells in the loop to easily depend on the test position.  Any cells
that are completely outside the cutoff from the current test position
are skipped completely, improving the efficiency also for rectangular
boxes.

Currently, the list of cells looped over is still a rectangular
box, but with rectangular cells, the math to exclude corners should be
straightforward to add in subsequent changes.

Change-Id: I8bd4fa67e26e282cd5bd82dee5edfaf651e59a19

9 years agoFixed pull coord init with rate!=0, t_start!=0
Berk Hess [Tue, 2 Dec 2014 10:14:22 +0000 (11:14 +0100)]
Fixed pull coord init with rate!=0, t_start!=0

When the start time of a simulation is non-zero a pull setup with
coordinates with rate!=0 and pull-start, grompp would generate
incorrect pull init reference values.
Also fixed the layout of the grompp pull coord information table.

Change-Id: I992a40b098853aba0922ec1d596430eb229d64a8