Maxim Koltsov [Fri, 27 Feb 2015 11:09:53 +0000 (14:09 +0300)]
Fix writeHelp() to support functors
This fixes a bug when running with '-h' option results in a segmentation
fault.
Alexey Shvetsov [Thu, 26 Feb 2015 12:26:08 +0000 (15:26 +0300)]
Merge branch 'master' into pygromacs
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
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
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
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
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
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
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
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
Erik Lindahl [Fri, 20 Feb 2015 21:30:32 +0000 (22:30 +0100)]
Famous quote from Colleen McCullough
Change-Id: I951d01208d15deccdeed48d044bebd07dde87a07
Erik Lindahl [Fri, 20 Feb 2015 20:47:57 +0000 (21:47 +0100)]
Added two pop-culture quotes from Andy Warhol.
Change-Id: I94a165f913de821438310e21858d92fa0d2806e2
Maxim Koltsov [Fri, 20 Feb 2015 10:20:40 +0000 (13:20 +0300)]
Fix cppcheck warning about initialization in cmdlinerunner.cpp
Maxim Koltsov [Thu, 19 Feb 2015 13:09:26 +0000 (16:09 +0300)]
Merge branch 'pygromacs' of git+ssh://biod.pnpi.spb.ru/alexxy/gromacs into pygromacs
Maxim Koltsov [Thu, 19 Feb 2015 13:09:21 +0000 (16:09 +0300)]
Add virtual destructor to ModuleFactoryFunctor
This suppresses GCC warning about abstract class having non-virtual
destructor
Alexey Shvetsov [Thu, 19 Feb 2015 12:12:31 +0000 (15:12 +0300)]
Merge branch 'master' into pygromacs
Maxim Koltsov [Thu, 19 Feb 2015 10:31:33 +0000 (13:31 +0300)]
Clean code of C++11 features
In order to maintain compatibility with older compilers, code was
cleaned of C++11 features, mainly usage of 'std::function' in
CommandLineRunner, replacing it with functor.
Usage of 'auto', range-based for and extended initilization was removed
too.
Mark Abraham [Sun, 15 Feb 2015 18:24:50 +0000 (19:24 +0100)]
Reenable SIMD for R-B dihedrals
Fixes #1686
Change-Id: If612a5afde4bcfd55319d2b6e38b521aa43a9973
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
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
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
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
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
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
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
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
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
Roland Schulz [Thu, 12 Feb 2015 18:38:31 +0000 (13:38 -0500)]
Merge release-5-0 into master
Change-Id: I23579c289b8a057a94cf64b142759934b9402ee5
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
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
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
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
Roland Schulz [Thu, 5 Feb 2015 06:28:51 +0000 (01:28 -0500)]
Work-around for ICC 15 on Phi
Change-Id: Id72e6fb124974f0d8572a1715bc1f25e536f7c69
Alexey Shvetsov [Mon, 9 Feb 2015 10:59:04 +0000 (13:59 +0300)]
Merge branch 'master' into pygromacs
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
Maxim Koltsov [Sat, 7 Feb 2015 17:09:12 +0000 (20:09 +0300)]
Basic support for multi-valued options
PyOptionsHolder was extended to be able to store fixed or arbitary
amounts of values for each option.
Unfortunately, setting default value does not work yet. allowMultiple()
does not work either.
Maxim Koltsov [Sat, 7 Feb 2015 10:40:21 +0000 (13:40 +0300)]
Add a desctructor for PyOptionsHolder
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
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
Alexey Shvetsov [Wed, 4 Feb 2015 18:29:48 +0000 (21:29 +0300)]
Merge branch 'master' into pygromacs
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
Maxim Koltsov [Wed, 4 Feb 2015 13:30:20 +0000 (16:30 +0300)]
Add FileNameOption with all related support
Maxim Koltsov [Wed, 4 Feb 2015 10:27:25 +0000 (13:27 +0300)]
String improvements
Make all string unicode. Map 'atomname' and similar members of struct
t_atoms.
Remove empty %SetCode blocks and add explicit /NoSetter/ annotation
everywhere.
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
Maxim Koltsov [Wed, 4 Feb 2015 09:49:35 +0000 (12:49 +0300)]
Return string instead of bytes for topology name
Maxim Koltsov [Tue, 3 Feb 2015 15:21:30 +0000 (18:21 +0300)]
Set %DefaultEncoding, now python code can use str
Remove usage of std::string, use const char* instead, to use SIP's own
handling of encodings.
Alexey Shvetsov [Tue, 3 Feb 2015 13:21:53 +0000 (16:21 +0300)]
Merge branch 'master' into pygromacs
Alexey Shvetsov [Tue, 3 Feb 2015 13:21:07 +0000 (16:21 +0300)]
NPY_INT should be used instead of NPY_LONG
Change-Id: I0b156160bd664a51a438f74635a262322b09b629
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
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
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
Roland Schulz [Mon, 26 Jan 2015 08:29:13 +0000 (03:29 -0500)]
Fix FP exception in FE
Part of #1677
Change-Id: I212d52a232763e3f3b3652ea488ba5e05683aab1
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
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
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
Alexey Shvetsov [Tue, 27 Jan 2015 10:34:04 +0000 (13:34 +0300)]
Merge branch 'master' into pygromacs
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
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
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
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
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
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
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
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
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
Berk Hess [Wed, 21 Jan 2015 11:33:40 +0000 (12:33 +0100)]
Corrected RDTSCP warning text
Change-Id: If66e2d3535df8bb96be29e628546ebb8706afd57
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
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
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
Erik Lindahl [Tue, 13 Jan 2015 14:02:02 +0000 (15:02 +0100)]
Added two quotes from Julie Bernauer habilitation
Change-Id: Ic2cc616346326b992a9b8bc16e25b5b7df53719c
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
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
Teemu Murtola [Sat, 17 Jan 2015 17:34:03 +0000 (18:34 +0100)]
Merge "Merge branch release-5-0"
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
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
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
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
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
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
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
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
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
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
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
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
Alexey Shvetsov [Thu, 8 Jan 2015 10:50:58 +0000 (13:50 +0300)]
Merge branch 'master' into pygromacs
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
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
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
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
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
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
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
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
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
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
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
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
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
Maxim Koltsov [Fri, 26 Dec 2014 16:39:03 +0000 (19:39 +0300)]
Implement members of Selection
Map various parts of Selection and SelectionPosition to NumPy arrays.
Maxim Koltsov [Fri, 26 Dec 2014 13:28:12 +0000 (16:28 +0300)]
Merge branch 'pygromacs' of git+ssh://biod.pnpi.spb.ru/alexxy/gromacs into pygromacs