Berk Hess [Mon, 1 Dec 2014 21:40:40 +0000 (22:40 +0100)]
Make domdec a proper module
Now has
* Doxygen group definition
* initial Doxygen comments
* correct #include guards
* no export "C" for header used only in C++ code
* all relevant current files are declared as such in the module
* new domdec_constraints.h and domdec_internal.h
* split off domdec_specatomcomm.cpp and domdec_vsite.c from
domdec_constraints.cpp
Change-Id: I7ed79c1654850df31e242aa1e907afd124e3ae1b
Teemu Murtola [Sun, 2 Nov 2014 13:45:21 +0000 (15:45 +0200)]
Improve selection parsing error reporting
Now the selection parser tracks the part of selection text that
contributes to the current parsing context, and uses that for more
useful error messages. At least in some cases, there is now also
context information for syntax errors, although this could likely be
improved further.
Exception handling during selection parsing is also improved:
- The above context is now added to the exception, similar to what the
old reporting mechanism does.
- The full selection is added to the exception as context, also for
non-interactive parsing.
- More consistent exception handling, e.g., in cases where an exception
is thrown during error handling.
Improve documentation for related functions.
Part of #655.
Change-Id: Ib276ce4e219692c9819e45a1637e3660d958803f
Teemu Murtola [Tue, 26 Aug 2014 04:19:40 +0000 (07:19 +0300)]
Non-periodic nbsearch with grid based on bounding box
For cases where there is no full PBC, the analysis neighborhood search
routines now allow constructing the grid based on the bounding box of
the reference positions. This frees the caller from the need to provide
a reasonably sized box even without PBC to benefit from the grid
searching.
Change-Id: Ia14b7c584a6ca84a5f698c12dc1491dde78bfe6d
Teemu Murtola [Sun, 23 Nov 2014 11:27:30 +0000 (13:27 +0200)]
Move/add uncrustify documentation to dev manual
Add some basic description of code indentation/formatting guidelines,
and move documentation of uncrustify and related scripts to the
developer manual. Improve the documentation at the same time, and make
all script reference the developer manual for additional documentation.
Make uncrustify.sh work without explicitly setting the UNCRUSTIFY
environment variable if the pre-commit hook is already configured.
Change-Id: I81ae71fbcdae0e177cc7b05fe278f8c20a19fe7a
Teemu Murtola [Tue, 23 Sep 2014 14:24:36 +0000 (17:24 +0300)]
Add 'gmx pairdist' tool as partial g_mindist replacement
Add a new tool that can compute pairwise distances from one reference
selections to one or more calculation selections. The tool can do
minimum or maximum distance over the whole selection, as well as between
each residue/molecule pair in the selections. This should provide
(nearly) all the distance outputs that g_mindist has, and with a bit of
effort also be able to replace g_mdmat.
The tool intentionally does not compute contact counts; those should be
added into a separate tool to keep things simpler.
Update some documentation references.
Change-Id: I553c3477ae808a133a3cec2b46feaccc3420022f
Teemu Murtola [Sun, 24 Aug 2014 04:16:41 +0000 (07:16 +0300)]
Analysis grid nbsearch for more cases
Add support for grid neighborhood searching also for epbcXY and
epbcNONE, as well as the XY mode in the analysis neighborhood search.
The grid is done based on the input box size also for the non-periodic
dimensions, or a single grid cell is used if the box size is unknown in
that dimension. In the future, an option could be added to determine
the grid automatically from the bounding box, but that is outside the
scope of this change. For the XY mode, a single grid cell is always
used in Z.
Improved the logic of determining when grid search is possible and/or
reasonable and implemented the option to force the grid
searching (since the test data currently would not trigger it
otherwise).
Change-Id: I0c43bf95d7d5dd46e57923cdf0d6864fbb3dfe59
Teemu Murtola [Wed, 29 Oct 2014 18:44:07 +0000 (20:44 +0200)]
Basic support for 'z of ...' selections
Add basic support for selections of type 'z of ...', where "z" can in
principle be any keyword and "..." any expression. However, currently
the only syntax that is actually supported is '[xyz] of co[gm] of ...',
because
1) this is the original case that was discussed in gmx-users some time
ago,
2) only the x, y, and z keywords satisfy the constraints that the
simplest possible implementation requires,
3) there is no context that would accept multiple values as produced by
an expression like 'z of resnr 1 to 3', and
4) there is no mechanism to detect that 'z of atomnr 1' actually
evaluates to a single value.
Some of these limitations can be lifted in the future with reasonable
effort, though.
Change-Id: I6b87ce8d5c93e1ad05722dd59a66375b52b8e363
Szilárd Páll [Sat, 8 Nov 2014 02:05:31 +0000 (03:05 +0100)]
Add kernel and compiler suport for CC 3.7 devices
On compute capability 3.7 NVIDIA GPUs we can make use of the increased
register size by running 128 threads/block with keeping the minimum
number of blocks per multiprocessor at 16.
Change-Id: I84ec179a409668fe44fb9183cf3485c21bd53254
Teemu Murtola [Sat, 1 Nov 2014 10:57:00 +0000 (12:57 +0200)]
Clarify memory management for selection values
Add asserts for cases where memory would be leaked when assigning the
storage pointer for gmx_ana_selvalue_t. Add functions for cases where
the assignment is combined with some other operation that takes care of
the memory deallocation or ownership transfer to make the asserts not
give false positives.
The above clarifies the memory management and makes it less prone to
errors, but does not fix the memory leak that was revealed by "z of ..."
implementation. To actually fix that, additionally split the logic for
freeing memory for gmx_ana_selparam_t, and call that also from the place
that earlier set the value pointer to NULL.
Move Doxygen documentation for some of the affected methods and their
neighbors to the header per newer guideline.
Add some extra debug output.
Change-Id: I4e5dfa1248a20cab8a242be7209b5b0779204e64
Teemu Murtola [Tue, 2 Sep 2014 17:20:21 +0000 (20:20 +0300)]
Helper function for grouping selection positions
Add a helper function that can be used to divide selection positions
into groups based on residues and/or molecules.
Currently, 'gmx sasa' uses a construct like this, and 'gmx rdf -surf'
will require it as well, as will a replacement for 'gmx mindist', so it
makes sense to have a common helper function. The helper function can
then do extensive checking on the input just in one place, and it keeps
the tool code more readable by removing some complicated loops from
there. Also, a single set of tests is necessary to cover all the paths,
and the tool tests can focus on the tool-specific functionality, without
needing to test also the different groupings.
Improve related documentation.
Change-Id: Iaa6904c4b4b7ff5b824f37d264c327bdf52da273
David van der Spoel [Fri, 28 Nov 2014 06:40:42 +0000 (08:40 +0200)]
Fixes recently introduced bug in gmx analyze.
Since the introduction of a separate module for autocorrelation
and related algorithms the program gmx analyze did not work anymore
due to a typo introduced, such that the acf related command line
arguments were not properly added to the others.
Change-Id: If79adc761de397e42c387d1aa6bd53d565b02820
Mark Abraham [Thu, 4 Sep 2014 21:39:15 +0000 (23:39 +0200)]
Convert remaining callers of do_force to C++
Major callers are converted in other patches.
Removed unused variables, used std::min/max, named constants, put
maximum length on sscanf floats.
Introduced an instance of bMaster. Initialized gstat to and later
checked for NULL before use. These help static analysis reason
correctly. Previous code functioned correctly in practice, but correct
analysis would require cross-function analysis that cr, when passed as
non-const, is not actually modified. Fixed a warning about stepsize
not being used in L-BFGS, and added more comments to this algorithm
while editing the code to help us understand what it does.
The predict_shells() function has been modified to use the
gmx_mtop_atomnr_to_atom() call for case 2; the previous version would
use an uninitialized pointer.
Fixes #1593.
Change-Id: I54f238cedc78aadb0dad080ea3b28f001dce8d94
Teemu Murtola [Fri, 10 Oct 2014 04:06:47 +0000 (07:06 +0300)]
Clean up gmx solvate
- Remove unused code.
- Remove help text that did not have corresponding implementation.
- Remove paths in addconf.c that were no longer triggered now that
gmx insert-molecules doesn't use it (will remove the whole file next,
though, so careful review may not be warranted).
- Fix most memory leaks outside add_conf (add_conf still leaks several
MB during the unit tests...).
- Consolidated memory management and reduced the scope of some
variables.
Change-Id: Ibf570247a7e91bc028401165000142b03baebe4d
Teemu Murtola [Thu, 9 Oct 2014 18:59:57 +0000 (21:59 +0300)]
Port gmx-solvate tests to use CommandLineTestBase
This makes the tests relatively easily extendable to support checking
the output.
Change-Id: Icf835aa143d3832a340d156327c0aee6c80ef4ea
Mark Abraham [Thu, 27 Nov 2014 16:55:56 +0000 (17:55 +0100)]
Merge "Merge release-5-0 into master"
Teemu Murtola [Fri, 10 Oct 2014 04:03:54 +0000 (07:03 +0300)]
More control over file backups
Add a gmx_set_max_backup_count() to specify how many backups should be
made, instead of just relying on the environment variable. Make the
default to be no backups: now tests and FAHCORE do not need special
treatment. Instead, make the command-line initialization specify the
maximum backup count, and add a command-line option that also allows
disabling backups as an alternative to the environment variable.
This also allows removing a valgrind suppression for memory leaks from
the test code.
Change-Id: Ib512eb2a491691c76404aacbf93b67087a1afe41
Teemu Murtola [Tue, 30 Sep 2014 03:55:37 +0000 (06:55 +0300)]
Further insert-molecules cleanup
- Run insert-molecules tests under valgrind, and fix (most) memory
leaks.
- Clarify memory management by moving memory allocation of some arrays
into functions where they are actually used.
- More sensible status output.
- Additional tests.
Change-Id: I7bc2f7b4b155ac650235da00b414561b963d347c
Christoph Junghans [Wed, 26 Nov 2014 22:18:01 +0000 (15:18 -0700)]
Merge release-5-0 into master
Change-Id: If41f9c458e5d3aa5f841afcd71bc7f72a1f312c7
Roland Schulz [Wed, 26 Nov 2014 21:19:18 +0000 (16:19 -0500)]
Fix clang with boost 1.46.1 and 1.47
Change-Id: I53b9fcb1bcf553ea128f7edb2d15bec87fd4f9e9
Teemu Murtola [Mon, 17 Nov 2014 19:07:19 +0000 (21:07 +0200)]
Convert surface area calculation to C++
Minimal conversion to make min/max work, and remove a few unused
variables. This enables writing a C++ wrapper over the functionality,
as well as using the analysis neighborhood search internally to fix
several issues with the original algorithm.
Change-Id: If5089a749c8db9630e33edab3d2b79968a28a921
Teemu Murtola [Fri, 28 Feb 2014 04:37:13 +0000 (06:37 +0200)]
Add some unit tests for surface area calculation
There are a few real unit tests that compare the results against
analytical calculation for trivial cases, but the rest of the tests are
more of regression tests, designed to catch changes in the output.
I have not actually checked that the reference values for the more
complex values are correct.
Put the tests in surfacearea.cpp instead of nsc.cpp and renamed the
implementation to match in preparation for future cleanup.
The volume computation with PBC is not tested, since it is broken.
Change-Id: I18e3baa899b1c10fec0c8b43d8dd76a357297005
Mark Abraham [Sat, 14 Jun 2014 01:07:43 +0000 (21:07 -0400)]
Fix trjconv modifying fr.time unnecessarily
The was a bug where trjconv modified the input frame time, which
caused issues with xtc seeking. This has recently been fixed
by commit
81d10b25, but it's better not to mess with the input
frame and only modify the output frame.
Refs #1405, #1406
Change-Id: Ibf7c8655e916c12f8cc51523a67556cc7988e6e6
Roland Schulz [Wed, 26 Nov 2014 01:10:03 +0000 (20:10 -0500)]
Merge release-5-0 into master
Conflicts:
src/gromacs/mdlib/domdec.cpp (std::max)
Change-Id: Iaa77c561f52cf5815c35cb08008cf578d1be2314
Mark Abraham [Tue, 18 Nov 2014 19:46:26 +0000 (20:46 +0100)]
Move code to domdec module folder
It's not a module yet, but here's where it will be. Updated
suppressions for module cyclic dependency warnings for domdec and
mdlib.
Change-Id: Ibe449ec8078fb7f25c4e95ebae28bac74db4f577
Berk Hess [Mon, 24 Nov 2014 14:36:13 +0000 (15:36 +0100)]
Fixed twin-range + freeze + constraints
With twin-range cut-offs, atoms which are both frozen and constrained
would experience very large or NaN forces, leading to constraint
warnings and errors.
Fixes #1639.
Change-Id: I1871a87054fec1149c9ed75872451df79a8ac2d2
Berk Hess [Thu, 16 Oct 2014 12:03:49 +0000 (14:03 +0200)]
Avoid NaN in rlist buffer calculation
With constraints on large masses and very low tolerance, the Verlet
buffer calculation could produce 1/0. This could lead to a somewhat
too smaller buffer.
Also added a missing scaling factor to the contribution of the third
derivative of the potential. This issue only caused a minor
overestimate for systems with constraints and without electrostatics.
Change-Id: I97e9d428a83f1b4954012ebd39bc49d397574f8c
Magnus Lundborg [Fri, 24 Oct 2014 08:24:22 +0000 (10:24 +0200)]
When writing TNG the input must contain molecule data.
When using trjcat to write TNG the input must also be TNG since
no tpr file is used.
Fixes #1626
Change-Id: I060e0174f9a471e134a4a899f83afaf02f4fce00
Teemu Murtola [Fri, 21 Nov 2014 18:26:42 +0000 (20:26 +0200)]
Rename doc-* targets to be less generic
Now that there are a lot of other documentation targets as well, rename
the targets that generate Doxygen documentation to doxygen-*.
Also, rename the doc-check target to source-check, since it has evolved
to more than just a Doxygen documentation checker.
There is some backwards-compatibility glue for Jenkins that expects to
execute the doc-check target with the old name, but otherwise this
change should only be visible to those few developers that may generate
the Doxygen documentation themselves or run the check-source target.
Change-Id: If69b4becc2bdc17899fa17ffd12ea1516133457b
Roland Schulz [Fri, 10 Oct 2014 07:10:15 +0000 (03:10 -0400)]
Set GMX_SIMD to MIC for Xeon Phi
The reason GMX_SIMD wasn't set the same wasy as it is for other architectures,
was that we wanted it to also work for offload. But for offload it is easy to
overwrite it for a compilation unit being offloaded. Setting it normally for
native mode makes it more consistent and lets the user disable SIMD.
Change-Id: Id660a6560278039673ce0a4feaea3261647f40e8
Christoph Junghans [Tue, 9 Sep 2014 17:57:40 +0000 (11:57 -0600)]
Added .travis.yml
* make use of travis-ci.org once a commit is pushed to github
Change-Id: I96673fb392a49d842ae6d959ce844e727def0d26
Teemu Murtola [Tue, 16 Sep 2014 04:13:06 +0000 (07:13 +0300)]
Describe doc-check in developer manual
Move existing documentation for the doc-check target into the developer
manual, and extend it to cover also the include sorter. Add a separate
page that explains the include order enforced by the checker.
Various updates to make the description match better the current state
of affairs, with the module dependency graph embedded into the Doxygen
documentation.
Change-Id: I570e4f6af78453cffea89855f294a599f28dedd9
Teemu Murtola [Mon, 15 Sep 2014 18:49:54 +0000 (21:49 +0300)]
Skeleton for a developer manual
Add a skeleton for a developer manual, mostly focusing on the used tools
for now. Some existing content from Doxygen is linked from the new
pages, but subsequent changes will add more content (with initial focus
on explaining the formatting and documentation checking that Jenkins
does) and reformat the existing content to better fit in the new guide.
Additional sections can be added when a need is identified.
Change-Id: Id28daa9effe93fb66d03ef7b696b14ff2554e602
Szilárd Páll [Fri, 24 Oct 2014 00:37:34 +0000 (02:37 +0200)]
Allow increasing CUDA thread block size
This change parametrizes the CUDA kernel to allow increasing the number
of threads per block by processing multiple j-clusters concurrently on
additional pairs of warps. The change supports 1-, 2-, and 4-way
concurrent j-cluster processing resulting in 64, 128, and 256 threads
per block, respectively.
Due to register limitations, on current CUDA architectures the version
with 64 threads/block (equivalent with the original kernels) is fastest.
The latter configurations using 128 and 256 threads are 3-4% and 10-13%
slower on CC 3.5/5.2, respectively.
Change-Id: I7c12a826f9347f724827320184628d6b310c1424
Szilárd Páll [Sat, 8 Nov 2014 03:47:03 +0000 (04:47 +0100)]
Add CUDA compiler support for CC 5.0
With CUDA 6.5 and later compute capability 5.0 devices are supported, so
we generate cubin and PTX for these too and remove PTX 3.5.
This change also removes explicit optimization for CC 2.1 where
sm_20 binary code runs equally fast as sm_21.
Change-Id: I5a277c235b873afb2d1b2b12b5db64b370f1bade
Teemu Murtola [Fri, 31 Oct 2014 18:34:04 +0000 (20:34 +0200)]
Refactor position-evaluated selection keyword handling
Now the keywords themselves only return one value per position, not one
value per atom. The expansion to atoms is instead done by the caller in
evaluate.cpp. This makes it easier to reuse the methods for
implementing syntax like "z of ...", where the expansion is not
appropriate.
Also, add an additional unit test for code around this path.
Change-Id: Ida74244fe1c76eaf89c3d2e1ca9b6f6784b0476d
Szilárd Páll [Thu, 23 Oct 2014 23:49:46 +0000 (01:49 +0200)]
Start nvprof profiling at counter reset
When running in the NVIDIA profiler, to eliminate initial kernel
performance fluctuations, load balancing effects, as well as
initialization API calls from the traces, we now start the NVIDIA
profiler through the CUDA runtime API at the performance counter
resetting. This has an effect only if mdrun is started in nvprof with
profiling off.
Change-Id: Idfb3c86a96cb8b55cd874f641f4922b5517de6e3
Roland Schulz [Sat, 8 Nov 2014 16:16:08 +0000 (11:16 -0500)]
Use stat to check that paths are equivalent
Replaces the previous approach of comparing path as string.
The previous approach didn't work reliable on case insenstive filesystems
or with symlinks.
Change-Id: Iee11c172db89b98a26b3592be2f285110a85a632
Berk Hess [Fri, 31 Oct 2014 18:10:13 +0000 (19:10 +0100)]
Corrected parameter for sorting on search grid
The nbnxn grid search sorting range parameter used the whole box
height instead of the local DD cell height with domain decomposition
along z. This could not cause errors, but the search used O(N^2) time
with more than 4 domains along z, instead of O(N).
Change-Id: I324df6b15635a5ecff7c8bfeb124fdb933e5f845
Berk Hess [Fri, 17 Oct 2014 13:33:46 +0000 (15:33 +0200)]
Fix DD bonded interaction range print
A recent fix caused the DD setup printing of the maximum bonded
distance to instead print the max of the bonded and the list buffer
to the log file. This was a printing issue only.
Refs #1607.
Change-Id: I685e2e5e07f2f1a0a39c5eef4264a77ddfcecb31
Roland Schulz [Mon, 25 Nov 2013 21:06:26 +0000 (16:06 -0500)]
Add bitmask type
Adds support for arbirtrary number of OpenMP threads
Fixes #1386
Change-Id: I3747b4c7cd4b45d5901f710fcab47984c8913bc6
Carsten Kutzner [Wed, 5 Nov 2014 14:53:34 +0000 (15:53 +0100)]
Updated some .mdp file variables to use "-" instead of deprecated "_"
In the .mdp file, now a minus sign instead of an underline is
generally used. Some sections of the manual still listed .mdp
variable names in the old notation.
- three manual sections (pulling, enforced rotation and computational
electrophysiology) now use "-" instead of "_" in .mdp file variable
names
- updated output of rotation code to reflect this up-to-date notation
- no functional changes are in this patch
Change-Id: I7b00193d3e3d549ce8c9a728b307280c0bdd35ce
Justin Lemkul [Wed, 29 Oct 2014 13:10:36 +0000 (09:10 -0400)]
Removed spurious GLY dihedral in AMBER03.
Fixes #1632
Change-Id: I7302e42558454d546e14d7784077fb72c0dbfad7
Viveca Lindahl [Fri, 31 Oct 2014 17:09:10 +0000 (18:09 +0100)]
Fixed typo in cmake warning.
Change-Id: Id096ed65567fa671dce40970948b6435d9c357a0
Roland Schulz [Sun, 9 Nov 2014 07:42:58 +0000 (02:42 -0500)]
Backport valgrind suppression
Was added to master by
106ca9e6 and is now also required by
Jenkins for 5.0. Unclear what triggered that it is required.
Change-Id: I272600716fc986fe77a03fb86da827ba40d17adf
Roland Schulz [Tue, 28 Oct 2014 21:49:08 +0000 (17:49 -0400)]
Fix CMP0054 cmake 3.1.0 warnings
Change-Id: I5d91289a543240fa6f493b7f7738522f3c268c07
Roland Schulz [Wed, 5 Nov 2014 00:01:29 +0000 (19:01 -0500)]
Minor update of boost README
Change-Id: Ib6017efd89225771cea4f56d9e18994c25b8361e
Teemu Murtola [Thu, 30 Oct 2014 18:45:52 +0000 (20:45 +0200)]
Add more selection unit tests
Add tests for syntax like
res_com x < 5
res_com distance from ... < 5
as these were not covered well with earlier tests. Subsequent changes
will refactor the code responsible for evaluating these to allow syntax
like "z of com of ...".
Change-Id: I63b60cc2958fcf919a82b809f60465b8444904d2
Teemu Murtola [Thu, 30 Oct 2014 18:41:14 +0000 (20:41 +0200)]
Fix more memory leaks in default group creation
Free temporary arrays and strings allocated during the processing.
Don't know why these were not spotted in my earlier valgrind run (all of
these fixes are from working with the interactive selection tester).
Remove one unused array that was allocated and freed, but never used.
Change-Id: Ib78b6366bb5230499a77717f36afed652a1ec7fd
Teemu Murtola [Wed, 29 Oct 2014 18:40:34 +0000 (20:40 +0200)]
Fix memory leak in default index group creation
Temporary memory should be deallocated in the scope where it is
allocated, not only within some conditional paths.
Change-Id: I102d2b82ba531c25dd26728729b46c0b99c124e4
Roland Schulz [Thu, 30 Oct 2014 18:19:22 +0000 (19:19 +0100)]
Merge "Merge release-5-0 into master"
Teemu Murtola [Wed, 29 Oct 2014 18:52:16 +0000 (20:52 +0200)]
Merge release-5-0 into master
Conflicts:
src/external/gmock-1.7.0/CMakeLists.txt
- took both changes on the same line
src/gromacs/gmxpreprocess/calc_verletbuf.c
- took both changes on the same line
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu
- discarded temporary common.h hack from release-5-0 in favor of
better solution in master
src/gromacs/selection/nbsearch.cpp
- resolved all conflicts in favor of master (were from a
back-ported change)
Change-Id: I34190b704bcb1c020dcc2a3586a25620fd3c3ccf
Teemu Murtola [Sat, 23 Aug 2014 03:27:24 +0000 (06:27 +0300)]
Improve analysis nbsearch grid mapping
Now the analysis neighborhood search implements its own version of
put_atoms_in_triclinic_unitcell(). While computing the index of the
correct grid cell, it is relatively easy to produce also the coordinates
that lay within that cell instead of using a separate call. This
provides two benefits:
- It avoids rare rounding problems if put_atoms_in_triclinic_unitcell()
would put the atom right at the edge of the box, but the mapping code
would consider it outside the box, causing out-of-range grid cell
index to be generated.
- It allows to customize the grid mapping more freely (e.g., to create
grids that are not periodic).
Backported from master with minor changes, fixes #1611. Kept commit
message the same; the second point will be only relevant for master.
Change-Id: Ib7602fa49a1b8f7882a63843322786b3e51e8e32
(cherry-picked from
b3e2e82 in master)
David van der Spoel [Tue, 28 Oct 2014 17:43:31 +0000 (18:43 +0100)]
Even more refreshing quotes.
From a variety of source.
Change-Id: If4f9ecc77c0941d460628443491d6b2ce4c6c1a0
Teemu Murtola [Tue, 28 Oct 2014 04:21:59 +0000 (06:21 +0200)]
Avoid common.h inclusion in CUDA code
This is solved nicer in master with I943f90f, but there is little value
in backporting that compared to the effort, since more or less all
changes from there would conflict. This may fix compilation problems
with some nvcc/boost combinations.
Change-Id: I82a26c60d366bfe5fdbcfd8a17bffdb1139ce017
Roland Schulz [Sun, 19 Oct 2014 17:37:22 +0000 (13:37 -0400)]
Add Windows support for host-/username
Change-Id: I971ffc811bddea8c8663d3d1ce95678eddfd5860
Teemu Murtola [Sun, 19 Oct 2014 09:36:02 +0000 (12:36 +0300)]
Move truncate() wrapper to futil.h
- Isolate platform-dependent file handling code better, removing
some platform-dependent #ifdefs and #includes from higher-level files.
- Make 'gmx trjconv -trunc' independent of the platform (should now also
work on Windows).
- Don't leak file handles when truncating on Windows.
Change-Id: I66162978c7b29499c8fc796d15b5f2649abf59dd
Teemu Murtola [Sun, 19 Oct 2014 06:55:37 +0000 (09:55 +0300)]
Encapsulate use of nice()
- Instead of platform-specific #ifdefs in otherwise platform-agnostic
code, encapsulate the call in sysinfo.h/.cpp.
- Make it fully CMake's responsibility to determine whether nice() is
going to be used. This could probably be simplified further (even to
the point of using HAVE_NICE directly), but since I'm not sure how all
the special cases work, left them as they were, but with TODO
comments.
- Remove some unused platform-specific #includes.
Change-Id: I9f1172ba2c02bb042574ad5d2b9ccbf5d31a3d6f
Teemu Murtola [Sun, 19 Oct 2014 04:24:36 +0000 (07:24 +0300)]
Collect more platform-specific code to sysinfo.h
Move a few existing functions of this type to sysinfo.* from
basenetwork.* and cstringutil.*. Mostly this is just code movement, but
there are two changes:
* getuid() usage is now controlled by HAVE_UNISTD_H instead of
HAVE_PWD_H, and excluded for MinGW (the latter is just a guess, but
many other similar calls are excluded for MinGW).
* Getting the current username uses getlogin_r() instead of getpwuid(),
following the implementation in tngio.cpp instead of the original
implementation in cstringutil.c. If this is OK, then we can get rid
of HAVE_PWD_H completely. Alternative would be to make the code use
getpwuid_r() if the old functionality is more desirable, but that is
a bit more effort, and requires some testing for platform support, as
that has not been used before in the code.
This allows removing platform-specific #ifdefs and #includes from
multiple files completely, making these aspects better encapsulated.
While checking the presence of #ifdefs, removed one useless #ifndef
GMX_FAHCORE from tngio.cpp; make_backup() already handles FAHCORE
internally.
Change-Id: I46876635fb254eb9558cce80b34ebe3078425375
Teemu Murtola [Sat, 18 Oct 2014 04:09:34 +0000 (07:09 +0300)]
Rename common.h to classhelpers.h
This reflects the remaining contents better. Since basedefinitions.h
was created, it is a more natural home for all truly common definitions,
so the old name no longer makes sense, either.
Change-Id: Ia2aa84e0b9696541f61490312aae9c18f719076f
Teemu Murtola [Sat, 18 Oct 2014 03:59:19 +0000 (06:59 +0300)]
Move basic macros from common.h to basedefinitions.h
Move GMX_UNUSED_VALUE and GMX_IGNORE_RETURN_VALUE from common.h to
basedefinitions.h to not force a boost dependency on code that uses only
these macros. In particular, CUDA code no longer includes common.h and
thus boost, which yet again works around broken boost/nvcc combinations.
basedefinitions.h is also a more natural place for these, as gmx_unused
is already declared there.
Fix one header that included others within an extern "C" block.
Change-Id: I943f90f068987456219ac7aad388258907018692
Roland Schulz [Sun, 19 Oct 2014 16:23:53 +0000 (12:23 -0400)]
Remove Catamount cmake
Was superseeded in 2006. No Cray XT3 should be around anymore.
Also gets rid of GMX_NO_SYSTEM which was only set by Catamount
Change-Id: Ib3c0450995e395ccdd2935b629da7930d9da5a4a
Roland Schulz [Sun, 19 Oct 2014 16:04:16 +0000 (12:04 -0400)]
Fix C++11 flags for MingW
Also replace all 'WIN32 AND NOT CYGWIN' with 'WIN32'. Since cmake
2.8.4 WIN32 doesn't include CYGWIN.
Change-Id: Ie93fa8a79daabcc3515e00cd1f95b76041417eb6
Roland Schulz [Fri, 17 Oct 2014 06:29:15 +0000 (02:29 -0400)]
Create scoped_cptr to replace scoped_ptr_sfree
Compareed to the previous scoped_ptr_sfree, scoped_cptr has a get
method, a bool-conversion, and allows to specify a custom deleter.
If just a guard is required then the scoped_guard_sfree typedef
can be used which doesn't require to specify a type.
Change-Id: I81cb50c4cf34e2d5a93e9c4b0043afcbc5feb535
Roland Schulz [Fri, 30 May 2014 05:02:23 +0000 (01:02 -0400)]
Used IWYU to partially clean up some includes
- Used trunk version
- Works well for C and simple C++ files
- Does not yet work without manual reverting some changes for more complicated
files e.g. options.cpp (see issues 105, 111, 135, and 138)
- IWYU doesn't check for conditional compiled code. I ran for
pme.c and wallcycle.c with -DDEBUG_PME/_WCYCLE
Given that one needs to fix a few issues and have to check for #ifdefs it is
still manual work, but I think quite a bit faster and more complete than doing
it manually.
Change-Id: I7c5569693a4b84f481f0f7afd85f0f01c33295cf
Berk Hess [Wed, 15 Oct 2014 11:24:14 +0000 (13:24 +0200)]
Removed f_novirsum reduction in Verlet scheme
There is a reduction over MPI ranks (dd_move_f) for fr->f_novirsum
for the exclusion correction of PME, which should not contribute
to the virial. But with the Verlet scheme this is unnecessary,
since the exclusions fully are handled in the non-bonded kernels.
Change-Id: I65b3dc90cf01de7b33e955074dfa32bd1940f781
Carsten Kutzner [Tue, 14 Oct 2014 08:56:14 +0000 (10:56 +0200)]
Fix order of ED/swap blocks during checkpoint reading.
For some reason the order of reading the swap state and the essential
dynamics (ED) state were mixed up in read_checkpoint(), which lead to
unreadable state files if both ED and swap functionality were used.
This fix changes the order of those blocks to be consistent with
write_checkpoint().
Change-Id: Ie234486b990861decef9e00fc5125f867001f814
Mark Abraham [Fri, 17 Oct 2014 15:50:12 +0000 (17:50 +0200)]
Extend gmock to turn off socket listener
On Linux, you'd generally expect this feature to work, but on Cray the
linker warns that the use of getaddrinfo() would require linking a
shared library at runtime. That never happens because we don't use the
socket listener feature, but we don't want people stressing over that
at build time.
Change-Id: I9c358a2923d7563809d471f2ea1767cf2e8bbe25
Mark Abraham [Thu, 2 Oct 2014 13:30:38 +0000 (15:30 +0200)]
Move code to what will become the ewald module
Moved PME implementation, PME load-balancing code and basic Ewald code
into new module. PME is the major component, but they share a little
bit of infrastructure and might one day pass the same tests (or test
each other) so there's some value to being together.
Moved legacyheaders/pme.h to module, split it into pme.h and
pme-internal.h, and moved the definition of splinevec into the only
source file that used it. pme-internal.h is intended as a temporary
measure - a place to put details that are internal to the module -
while developing some internal structure with more normal
module/file.{cpp,h} layout.
Moved legacyheaders/coulomb.h to the new module and named it
ewald/ewald-util.h, since it pretty much declares functions defined in
the former ewald-util.c (now ewald/ewald-util.c). Both files will
disappear in future clean up, though.
The internal structure of this module is still messy, but some
clean-up will follow. Then C++ conversion and Doxygen.
Renamed files to use '-' rather than '_', because I like using fewer
keystrokes.
Removed a useless extern on calc_ewaldcoeff_lj() declaration.
Introduced new cyclic dependency (and doc-check suppression) on mdlib,
because the PME-PP load-balancing needs to let mdlib/nbnxn_cuda know
about the changed parameters. It also uses some functions that are
currently declared in pme-internal.h, so there's no single-step
solution, even if nxn was already a module. In the long term, a PME
load-balancing module that talks to the ewald and nxn modules through
their library interfaces makes good sense, but we can't do that right
now.
Change-Id: I6ddd5579b6e52812d8fb110b4950a207b159ea4a
Mark Abraham [Sat, 20 Sep 2014 10:59:41 +0000 (12:59 +0200)]
Converted many integrator-loop files to C++
Moved code from mdlib/init.c to other locations, to avoid creating an
init.cpp file that was freaking out the ASAN build, perhaps via linker
filename clash with utility/init.cpp. Renamed gmxlib/mvdata.c to
mdlib/broadcaststructs.cpp since that makes sense now.
Converted min and max to std:: varieties, and provided explicit
template specifications where required. Used std::sqrt to help the
compiler do automatic template type deduction.
Used static_cast<int> to suppress warnings about comparison between
signed and unsigned integers, and conversion of double to int where
that is the intention of the code.
Converted a few variables between int, real and double to correctly
reflect the intention of the code.
Fixed use of double for number of steps completed, which should be
gmx_int64_t. Formally, this is a bug in release-5-0, but you'd have to
do 2^53 steps to notice it.
Used const real to define constants so that the std::pow overloads
on Windows can work smoothly.
Added some width specifiers on environment-variable scanf calls
to avoid problems.
Removed many unused variables.
Added inline cppcheck suppressions for writes to variables that are
only read when OpenMP is being used. A recent change introduced such
variables to work around compilers that have bugs if you call a
function inside the #pragma omp, but those variables are unused if the
compilation does not use OpenMP.
Added C++ guard to free-energy kernel header.
Change-Id: Id190e36758fa6aef68b14e5c9b78eacfb0a86949
David van der Spoel [Wed, 21 May 2014 14:38:25 +0000 (16:38 +0200)]
Reorganizing analysis of correlation functions.
Moved routines computing correlation functions and
fitting to those in a special subdirectory not
dependent on gmxana. The autocorrelation now functions
as it should (previously there were issues with long
time correlations).
Replaced Levenberg-Marquardt algorithm by another implementation
from http://apps.jcns.fz-juelich.de/doku/sc/lmfit,
under a FreeBSD license. This code is in src/external/lmfit.
Added Doxygen comments to all headers.
Fixed wordcount algorithm in xvgr.c
The routines many_auto_correl and many_cross_correl
are optimized using OpenMP.
Change-Id: Ifbe003437db36e35d606cd942bb38deeef86ea64
Teemu Murtola [Sun, 5 Oct 2014 18:56:07 +0000 (21:56 +0300)]
Check config.h usage in doc-check
Make the doc-check target check that config.h is included if and only if
it is needed by the source file. Add suppressions for locations where
this is currently not the case.
Change-Id: I6110e9887d4df3c4644f20003faa3120ea9048ea
Teemu Murtola [Sun, 28 Sep 2014 03:51:52 +0000 (06:51 +0300)]
Use analysis nbsearch in insert-molecules
Advantages:
- This reduces the amount of code by ~90% compared to what addconf.c
has, making it significantly easier to understand.
- Now the tool is independent of potential changes in the
mdrun-specific neighborhood search.
- Memory leaks related to addconf.c are gone.
- The neighborhood search is terminated as soon as one pair within the
cutoff is found, potentially making it faster. This likely offsets
any performance differences between the nbsearch implementations.
The unit tests are ~35% faster.
- Confusing mdrun-specific output related to the neighborhood
searching is gone. This includes notes that "This file uses the
deprecated 'group' cutoff_scheme" and references to Coulomb or VdW
tables and cutoffs.
Change-Id: Iba82858b9a2b43b6e10a49cd3964b99b22996166
Mark Abraham [Mon, 13 Oct 2014 10:02:59 +0000 (12:02 +0200)]
Merge release-4-6 into release-5-0
Change-Id: I08dc9d5e776480e7686a159cfcd981ba46c510ad
Roland Schulz [Thu, 9 Oct 2014 01:20:47 +0000 (21:20 -0400)]
Fix misidentification of dot in path name
Commit
df876d6c7b5 added support for custom default extensions
but it didn't work correctly for directory names containing dots.
Change-Id: I427f694a36496bd8a6f59e3083feb5b8269a62c4
Teemu Murtola [Sat, 27 Sep 2014 16:48:52 +0000 (19:48 +0300)]
Clean up gmx insert-molecules
- Remove unnecessary code.
- Clarify control flow and responsibilities of different functions.
The only functional changes should be that:
- Random numbers are now used in different order because of some
reorganization.
- The insertions happen at a slightly different place even with the
same random numbers (now the generated random number sets the center
of the inserted system instead of corner location).
- The insertion positions are equally likely everywhere in the box,
instead of a somewhat arbitrary rejection criterion that rejected
some positions at the edges.
- The -allpairs option is gone.
Child change will provide a proper fix for the latter by getting rid of
the mdrun-specific neighborhood searching and all the memory leaks that
the code in addconf.c brings.
Change-Id: Ia82ebb8ea8296dd468a9a56c33a3cb737a5ec9dd
Teemu Murtola [Mon, 29 Sep 2014 18:46:11 +0000 (21:46 +0300)]
Make 'gmx insert-molecules' tests test output
The tests now actually test the output for regression, and provide an
easy way to check the output files using the reference data framework.
Convert the tests to use CommandLineTestBase for a more uniform
approach. Add a title to the test system to avoid generating random
titles for the output.
Change-Id: I3b1e6242922bf24ab4c254e6e0a53531af84c9df
Teemu Murtola [Mon, 29 Sep 2014 05:10:28 +0000 (08:10 +0300)]
Generalize command-line unit testing machinery
Move machinery for unit testing a command-line program with input and
output files from trajectoryanalysis tests to testutils, and make it a
bit more general.
Existing code using IntegrationTestFixture could be also adapted to use
this (perhaps by making IntegrationTestFixture inherit from
CommandLineTestBase), but that is left for another change.
Change-Id: I3dd9f9667f727be30cf26a6b9d22dd6d44dfef9e
Mark Abraham [Sat, 20 Sep 2014 10:48:41 +0000 (12:48 +0200)]
Fixed minor issue with NPT conserved energy
The value of the number of degrees of freedom in a group is a real,
but it was being truncated to an integer before promoting it back to a
real. This is wrong, whether or not the number can reasonably be
non-integral. This only affected the conserved energy quantity,
not the kinetic or total energy used for coupling and output.
Change-Id: I5fcb6428dc0e333cabd79262cc2a9cffa5fec03a
Mark Abraham [Thu, 11 Sep 2014 10:01:14 +0000 (12:01 +0200)]
Clean up cshake() and resolve old issues
C++ conversion in Id190e36 exposed some "interesting" use of the
variable toler caused by an ancient bug that has since been resolved.
Investigation showed that variable never meant anything to do with a
tolerance!
Renamed a bunch of variables for clarity and consistency. Documented
the core function. Clarified code comments and manual sections
accordingly.
Added some unit tests while trying to understand what things were
actually going on.
Refs #1255
Change-Id: I5b5eee0b8f3f4761ce9cb681dbdb0d4526a6761d
Berk Hess [Fri, 3 Oct 2014 12:00:38 +0000 (14:00 +0200)]
Fixes issue with vsiten and Verlet buffers
Commit
0336ab2d only fixed part of the vsiten issue in the Verlet
buffer calculation code. Parameters were read from incorrect memory
locations, which could lead to a segmentation fault or incorrect
masses for vsiten particles. It unlikely that this affected results.
Part of #1579.
Change-Id: I76cdb94e34194d2f6d49d98a49486ce1df76d91a
Mark Abraham [Mon, 6 Oct 2014 17:48:43 +0000 (19:48 +0200)]
Fix trjconv -split not closing files
With long trajectories, the number of file handles will run out.
Change-Id: I9f6e20ddb836250431460ff6ed918ec74f2699ee
Roland Schulz [Sun, 21 Sep 2014 22:03:17 +0000 (18:03 -0400)]
Allow runAsMainSingleModule to be called more than once
Call finalizeForCommandLine even if an exception is thrown so that it is
OK to call runAsMainSingleModule again. This allows this (and the calling
runAsMain as e.g. used in the template) be called from some framework which
doesn't reset globals.
Change-Id: I9eff770e06feef90f99ec0445bd294816f8b6a0a
Mark Abraham [Wed, 27 Aug 2014 12:15:24 +0000 (14:15 +0200)]
Move pair-interaction code into listed-forces module
Did C++ conversion, added Doxygen, renamed functions to reflect that
they are now local to a source file, and put them into an anonymous
namespace.
Made glatnr() local to the listed-forces module.
Converted IS_LISTED_LJ_C to static function and made it local
to bonded module.
Removed temporary cycle-warning suppression.
Change-Id: If3a3045021fe7a3f1d67d14f2294551fc41b5422
Teemu Murtola [Fri, 19 Sep 2014 19:45:34 +0000 (22:45 +0300)]
More robust handling for installed headers
- Remove unnecessary first parameter from gmx_install_headers():
it is possible to deduce the installation destination from the
current CMake directory. This eliminates the possibility of typos in
this parameter that would break the installed headers.
- Make the gmx_install_headers() function also generate a global list of
installed headers, which is then used to generate a file with this
list, instead of globbing this information from the
cmake_install.cmake files. This ensures that obsolete files in the
build tree should not affect the outcome.
Change-Id: I4d27accaebc14438acc5d290b25258b561ca04ea
Mark Abraham [Tue, 23 Sep 2014 04:50:34 +0000 (06:50 +0200)]
Unite code for handling listed pairs
Some implementation details are closer to the other listed
interactions than the group-kernel non-bondeds. This functionality
will also survive the death of the group kernels, so may as well be
separated now.
This is pure code motion, to prepare for transition to the
listed-forces module.
Had to add an #include guard to a not-really-related file.
Some not-quite related clean-up in nonbonded.h
Added temporary cycle suppression until this moves into the
listed-forces module
Change-Id: Ie8865f5ca1a4512d75e70e4b7f25b90f6ed019ec
Mark Abraham [Wed, 1 Oct 2014 20:02:02 +0000 (22:02 +0200)]
Merge release-5-0 into master
Conflicts:
CMakeLists.txt
Version numbers not bumped; fixed to use the right
name for RelWithDebInfo.
cmake/gmxCFlags.cmake
Fixed to use the right name for RelWithDebInfo.
src/gromacs/listed-forces/bonded.cpp
New RB SIMD function in bonded.cpp had unused variables, now
eliminated
src/gromacs/mdlib/domdec.cpp
Bug fixes from release-5-0 incorporated. std::max now used in code
newly arrived from release-5-0.
md.cpp had no conflict, but fr->nbv->bUseGPU had to
be replaced by use_GPU(fr->nbv) to work in master branch.
Change-Id: I65326b691745111fbdaa9435be6c92fa1acf6e7d
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: I9aa220cc837b126ad694786178901db336d7121d
Mark Abraham [Wed, 1 Oct 2014 08:39:40 +0000 (10:39 +0200)]
Version 5.0.2
Removed -dev tags from versions. regressiontest repo has not changed
since 5.0.1, but somehow the hash differs from the one used then.
Change-Id: I0f632262e4dd11875479d4f6a0c932169a699eb9
Carsten Kutzner [Tue, 30 Sep 2014 09:40:52 +0000 (11:40 +0200)]
Allow gmx tune_pme to skip the check for command-line health
Therefore, this patch adds the "-check" command line option, which is
TRUE by default, but can be switched to FALSE in problematic cases.
Documented its main use case in the error message that it would
circumvent.
Also corrected a few typos.
Fixes part of #1609
Change-Id: Id1cadd620438c36c123ff075c9a98ea7d1534d4d
Erik Lindahl [Sat, 5 Jul 2014 21:00:20 +0000 (23:00 +0200)]
Add Power8 VSX SIMD support
This adds the low-level SIMD implementation
for IBM VMX, which is present on both
Power7 and Power8. It passes unit tests with
both gcc-4.9 and IBM xlc on Power7 (which is
always big endian), and with gcc 4.8 and 4.9
on Power8 running linux in little-endian mode.
It is not yet enabled automatically since we
still lack nbnxn kernels for this architecture.
Extended the Doxygen suppressions for gmx_cpuid() to the whole file,
since wildcards in suppressions.txt were not working, we we don't
understand what doxygen bug is responsible, and there's not actually
any Doxygen documentation in that file.
Change-Id: I06570992cd3a98c0debf5ff25100d68d55d0f8fb
Szilard Pall [Fri, 26 Sep 2014 09:53:35 +0000 (11:53 +0200)]
Fix incorrect LJ cut-off with GPU + PME tuning
Due to the mismatch of the macro used in generating and implementing the
twin cut-off CUDA kernels (used with PP-PME load balancing), the VdW
cut-off check was not generated and the (larger) electrostatics cut-off
was enforced instead, causing incorrect results with PME tuning.
Fixes #1603
Change-Id: I43ae19968b30843cfe407e927a5cf0bd35c62881
Berk Hess [Fri, 5 Sep 2014 08:29:04 +0000 (10:29 +0200)]
Avoid DLB with overloaded PME ranks
When separate PME ranks have more load than the PP ranks, DLB can
not improve improve performance. It will actually make it worse,
because the PME x/f redistribution time goes up. Now with -dlb=auto
DLB is not turned on in this situation.
Also DLB is not activated during PME tuning with GPUs and separate
PME nodes, since it then nearly always deteriorates the performance.
Change-Id: I1f5e649a9562fdca9ba538196f41a12feb0a4a24
Berk Hess [Thu, 11 Sep 2014 13:02:14 +0000 (15:02 +0200)]
Added GPU local wait to load balancing
The GPU local wait time was not included in the load imbalance timing.
This could lead to incorrect load imbalance reporting and dynamic
load balancing, especially with CUDA stream priorities.
Note that we can't accurately measure the GPU time, when it finishes
during dd_move_f.
Change-Id: If4bb0f867593450cc025c8593672b0569397b1d6
Erik Lindahl [Tue, 12 Aug 2014 12:15:30 +0000 (14:15 +0200)]
Avoid using function calls in OpenMP directives
The direct calls to gmx_omp_nthreads_get() that were
included in some OpenMP pragmas caused memory
corruption and later segfaults on PGI compilers. This
is likely a compiler bug, but we can work around it
by assigning the function return value to a variable
that we use in the pragma.
Such variables are unused when OpenMP is not in use, which might
offend some compiler some time, so adding a gmx_unused attribute is
useful. However, uncrustify needs to be taught about our custom
attributes, which is also done here.
Change-Id: I3b482bdc2401b40a043975ffd4a741f65efd0cfc
Berk Hess [Mon, 29 Sep 2014 09:39:43 +0000 (11:39 +0200)]
Domain decomposition now checks the rlist buffer
When a large pair-list buffer, which will appear with large nstlist,
atoms are allowed to displace the buffer size, i.e. a lot, in nstlist
steps. The limit this puts on the DD cell size is now checked.
Also updated cg_move_error, which now no longer prints the old atom
coordinates with the Verlet scheme, where the "old" coordinates are
actually the new ones.
Fixes #1607.
Change-Id: I784afa5ee620b51f555f4d1107f38cbbae2c55d1
Roland Schulz [Sat, 20 Sep 2014 16:30:33 +0000 (12:30 -0400)]
Clarify GCC+Win+AVX warning
Message was accidentally not printed for Cygwin.
Message was printed even for GCC version which are OK.
Change-Id: I4560908317919bc36f33f6e430e6b7a34853ae73
Berk Hess [Thu, 25 Sep 2014 18:35:55 +0000 (20:35 +0200)]
SIMD acceleration for RB dihedrals
RB dihedrals now use SIMD acceleration analogous to proper dihedrals
when no energy and virial is required. This also significantly
improves load balancing (issues) for systems with proper+RB dihedrals.
Refs #1598.
Change-Id: I07000125d19db45fc35e1a0c28149c8a19443680
Mark Abraham [Mon, 29 Sep 2014 15:31:09 +0000 (17:31 +0200)]
Merge "Merge release-4-6 into release-5-0" into release-5-0
Berk Hess [Fri, 26 Sep 2014 18:47:47 +0000 (20:47 +0200)]
Avoid PME tuning decreasing rcoulomb
With mdrun input with the grid much finer than fourier-spacing,
PME tuning could reduce rcoulomb below the starting value.
Fixes #1606.
Change-Id: I3ae7fe38a4240251aadb96336199b306fc7dce40
Roland Schulz [Mon, 29 Sep 2014 14:47:53 +0000 (10:47 -0400)]
Merge release-4-6 into release-5-0
Change-Id: Ie72eccf57febab7b7ac8092ce55988b9cb2737af