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
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.
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.
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
Maxim Koltsov [Fri, 26 Dec 2014 13:28:06 +0000 (16:28 +0300)]
Add support for SelecitonOption and couple more
Basic mapping for Selection class was added, along with SelectionOption
and support for it in PyOptionsHolder.
Remaining basic options were added: IntegerOption, StringOption,
BooleanOption.
Alexey Shvetsov [Mon, 22 Dec 2014 13:58:27 +0000 (16:58 +0300)]
Adjust gitattributes
Change-Id: Ib0b4e2003f271d867dcb8933f0f12fb2c5226a46
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
Maxim Koltsov [Mon, 22 Dec 2014 12:02:12 +0000 (15:02 +0300)]
Merge branch 'pygromacs' of git+ssh://biod.pnpi.spb.ru/alexxy/gromacs into pygromacs
Alexey Shvetsov [Mon, 22 Dec 2014 12:01:06 +0000 (15:01 +0300)]
Merge branch 'master' into pygromacs
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
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
Maxim Koltsov [Sun, 21 Dec 2014 21:05:00 +0000 (00:05 +0300)]
Reenable sip split for all modules except Analysis
SIP_CONCAT_PARTS must be set to 1 when compiling with numpy, which is
used only in TrajectoryAnalysis module. Other modules can be still be
split into several parts. %ModuleHeaderCode is used to get access to
PyOptionsHolder in the parts.
Maxim Koltsov [Sun, 21 Dec 2014 14:34:29 +0000 (17:34 +0300)]
Fix years in copyrights
Maxim Koltsov [Sun, 21 Dec 2014 14:20:45 +0000 (17:20 +0300)]
Add possibility to report python exceptions
Maxim Koltsov [Sun, 21 Dec 2014 13:50:44 +0000 (16:50 +0300)]
Add support for defining Options from python
Options are stored in a special object, 'PyOptionsHolder'. This has to
be done to workaround gromacs's storage mechanism. Access to values is
provided via [] operator of the holder.
Maxim Koltsov [Fri, 19 Dec 2014 13:46:59 +0000 (16:46 +0300)]
Change commandline runner implementation
- Get rid of TrajectoryAnalysisCommandLineRunner class mapping and map
'runAsMain' static function instead
- Change 'ModuleFactory' typedef to std::function to allow passing
functors as module factories
- Implement python interface to 'runAsMain' that creates the factory to
give appropriate C++ module object to the GROMACS command line runner
subsystem
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
Roland Schulz [Tue, 28 Oct 2014 21:49:08 +0000 (17:49 -0400)]
Fix CMP0054 cmake 3.1.0 warnings
Change-Id: I5d91289a543240fa6f493b7f7738522f3c268c07
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
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
Roland Schulz [Wed, 17 Dec 2014 09:06:07 +0000 (10:06 +0100)]
Merge "Merge branch 'release-5-0'"
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
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
Mark Abraham [Thu, 11 Dec 2014 16:31:25 +0000 (17:31 +0100)]
Move code to prepare for GPU interface rework
This is pure renaming, so hopefully rebases work better. Two of the
header files were being explicitly removed from the set installed, but
now that these headers are no longer in legacyheaders, this issue is
resolved.
Change-Id: I5bbc89c2e52e0d92704896c48eeed5d9c00fd61a
Mark Abraham [Mon, 15 Dec 2014 23:29:20 +0000 (00:29 +0100)]
Merge branch 'release-5-0'
Conflicts:
CMakeLists.txt
Only changes from version numbers and test hashes, not relevant
for master branch
Change-Id: Ia10e2b82a4ffc3ac408813081c15fe6a858a93f3
Roland Schulz [Mon, 15 Dec 2014 00:32:29 +0000 (19:32 -0500)]
Fix NVML detection on Windows
Change-Id: I681744dd21a8390cbe2b2ad23c1ad49f2633b241
Mark Abraham [Sat, 29 Nov 2014 21:53:23 +0000 (22:53 +0100)]
Removing iteration + constraints framework
Getting rid of iteration + constraints required by the use of MTTK +
constraints, in order to simplify the main loop.
Eliminated related variables and arguments that are now unused.
Left some otherwise useless brace pairs in do_md(), so that
uncrustify-friendly formatting was preserved, so we can more easily
review this for correctness. Left TODOs to remove those braces later.
Implemented mdrun check so that an old .tpr with MTTK + any form of
constraints cannot be run.
Refs #1137
Change-Id: I22816de7db4420a66341fa8bf35d967a71ad6568
Mark Abraham [Wed, 1 Oct 2014 12:31:12 +0000 (14:31 +0200)]
Version bumps after new release
Numbers bumped, -dev tag replaced.
Change-Id: I59bbe346656f1892e154f899bac361fcfeea65a1
Mark Abraham [Tue, 9 Dec 2014 10:42:34 +0000 (11:42 +0100)]
Version 5.0.4
Removed -dev tags from versions. Bumped regressiontest hash.
Change-Id: Idcb1c288b0119c17a9ad644179e96c4734a798f6
Mark Abraham [Sat, 29 Nov 2014 21:50:25 +0000 (22:50 +0100)]
Fix constraints checks in grompp
This adds F_CONSTRNC to the set of interactions that should trigger
checks on SHAKE and LINCS parameters, and permits the MTTK check to
test also for SETTLE for its warning. The latter will also be used to
prevent MTTK + any constraints in a subsequent patch.
Change-Id: I175a2f050623192ff35a4cf93605fcfdd909f41a
Mark Abraham [Mon, 15 Dec 2014 17:57:47 +0000 (18:57 +0100)]
Merge "Merge release-4-6 into release-5-0" into release-5-0
Teemu Murtola [Sun, 14 Dec 2014 15:10:54 +0000 (17:10 +0200)]
Use new XML format with cppcheck
The console output in Jenkins is full of warnings about the old format,
and apparently some issues are not reported in the old format.
Change-Id: I35a40444b39b697d765d65c14706ebe7d2dcf67d
Teemu Murtola [Sat, 29 Nov 2014 04:58:51 +0000 (06:58 +0200)]
C++ interface for surface area calculation
Convert nsc_dclm_pbc() to a C++ class that provides the same interface,
except that the number of surface dots is specified separately, not for
each calculation. The internal implementation is still mainly the same,
but the new interface makes it possible to get rid of the global
variables storing the unit sphere surface dots. This in turn is
requires for making the algorithm thread-safe.
Clean up the implementation a bit by making internal functions static
(they will later become members of the Impl class), and replacing some
error-handling-by-writing-to-stderr-using-global-variables with asserts
or silent proper behavior.
Add tests for all the different paths of the unit sphere surface dot
generation. These help ensure that the algorithm stays unmodified when
it gets refactored for thread safety.
Change-Id: Icf39eb4d105555b2eafdfd70b219a73c294900af
Roland Schulz [Wed, 26 Nov 2014 01:40:30 +0000 (20:40 -0500)]
Use bitmask for bonded
Also move bitmask to utility and f_thread_t to forcerec-threading.h.
This introduces a cycle because listed-forces now depends on
mdlib/forcerec-threading.h. There is not yet a module where
forcerec-threading.h can go.
Change-Id: Ic220be2880f7263aa0e50b13f07ed509eb86e1b3
David van der Spoel [Thu, 11 Dec 2014 19:54:05 +0000 (20:54 +0100)]
Four new quotes from around the world.
Change-Id: Ib2f597c1f0e55160365d9e074b02b7eacbb84298
Mark Abraham [Thu, 3 Oct 2013 19:05:00 +0000 (21:05 +0200)]
Remove heuristic group-scheme neighbour-list updates
-1 == nstlist used to trigger the use of an algorithm that did
neighbour searching only when particles had moved far enough that
there might be a need to update the list. This supported obtaining
better energy conservation with the group cut-off scheme. It has been
superseded by the Verlet cut-off scheme.
Part of #1292
Change-Id: I074790c1c5670e874b8b587a1d46e62e2edc8961
Mark Abraham [Fri, 23 May 2014 19:07:54 +0000 (21:07 +0200)]
Fix latent bug in OpenMP initialization
mdrun worked fine because it only tries to call
gmx_omp_nthreads_init() once, but anybody trying to run thread-MPI
mdrun (e.g.) as a library or in tests would see a hang, because the
master rank never gets to the barrier because of the premature return.
Extracted a function, so that the return works as intended, which will
help us reason better about this code. Used quick return statements
for control flow, rather than nested conditionals, but there's no
other change to the functionality.
mdrun with OpenMP can now be called more than once. As a side effect,
even without OpenMP, the subsequent calls to mdrun now issue the
over-subscription warning - and all OpenMP runs report the OpenMP
settings.
Change-Id: Ie7019565ef9a513cf4dfb530e90452d4ef48289e