alexxy/gromacs.git
9 years agoFix GCC5 warnings
Roland Schulz [Sat, 28 Feb 2015 21:51:32 +0000 (16:51 -0500)]
Fix GCC5 warnings

Change-Id: I61d2a1f427b12dc2530dd8929d8b90646c1faefc

9 years agoRe-implement gmx tune_pme -cpi
Mark Abraham [Tue, 20 Jan 2015 11:09:21 +0000 (12:09 +0100)]
Re-implement gmx tune_pme -cpi

The previous implementation just copied mdrun, but that implementation
does things that are more complicated than tune_pme needs, and in turn
slightly complicated the implementation for mdrun.

Change-Id: Idab32148bc04f3a1c62ab78de8f77179e43317aa

9 years agoAdded single-accuracy SIMD double math functions
Erik Lindahl [Thu, 31 Jul 2014 09:54:55 +0000 (11:54 +0200)]
Added single-accuracy SIMD double math functions

Apart from double SIMD variables typically being
half the width of single, the math functions are
considerably more expensive due to higher-order
polynomials, which can drop the throughput to 25%
of single. In some cases we do not need the full
double precision in SIMD operations, so these
new math functions use double precision
SIMD variables but only target single precision
accuracy, which can improve performance twofold.
The patch also makes the target precision in
single and double SIMD an advanced CMake variable,
and the unit test tolerance is set based on these
variables. This can be used (decided by the user)
for a few platforms where the rsqrt/inv table
lookups provide one bit too little to get by
with a single N-R iteration based on our default
target accuracy of 22 bits.

Change-Id: Id4b1c7800e16cb0eb3d564e89a368b4db6eede3e

9 years agonbnxn utils performance improvement for Phi
Roland Schulz [Thu, 5 Feb 2015 07:14:36 +0000 (02:14 -0500)]
nbnxn utils performance improvement for Phi

Also remove usage of unpack to load half/quarter aligned data, because
in case of misaligned data, instead of SegF it only loaded partial data.

Change-Id: Ib0f7807986e6fcbe998bd6ee41ce104666446321

9 years agoFix div by zero in PP/PME ratio
Berk Hess [Thu, 12 Feb 2015 14:58:11 +0000 (15:58 +0100)]
Fix div by zero in PP/PME ratio

Since we have floating pointing exceptions by default with debug
builds, these no longer ran with separate PME ranks.

Change-Id: I8b15a93901495dbde5dff959001c52ada7414008

9 years agoMove mdrun signalling code
Mark Abraham [Tue, 25 Nov 2014 20:23:37 +0000 (21:23 +0100)]
Move mdrun signalling code

No functionality changes here, I just put some related functionality
into functions in their own source file to
* simplify later removing inter-simulation signalling, and
* prepare for further encapsulation later.

Updated struct name and usage for new style. Updated include guards.
Removed now-useless C++-compilation guard from header file. Added
basic Doxygen.

Change-Id: I3ea1e2f77a1cdb6608bba38f08a430cc3b8d7c9a

9 years agoAdd test that plain multi-simulation works
Mark Abraham [Mon, 5 Jan 2015 08:45:04 +0000 (09:45 +0100)]
Add test that plain multi-simulation works

Refactored replica-exchange tests so that we can test
multi-simulation and replica-exchange separately with
little duplication.

Noted TODO that mdrun -multidir is not tested

Change-Id: Ib531d81103adc2a5b1757ef685c0e23960febdb2

9 years agoUpdated documentation for electric fields.
David van der Spoel [Sun, 15 Feb 2015 20:04:48 +0000 (21:04 +0100)]
Updated documentation for electric fields.

Simulations with alternating electric fields have been possible for
8 years without this being documented. Now it is documented.
A please cite call has been added as well.

Change-Id: Iec60972622af3b2f9c7f1009e54e24bbd5600cd2

9 years agoAdded parentheses for casts in SIMD macros
Berk Hess [Thu, 29 Jan 2015 10:21:18 +0000 (11:21 +0100)]
Added parentheses for casts in SIMD macros

Change-Id: I7b7a2346ad59b19d25be502cfb1c6c82c81a409f

9 years agoDon't search installation prefix if binary is not found
Roland Schulz [Wed, 18 Feb 2015 05:50:21 +0000 (00:50 -0500)]
Don't search installation prefix if binary is not found

It is possible that the binary isn't accessible (e.g. Cray launcher) and it
is not valid to call isEquivalent if the path is invalid.

Change-Id: Idf82a8c951fdc91a2de15d310843d54961ba74eb

9 years agoRun replica-exchange tests with MPI enabled
Mark Abraham [Sun, 4 Jan 2015 12:32:16 +0000 (13:32 +0100)]
Run replica-exchange tests with MPI enabled

Replica exchange only works with real MPI and at least two ranks. This
can now be handled by ctest, so we can run such tests automatically.
The other integration tests run in MPI mode, but do not place any
requirements upon the number of ranks, so they continue to run in the
usual way.

Fixed the replica-exchange integration tests so that they actually do
run. Changed tests to use mdrun -multi because it is easier to write
the tests that way. (Using mdrun -multidir is problematic, because
grompp needs to write the .tpr file in the subdirectories. When using
mdrun -multi, the only issue is that the name of the .tpr file for
grompp and mdrun is different, because the latter will append the MPI
rank.)

Fixed member variables to conform to naming convention.

Refs #1587

Change-Id: I11dc06f3aac81a80d679b036aef24762e9eec819

9 years agoAdd infrastructure for running MPI integration tests
Mark Abraham [Sun, 4 Jan 2015 12:27:34 +0000 (13:27 +0100)]
Add infrastructure for running MPI integration tests

Some algorithms need a minimum number of ranks to run meaningfully.
With this patch, ctest acquires the necessary logic that "make tests"
can do the right thing if the MPIEXEC_* variables are set correctly
for the excecution environment.

Added machinery so that integration tests can be written to use
the new logic, but no tests actually do so yet.

Updated install-guide section for the new (and some old)
functionality.

Minor fix to the ordering of mdrun integration test files so that they
match the comments.

Refs #1587

Change-Id: I01b419c10db42e98be708d1d4deffeba34a6d22d

9 years agoC++ conversion for PME spread/gather
Roland Schulz [Mon, 27 Oct 2014 17:35:46 +0000 (13:35 -0400)]
C++ conversion for PME spread/gather

Noted TODO for future refactoring

Change-Id: Ib130a59a26f124645a3da0fe168d2125e05ac824

9 years agoNew and reorganized documentation
Mark Abraham [Tue, 15 Jul 2014 14:40:19 +0000 (16:40 +0200)]
New and reorganized documentation

Covers more mdrun options, moves a bit of "practical" content from the
reference manual to the user guide.

Imported and updated information from wiki page on cutoff
schemes. Consolidated with information from reference manual.

Updated some use of "atom" to "particle" in both guides.

We could update the performance numbers, but with the impending
removal of the group scheme, I don't think that's worth bothering
about. e.g. on Haswell, Erik already tested performance of group is a
bit slower than Verlet, even for unbuffered water systems.

Change-Id: I6410ba9fc08bb133ec8669e14dba11bcbd454fe3

9 years agoAdd content to user guide
Mark Abraham [Fri, 16 Jan 2015 13:58:24 +0000 (14:58 +0100)]
Add content to user guide

Converted sections on environment variables, mdrun features, mdrun
performance to reStructuredText.

Change-Id: I2a18528729dc6756be093e52e6f87f9df9fe3b94

9 years agoSplit pme.c into multiple files
Mark Abraham [Wed, 8 Oct 2014 17:38:59 +0000 (19:38 +0200)]
Split pme.c into multiple files

Hopefully, this will guide the way for some more internal structure,
so that more structs can become opaque, etc.

Made pme_spline_work_t into opaque struct pme_spline_work. Changed
usage of gmx_pme_t to struct gmx_pme_t, per policy.

Renamed parameters of reuse_pmegrids to avoid "new" being interpreted
by uncrustify as a C++ symbol (also needed for subsequent C++ use).

Noted a TODO for possible future consolidation of serial and threaded
implementations.

Change-Id: I833b8d3e1ec746435de44ba93518e13eb3d5c76b

9 years agoAdd mdp-options to user guide
Mark Abraham [Thu, 15 Jan 2015 23:06:10 +0000 (00:06 +0100)]
Add mdp-options to user guide

Formating changes to create hyperlink targets and index entries using
custom reStructuredText directives. There are likely many
opportunities for cross-references that are not yet implemented.

With some extra effort (not using the convenient add_object_type()), it
should also be possible to remove the integrator= part from references
to mdp values and add customized index entries for them, but with the
current directive and role syntax, that can be done independently from
writing the documentation.

Fixes #1180

Change-Id: Id43cdbe9d3c2faab76fb12ac07abfd88a688dcd6

9 years agoFixed parallel distribution and thread count reporting
Berk Hess [Tue, 24 Feb 2015 14:52:06 +0000 (15:52 +0100)]
Fixed parallel distribution and thread count reporting

The domain decomposition no longer prints the atom count for all ranks
(which gets far too long at high parallelization), but rather av,
stddev, min and max.
Corrected the OpenMP thread count print, which often printed 0 thread
for (non-existent) PME ranks.
Fixes #1681, #1685.

Change-Id: Ia0e01c1c458e464ba2469d45c94d9e8c6b85d128

9 years agoAdded AVX-512ER SIMD support
Erik Lindahl [Wed, 9 Jul 2014 16:37:06 +0000 (18:37 +0200)]
Added AVX-512ER SIMD support

This SIMD architecture adds 28-bit
accuracy table lookups for 1/x and
1/sqrt(x), as well as a 23-bit accurate
version of exp(x). This is likely to
be the first architecture of the Knight's
landing MIC, while standard AVX-512F is
reserved for future Xeon x86 processors.
Just as for the other low-level implementations,
this does not include any kernels and will
not be enabled automatically yet.

Change-Id: I895beda369c1e6aa7d0a08944283036423873a2b

9 years agoAdd AVX-512F SIMD support
Erik Lindahl [Wed, 9 Jul 2014 13:16:50 +0000 (15:16 +0200)]
Add AVX-512F SIMD support

This adds cpuid detection for AVX-512F and the
low-level SIMD implementation. It is not yet present
in any shipping hardware, but the knights landing
version of Intel MIC will be the first CPU to support
it, as well as future generations of their normal
x86 CPUs (i.e., it merges MIC and x86 SIMD). The
implementation currently only works with icc, and
passes unit tests in the Intel SDE emulator. Some kernel
kernel support functions are not yet implemented, and
the instruction set will not be enabled automatically yet.

Change-Id: I2afa7ac2c1cf29577041c9dfefeb323b86f540c3

9 years agoFamous quote from Colleen McCullough
Erik Lindahl [Fri, 20 Feb 2015 21:30:32 +0000 (22:30 +0100)]
Famous quote from Colleen McCullough

Change-Id: I951d01208d15deccdeed48d044bebd07dde87a07

9 years agoAdded two pop-culture quotes from Andy Warhol.
Erik Lindahl [Fri, 20 Feb 2015 20:47:57 +0000 (21:47 +0100)]
Added two pop-culture quotes from Andy Warhol.

Change-Id: I94a165f913de821438310e21858d92fa0d2806e2

9 years agoReenable SIMD for R-B dihedrals
Mark Abraham [Sun, 15 Feb 2015 18:24:50 +0000 (19:24 +0100)]
Reenable SIMD for R-B dihedrals

Fixes #1686

Change-Id: If612a5afde4bcfd55319d2b6e38b521aa43a9973

9 years agoFix mdrun-only build
Mark Abraham [Fri, 13 Feb 2015 18:13:02 +0000 (18:13 +0000)]
Fix mdrun-only build

The GMX_BUILD_ONLY_MDRUN build now does not include
the gmxpreprocess module. Some Verlet-scheme code moved
to mdlib because it it used in mdrun and grompp.

gmx membed uses a utility function otherwise used only in
gmxpreprocess, but the error message it gives is wrong for the gmx
membed context, so I duplicated the function definition for now. Noted
TODOs for future clean up.

Fixes #1683

Change-Id: Ibc1291e88151f8d5befac2b1840a41402272a05f

9 years agoReplace more [BR] with rst bullet lists
Teemu Murtola [Tue, 10 Feb 2015 18:48:15 +0000 (20:48 +0200)]
Replace more [BR] with rst bullet lists

Make the console output format rst-style bullet lists nicely, and use
these instead of [BR] tags to create proper bullet lists in program help
texts.  The produced output looks much nicer in all the output formats
(including the console) compared to what it was before any rst changes.

Now the number of [BR] tags remaining is relatively low, and can fixed
at some later time.

Change-Id: I8d74f1a8f3a338202ab901d28f608a8c25794f19

9 years agoReplace some [BR] in help texts with rst literals
Teemu Murtola [Mon, 9 Feb 2015 16:08:24 +0000 (18:08 +0200)]
Replace some [BR] in help texts with rst literals

[BR] cannot really be implemented in rst, so replace those [BR]
instances that were used to implement literal blocks with rst literal
blocks.  Refactor the help output formatting such that line breaks in
the input string get transfered literally to rst output, and make the
console output aware of the line breaks in the input string so that it
can do wrapping as required.  Fix cases that do not produce valid rst
now that leading whitespaces are no longer stripped.

As a side effect of this change, remaining [BR] instances in the help
are now somewhat uglier in the console output, but that can hopefully be
fixed in the future.  On the other hand, the literal blocks look much
nicer on the html and man pages.

Change-Id: If67106c74f84de04d55a2e8c300949c5a297f909

9 years agoMove flow chart from old-html to Sphinx
Teemu Murtola [Sun, 8 Feb 2015 05:22:20 +0000 (07:22 +0200)]
Move flow chart from old-html to Sphinx

Get rid of the remaining HTML page generated from old-html/, and all the
machinery that was there just to generate and link to these pages.
The images used by the flowchart still remain in old-html/ and there is
a target to copy them to the output, but this is significantly simpler
than what it was.

For now, replace the flow chart with raw HTML within rst; using
something like sphinx.ext.graphviz could probably work better.
<td align=...> did not work when embedded into a Sphinx-generate page;
replaced with <td style="text-align:...">.

Change-Id: Icbcccd36a9cc157a5a8efe1e9054d6a6741c83ca

9 years agoMake (most) HTML links to file formats work again
Teemu Murtola [Sat, 7 Feb 2015 18:37:13 +0000 (20:37 +0200)]
Make (most) HTML links to file formats work again

Now most generated program HTML pages again link to file formats where
the file format is mentioned in the help text.  With the current
replacement mechanism, it is tricky to get it to work exactly like it
used to before, so now all places that should become links are enclosed
in [REF]/[ref] pairs instead of silently turning any matching text into
a link.  This means that some text may no longer be converted into a
link where it should be, but on the other hand, log() in formulas is no
longer converted into a link to the log file format...

This patch only mechanically converted places where [TT].???[tt] was
mentioned into a link (there were no instances of [TT]???[tt]).  So any
place where a file format was mentioned without [TT]/[tt] is no longer a
link, but those can be fixed when noticed.

Change-Id: I119d6c0f69ed8c1ecfb12cf1f219a62148ab01e5

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