alexxy/gromacs.git
11 years agoMerge "[tools] g_sans - add trajectory avereging"
David van der Spoel [Fri, 12 Oct 2012 19:01:54 +0000 (21:01 +0200)]
Merge "[tools] g_sans - add trajectory avereging"

11 years agoFix compiler warnings
Roland Schulz [Sat, 6 Oct 2012 22:38:06 +0000 (18:38 -0400)]
Fix compiler warnings

Not a bug: Initialization is unnecessary because either switch is
always either one. But quiets compiler.

Change-Id: I691bb52cd7173a2003a54ad3d5a809174b29cedc

11 years ago[tools] g_sans - add trajectory avereging
Alexey Shvetsov [Mon, 14 May 2012 17:01:39 +0000 (21:01 +0400)]
[tools] g_sans - add trajectory avereging

This change adds
1. trajectory averaging for s(q) and p(r)
2. can compute s(q) and p(r) for each frame

Change-Id: Ieb421a8b5ae06b72442bbe5fbae4231a7fa9c980
Signed-off-by: Alexey Shvetsov <alexxy@omrb.pnpi.spb.ru>
11 years agoUnit tests for insolidangle selections.
Teemu Murtola [Fri, 14 Sep 2012 17:24:48 +0000 (20:24 +0300)]
Unit tests for insolidangle selections.

The current input data is not particularly elaborate, and more careful
selection could possibly test more corner cases.  But coverage even with
the current 500+500 random test points should be relatively good.

In addition to the tests themselves and input data for them,
added a Python script that was used to generate the test data.

Part of #651.

Change-Id: I80acd431b2963bf65fbeed53fe6be4f885d07ec5

11 years agoMerge "Add occupied fraction and PDB output to g_ana select."
Roland Schulz [Thu, 4 Oct 2012 12:17:18 +0000 (14:17 +0200)]
Merge "Add occupied fraction and PDB output to g_ana select."

11 years agoMerge "Update valgrind suppressions after mem leak fixes."
Kasson [Thu, 4 Oct 2012 07:18:31 +0000 (09:18 +0200)]
Merge "Update valgrind suppressions after mem leak fixes."

11 years agoMerge "Support C++11 <regex> as alternative to POSIX regex.h."
Kasson [Thu, 4 Oct 2012 07:12:48 +0000 (09:12 +0200)]
Merge "Support C++11 <regex> as alternative to POSIX regex.h."

11 years agoMerge "Encapsulate regexp use in selections."
Kasson [Thu, 4 Oct 2012 07:12:18 +0000 (09:12 +0200)]
Merge "Encapsulate regexp use in selections."

11 years agoAdd occupied fraction and PDB output to g_ana select.
Teemu Murtola [Wed, 12 Sep 2012 18:10:59 +0000 (21:10 +0300)]
Add occupied fraction and PDB output to g_ana select.

- Add output option -of to write out the occupied fraction.
- Add output option -ofpdb to write the same information into a PDB
  file. Option -pdbatoms can be used to control which atoms to write
  out.
- Reorganize error checking for options that only work with a single
  selection or only make sense with dynamic selections.

Supporting changes:
- Add PDB file type to FileNameOption.
- Make write_trxframe_indexed() take the index as a const array.
- Add ConstArrayRef::data() following std::vector::data() from C++11.

The PDB output can also be used to more easily check what is selected by
a selection.

Change-Id: Icabab4b2c88cc21e4d5ebb672a1471c254acb05e

11 years agoUpdate valgrind suppressions after mem leak fixes.
Teemu Murtola [Thu, 13 Sep 2012 04:18:46 +0000 (07:18 +0300)]
Update valgrind suppressions after mem leak fixes.

Change-Id: I910846f24ea964d2240f813d94b47196b863f041

11 years agoSupport C++11 <regex> as alternative to POSIX regex.h.
Teemu Murtola [Sat, 29 Sep 2012 10:46:20 +0000 (13:46 +0300)]
Support C++11 <regex> as alternative to POSIX regex.h.

This allows using regex matching in selections also on Windows.

Change-Id: I0bb2ff3056dfa07779afeace1c02028bdfeb8707

11 years agoEncapsulate regexp use in selections.
Teemu Murtola [Fri, 28 Sep 2012 11:35:35 +0000 (14:35 +0300)]
Encapsulate regexp use in selections.

Add a gmxregex.h header that provides a simple regular expression
matching interface, and use that in selection code instead of using
POSIX regexps directly.  Should make it easier to add regexp support
also on Windows (or at least the complexity is then within just one
file).

Also removed HAVE_SYS_TYPES_H from config.h, as sm_keywords.cpp was the
only place where it was used, and many other files included sys/types.h
unconditionally.

Change-Id: I228ad0cf200bc07a45fd745176add8ee65448789

11 years agoMerge release-4-6 into master
Roland Schulz [Wed, 3 Oct 2012 18:04:41 +0000 (14:04 -0400)]
Merge release-4-6 into master

Conflicts:
src/gromacs/gmxlib/statutil.cpp (trivial)

To avoid unnecessary conflicts I reverted the following
changes from 4.6 before merging:

Because they are backports:
    Fixes for numeric and position selection variables
        caf863c4b51432db29429968c582073fda341865
    Add pdbname selection keyword.
        79f2d06a34715ea2950352a8cbf339423219d7d8.
Because it has to be redone different in master:
    Update use of CPack components and add install targets
        9628e27dcbd51f25d25e39feaef7cb9730bb9f51

Updated cmake/CreateManPage.cmake & cmake/BuildManPages.cmake
for bin location.

Change-Id: I467d75ad1af69712bf0cdddc9d48cd919eebc449

11 years agoMore selection unit tests for variables and fixes.
Teemu Murtola [Sun, 16 Sep 2012 10:40:22 +0000 (13:40 +0300)]
More selection unit tests for variables and fixes.

- Added unit tests for more complex selections where either numeric or
  position values were assigned to variables.
- Fixed handling of subexpressions in these cases (will back-port to
  older branches separately).
- Added unit tests for constant expressions in variables (in particular
  constant positions were not handled right during initial development
  of selections).
- Added comments in the code for some parts that are currently
  unreachable.

Part of #651.

Change-Id: Ifbb585ca00fd7a9715b4c9cb004c3a895551c1a6

11 years agoMerge "Merge release-4-6 into master"
Christoph Junghans [Tue, 2 Oct 2012 21:24:34 +0000 (23:24 +0200)]
Merge "Merge release-4-6 into master"

11 years agoMore thorough unit tests for plus/merge selections.
Teemu Murtola [Thu, 20 Sep 2012 19:01:52 +0000 (22:01 +0300)]
More thorough unit tests for plus/merge selections.

- Test also the return value of mappedId() and refId() from selected
  positions.
- Adjust tested selections to better cover non-atom positions.
- Add tests for dynamic selections with plus/merge.

Part of #651.

Change-Id: I4f9266fd9e1b02d414ed403a182124b244b253db

11 years agoMerge release-4-6 into master
Roland Schulz [Sun, 30 Sep 2012 23:24:42 +0000 (19:24 -0400)]
Merge release-4-6 into master

Conflicts:
cmake/ThreadMPI.cmake (resolved)
src/tools/CMakeLists.txt (resolved)
src/gmxlib/CMakeLists.txt
src/kernel/CMakeLists.txt
src/mdlib/CMakeLists.txt
Last three applied to src/gromacs/CMakeLists.txt and
src/programs/mdrun/CMakeLists.txt.

The release-4-6 version is not the most recent. Merge is being done in
several steps.

Change-Id: Ia9ec3c132a6306701866867aa1a4314541203002

11 years agoMerge release-4-5-patches into release-4-6
Roland Schulz [Mon, 1 Oct 2012 13:20:00 +0000 (09:20 -0400)]
Merge release-4-5-patches into release-4-6

Conflicts:
src/gmxlib/confio.c
src/gmxlib/copyrite.c
src/gmxlib/statutil.c
src/kernel/readir.c
src/kernel/repl_ex.c
src/kernel/runner.c

Change-Id: I3828c50f8166a6095ee64672cfd4380d3e4c86f6

11 years agoFix problems found by cppcheck 1.56
Roland Schulz [Sun, 30 Sep 2012 19:57:59 +0000 (15:57 -0400)]
Fix problems found by cppcheck 1.56

Doesn't fix all problems. New suppressions in Jenkins for 4.6
(so that I can upgrade without having to fix all):

  --suppress=uninitvar:src/gmxlib/md5.c --suppress=nullPointer:src/mdlib/mdebin_bar.c --suppress=nullPointer:src/gmxlib/oenv.c --suppress=nullPointer:src/gmxlib/selection/selhelp.c \
  --suppress=memleak:src/tools/levenmar.c --suppress=selfAssignment:src/gmxlib/nonbonded/nb_kernel_bluegene/* \
  --suppress=invalidPointerCast:src/gmxlib/checkpoint.c --suppress=invalidPointerCast:src/gmxlib/nonbonded/nb_kernel_sse2_single/* --suppress=invalidPointerCast:src/mdlib/fftpack.c \
  --suppress=obsoleteFunctionsusleep:*.c --suppress=obsoleteFunctionsctime_r:*.c --suppress=invalidPrintfArgType_sint:*.c invalidPrintfArgType_uint:*.c

The remaining nullPointer are false positives as far as I know.
Problems found in 4.6 (haven't run cppcheck on 4.5) but
applied to 4.5 because it is also affected.

Change-Id: I5c0b4bce52a0c9ff6ef4ba51721cdf5baff42814

11 years agoRemove unused code.
Teemu Murtola [Fri, 28 Sep 2012 04:05:21 +0000 (07:05 +0300)]
Remove unused code.

- Remove unused header angstat.h (none of the functions were implemented
  anywhere) and function pointer typedefs t_first_x and t_next_x used
  only in it.
- Remove unused static function clear_v().

Change-Id: Ia58497ee5ef6f71174a9e7dfee4ad3a71b452fa1

11 years agoMerge "Fixed an off-by-one error in atom counting in gmx_dist." into release-4-5...
Christoph Junghans [Thu, 27 Sep 2012 20:13:40 +0000 (22:13 +0200)]
Merge "Fixed an off-by-one error in atom counting in gmx_dist." into release-4-5-patches

11 years agoMerge "Fix insolidangle selections near poles." into release-4-5-patches
Teemu Murtola [Thu, 27 Sep 2012 17:56:52 +0000 (19:56 +0200)]
Merge "Fix insolidangle selections near poles." into release-4-5-patches

11 years agoFixed an off-by-one error in atom counting in gmx_dist.
Sander Pronk [Wed, 26 Sep 2012 18:12:48 +0000 (20:12 +0200)]
Fixed an off-by-one error in atom counting in gmx_dist.

Replaced atom number in gmx_rmpbc with total number, so it can
accomodate distances between parts of molecules.

Change-Id: I6279c6ae6d61fd761c4d8d37a01c7d856742e6b8

11 years agoFix a few memory leaks in C++ code.
Teemu Murtola [Thu, 13 Sep 2012 04:17:17 +0000 (07:17 +0300)]
Fix a few memory leaks in C++ code.

These were masked by the legacy code suppressions.  The use of
free_t_atoms() is quite ugly still, but at least it frees some of the
memory allocated in symtab.c.

Change-Id: I0007a9235a75a4e78bebd835875051c67b893845

11 years agoFine-tuning for FileNameOption.
Teemu Murtola [Sun, 9 Sep 2012 17:28:26 +0000 (20:28 +0300)]
Fine-tuning for FileNameOption.

- Change behavior of required options with default values such that the
  default value is now used without an error if the option is not
  provided.  This is how it used to work with file name options.  For
  most other cases, this combination doesn't make much sense, but
  changed it such that it works consistently for all cases.
- Add FileNameOption::defaultBasename() as a more intuitive interface
  for providing a default for file name options.  The name makes it
  clear that no extension is expected, and the option also transparently
  treats required/optional arguments without the user needing to
  understand the difference between defaultValue() and
  defaultValueIfSet().

Closes #642; there is still some things to be improved, but should now
provide about the same features and about the same input options as
the old t_filenm-based system.

Change-Id: Ibcaf0667180e0b24b08604869d855baf23476681

11 years agoMerge "Fix REMD use of gmx_large_int_t for #steps variable" into release-4-5-patches
Christoph Junghans [Tue, 25 Sep 2012 01:45:03 +0000 (03:45 +0200)]
Merge "Fix REMD use of gmx_large_int_t for #steps variable" into release-4-5-patches

11 years agoAdd pdbname selection keyword.
Teemu Murtola [Mon, 24 Sep 2012 04:48:01 +0000 (07:48 +0300)]
Add pdbname selection keyword.

As a supporting change, remove trailing space from t_pdbinfo.atomnm, as
the trailing whitespace does not seem to be used anywhere.
This makes it possible to use it easily in the selection code.

Fixes #1007 in master, will backport to 4.5 branch separately.

Change-Id: Iac36bda8a84d0a6c131445e7f47ad91d7209fb10

11 years agoAdd pdbname selection keyword.
Teemu Murtola [Mon, 24 Sep 2012 04:48:01 +0000 (07:48 +0300)]
Add pdbname selection keyword.

As a supporting change, remove trailing space from t_pdbinfo.atomnm, as
the trailing whitespace does not seem to be used anywhere.
This makes it possible to use it easily in the selection code.

Fixes #1007; fix backported from Iac36bda8.

Also includes changes from 8bddac3 to make the backport easier.

Change-Id: Iac36bda8a84d0a6c131445e7f47ad91d7209fb10

11 years agoMerge "Fixed segfault with FE code for older tpr files." into release-4-6
Kasson [Mon, 24 Sep 2012 04:55:31 +0000 (06:55 +0200)]
Merge "Fixed segfault with FE code for older tpr files." into release-4-6

11 years agoFix REMD use of gmx_large_int_t for #steps variable
Mark Abraham [Mon, 24 Sep 2012 02:06:37 +0000 (12:06 +1000)]
Fix REMD use of gmx_large_int_t for #steps variable

Change-Id: I0a72a8b838de4d018c2715f9d620a86134969206

11 years agoFixes for numeric and position selection variables.
Teemu Murtola [Tue, 18 Sep 2012 05:11:47 +0000 (08:11 +0300)]
Fixes for numeric and position selection variables.

Fixed handling of numeric and position selection variables in cases
where they were referenced multiple times.

Backported from Ifbb585ca.

Fixes #1006.

Change-Id: Ieaa479b4b870e044dc269339be57f6b33533c46e

11 years agoAdd some valgrind suppressions for Mac.
Teemu Murtola [Tue, 18 Sep 2012 11:48:43 +0000 (14:48 +0300)]
Add some valgrind suppressions for Mac.

Should suppress valgrind warnings that currently affect all changes
submitted to the master branch.

Change-Id: Ieab8fb3a6f094b07eb069836be0782473850301c

11 years agoMade construction of parallel filenames less noisy
Mark Abraham [Mon, 17 Sep 2012 13:45:35 +0000 (23:45 +1000)]
Made construction of parallel filenames less noisy

Berk introduced this in 6b4a52fc, but it is not essential to the
function there, is not very useful for the user, and spams the stdout
with every possible filename for every simulation in (say) a
multi-simulation.

Change-Id: Ifd017c3907f6a46a4f86ac9bc06c5983a5dea946

11 years agoFix insolidangle selections near poles.
Teemu Murtola [Fri, 14 Sep 2012 17:28:29 +0000 (20:28 +0300)]
Fix insolidangle selections near poles.

- Correctly treat cases where a point is so close the one of the poles
  that it completely covers one or more bins in the zenith angle
  direction.
- Adjust update_surface_bin() to be more robust to rounding errors and
  easier to understand by simplifying the code used for wrapping angles
  to [-pi, pi] interval.  Problems were triggered here by the first
  change.
- Update comments.

Fixes #1004.

Change-Id: I2707f775793fabb64ea197bdae5fbfe68d6a8933

11 years agoMerge "Fix some memory leaks." into release-4-5-patches
Kasson [Sat, 15 Sep 2012 15:04:38 +0000 (17:04 +0200)]
Merge "Fix some memory leaks." into release-4-5-patches

11 years agoMerge "Adapted NMR related data to new pdb format." into release-4-5-patches
David van der Spoel [Sat, 15 Sep 2012 12:52:22 +0000 (14:52 +0200)]
Merge "Adapted NMR related data to new pdb format." into release-4-5-patches

11 years agoMerge "fixed recent bug with grompp check for P-R P-coupling" into release-4-5-patches
Christoph Junghans [Fri, 14 Sep 2012 15:47:05 +0000 (17:47 +0200)]
Merge "fixed recent bug with grompp check for P-R P-coupling" into release-4-5-patches

11 years agofixed recent bug with grompp check for P-R P-coupling
Berk Hess [Thu, 13 Sep 2012 16:34:12 +0000 (18:34 +0200)]
fixed recent bug with grompp check for P-R P-coupling

Fix for recent commit 57dac834

Change-Id: I5bc631d6db848c8702a65c42ae27f096804abbf7

11 years agoBackport of md-vv rerun check from c7a82654f2eb8992
Roland Schulz [Thu, 13 Sep 2012 16:41:47 +0000 (12:41 -0400)]
Backport of md-vv rerun check from c7a82654f2eb8992

Rerun in parallel with md-vv is broken. The check was added
in c7a82654f2eb8992 but also affects 4.5.

Fixes #1003

Change-Id: Ie0e200a8328b2baecd2eba9eea1453c65a668633

11 years agoFixed a deadlock in tMPI_Comm_free()
Sander Pronk [Thu, 13 Sep 2012 09:26:09 +0000 (11:26 +0200)]
Fixed a deadlock in tMPI_Comm_free()

Fixes a deadlock on overcommitted systems while calling tMPI_Comm_free(),
as first noticed by Roland.

Brings tMPI_Barrier()'s use of atomic variables and memory barriers
in line with the rest of the thread_mpi code.

Change-Id: I86613cdf3c657e907f1168feb544e534889d0557

11 years agoFix some memory leaks.
Teemu Murtola [Thu, 13 Sep 2012 04:20:42 +0000 (07:20 +0300)]
Fix some memory leaks.

Fixes part of #1004.

Change-Id: I22280999c5c3c40e8efae45461bd53bae8e2ff40

11 years agoSet valid build information if gmx_detectcpu fails
Roland Schulz [Wed, 5 Sep 2012 10:57:56 +0000 (06:57 -0400)]
Set valid build information if gmx_detectcpu fails

If gmx_detectcpu failed the error message was written
into the build info which could cause a compiler error.

Change-Id: Id7e367595c14270dc8fa91daa97ce13a4c686057

11 years agoMerge "Don't fail linking if man page building fails" into release-4-6
Mark Abraham [Wed, 12 Sep 2012 00:17:28 +0000 (02:17 +0200)]
Merge "Don't fail linking if man page building fails" into release-4-6

11 years agoupdated references
Christoph Junghans [Mon, 10 Sep 2012 23:07:21 +0000 (17:07 -0600)]
updated references

Change-Id: I74a53433b31c0d50524e0edb5865a8ef9fca1956

11 years agoMerge *optioninfo.h to *option.h.
Teemu Murtola [Sun, 9 Sep 2012 10:38:29 +0000 (13:38 +0300)]
Merge *optioninfo.h to *option.h.

Merge each *optioninfo.h header to the header that declared the
corresponding public option classes (setManagerForSelectionOptions() was
moved to selectionoptionmanager.*).  After 030c229 (I143592ed), there is
little need to have these in separate headers, as the OptionInfo classes
are now required when creating options.

Not having the implementation split over so many headers makes the code
easier to understand and to maintain, and this outweighs the small
benefits from being able to use the OptionInfo classes without adding a
dependency also on the Option classes (only OptionVisitor would
currently benefit from that).

Adjusted Doxygen documentation for OptionInfo and SelectionOptionInfo
(and some of the files) as part of the reorganization and did some
include cleanup related to the reorganization.  Otherwise, this change
only moves existing code around with no functional changes.

Change-Id: Ic1c62739beca09028887179da26b33516d01624b

11 years agoMerge "Allow 'atomname' and 'atomtype' in selections."
Christoph Junghans [Mon, 10 Sep 2012 19:01:15 +0000 (21:01 +0200)]
Merge "Allow 'atomname' and 'atomtype' in selections."

11 years agoMerge "Update use of CPack components and add install targets" into release-4-6
Roland Schulz [Mon, 10 Sep 2012 13:01:01 +0000 (15:01 +0200)]
Merge "Update use of CPack components and add install targets" into release-4-6

11 years agoCorrected REMD citation
Mark Abraham [Mon, 10 Sep 2012 09:52:22 +0000 (19:52 +1000)]
Corrected REMD citation

The Fukushima paper relates exclusively to MC and spin glasses.

Change-Id: I58c4eafbe41b0cbd1f3e4afac6f34458ed27eea2

11 years agoMerge "Fix VMD plugins on Windows" into release-4-6
Christoph Junghans [Fri, 7 Sep 2012 19:29:06 +0000 (21:29 +0200)]
Merge "Fix VMD plugins on Windows" into release-4-6

11 years agoMerge "Check that gmx_detectcpu runs correctly" into release-4-6
Christoph Junghans [Fri, 7 Sep 2012 19:28:31 +0000 (21:28 +0200)]
Merge "Check that gmx_detectcpu runs correctly" into release-4-6

11 years agoAdapted NMR related data to new pdb format.
David van der Spoel [Fri, 7 Sep 2012 19:13:22 +0000 (21:13 +0200)]
Adapted NMR related data to new pdb format.

Since gromacs had adopted the pdb output format to
some standard, the script to convert xplor files
with NMR restratints, such as can be downloaded from
the pdb do not work anymore. The script and accompanying
table have been updated to work with the new pdb format
and simultaneously the extra argument for a residue offset
has been removed. Now the script can be run like
xplor2gmx.pl conf.pdb < restraints.md > disre.itp

Change-Id: I7c3c8bd49b002e2bf0760f4226c913aa36d64611

11 years agoPrint more information on exceptions.
Teemu Murtola [Fri, 7 Sep 2012 10:20:23 +0000 (13:20 +0300)]
Print more information on exceptions.

- Identify a few more exception types instead of printing "Unknown
  exception".  Print the dynamic type of the exception for the unknown
  exception case as well as some other cases.
- Print errno information if it is included in the exception.

Part of #838.

Change-Id: If64bd37e32e2585f78fb95a29a4a2eef95b79142

11 years agoBetter error messages for SelectionFileOption.
Teemu Murtola [Mon, 3 Sep 2012 04:29:05 +0000 (07:29 +0300)]
Better error messages for SelectionFileOption.

Use the added exception context information to provide the file name in
the error message when there is a problem with a selection provided with
-sf.  Also improve the error messages for cases where the number of
selections in the file does not match what is expected, or where the
assignment of selections to options is ambiguous.

Closes #656.

Change-Id: I6158960a970e6a22fb28f3872538f1de16883887

11 years agoBetter context information handling for exceptions.
Teemu Murtola [Fri, 31 Aug 2012 18:39:17 +0000 (21:39 +0300)]
Better context information handling for exceptions.

- GromacsException now has a prependContext() method that can be used in
  a catch block to add additional context information to the exception
  before rethrowing it.
- It is possible to nest exceptions instead of embedding all information
  into the exception message string.

Information added by these new methods is currently not easily
accessible outside the exception implementation, but it is not needed
either.  Such access can be implemented once it is more clear what are
the requirements.

Closes #985.

Change-Id: I2b9ed1d11ee3cb36cc7da927cf6730c6f8c353b2

11 years agoRestructure fatal error formatting.
Teemu Murtola [Wed, 22 Aug 2012 17:52:57 +0000 (20:52 +0300)]
Restructure fatal error formatting.

Split printFatalError() in errorformat.h to separate functions that
print the error header, (part of) the actual message, and the footer.
This makes it possible to print the message in calling code
incrementally instead of formatting it into a string buffer.
It is easier to print the message in parts this way, and there is also
less complications in handling possible std::bad_alloc errors from
manipulating a std::string.

Also added line wrapping functionality to the message writing function,
and improved the appearance of the header.

Part of #838 and #985.

Change-Id: Ief7399d8c7c2c0529e0bc8492726bff827e18c4c

11 years agoMore features for TextLineWrapper.
Teemu Murtola [Mon, 27 Aug 2012 17:53:06 +0000 (20:53 +0300)]
More features for TextLineWrapper.

Add more control over formatting the wrapped lines:
- Add possibility to indent the wrapped lines.
- Add possibility to indent the first line after an explicit line break
  differently from other lines.
- Add possibility to mark line continuation using an explicit character.
- Add possibility to either remove or keep leading whitespace after an
  explicit line break.
All except the last are already useful for the current console output.
Depending on the chosen solution, some or all of these are also needed
for #969.

Also expose the lower-level interface used internally that makes it
possible to write code that iterates over the wrapped lines and does
something else than just format them into a buffer.  May be useful for
some cases in #969, but is necessary to use the wrapper for #838 (line
wrapping in error messages).

Change-Id: I905ba29856773656bf000c4b2e14d1ed2ba4de31

11 years agoFix illegal call to MPI without being initialized
Roland Schulz [Thu, 6 Sep 2012 19:42:04 +0000 (15:42 -0400)]
Fix illegal call to MPI without being initialized

Introduced by babdd87ca126

Change-Id: I428ef8ce706cc3a23fc980fa54c3e26e7a6d68b2

11 years agoMerge "Fixed .g96 trajectory reading." into release-4-5-patches
Roland Schulz [Thu, 6 Sep 2012 17:04:48 +0000 (19:04 +0200)]
Merge "Fixed .g96 trajectory reading." into release-4-5-patches

11 years agoDon't fail linking if man page building fails
Roland Schulz [Wed, 5 Sep 2012 14:01:26 +0000 (10:01 -0400)]
Don't fail linking if man page building fails

If building of man page fails because binary cannot be
executed (e.g. undetected cross-compile) then fail
silently. A warning is printed when installing.
Only affects deverloper version (not source from cpack).

Change-Id: I9201d44a103602bb26a29b03d14ce08a0089540a

11 years agoCheck that gmx_detectcpu runs correctly
Roland Schulz [Wed, 5 Sep 2012 10:04:00 +0000 (06:04 -0400)]
Check that gmx_detectcpu runs correctly

If it doesn't run correctly set acceleration to None and
print warning. Same as check whether it compiled, which already
existed.

Change-Id: I59a2d531c41f931d162725540d5483b39aa7a3df

11 years agoFixed an undefined return value in tMPI_Scan()
Sander Pronk [Wed, 5 Sep 2012 09:36:23 +0000 (11:36 +0200)]
Fixed an undefined return value in tMPI_Scan()

As caught by Szilárd, the tMPI_Scan() return value was undefined
for rank==0. Also removed an unused variable in tMPI_Thread_create().

Change-Id: I0b15f55089f50e0c237635ad322c7d38ce82c275

11 years agoMerge "Fixes too many backup files for *.nroff files" into release-4-6
Christoph Junghans [Tue, 4 Sep 2012 16:42:00 +0000 (18:42 +0200)]
Merge "Fixes too many backup files for *.nroff files" into release-4-6

11 years agoMerge "Reorganize CommandLineHelpWriter implementation."
Christoph Junghans [Tue, 4 Sep 2012 16:41:17 +0000 (18:41 +0200)]
Merge "Reorganize CommandLineHelpWriter implementation."

11 years agoMerge "Fix SelectionParserParameter move constructor problem."
Christoph Junghans [Tue, 4 Sep 2012 16:40:50 +0000 (18:40 +0200)]
Merge "Fix SelectionParserParameter move constructor problem."

11 years agoMade tutorial slightly less confusing.
David van der Spoel [Tue, 4 Sep 2012 13:27:57 +0000 (15:27 +0200)]
Made tutorial slightly less confusing.

Change-Id: Ief3132a54770e8b3c3b69b24b5582ba321ccc5fd

11 years agoAllow 'atomname' and 'atomtype' in selections.
Teemu Murtola [Tue, 4 Sep 2012 03:48:25 +0000 (06:48 +0300)]
Allow 'atomname' and 'atomtype' in selections.

'atomname' is now synonymous to 'name', and similarly for 'atomtype' and
'type'.  This reduces confusion, as the code uses atomname and atomtype
internally.  Also use the aliases in tests.

Change-Id: Ifa96840c1fc9c519be53b1bb5aae4f4910cdb0ff

11 years agoFixed .g96 trajectory reading.
Sander Pronk [Mon, 3 Sep 2012 11:58:25 +0000 (13:58 +0200)]
Fixed .g96 trajectory reading.

The line variable in .g96 configuration reading can now be made
persistent - and is done so for reading .g96 trajectories.

This commit fixes #781

Change-Id: If2005a00bb925b41802c4b0dc92e66eb5635f22c

11 years agoMerge "Document correct comm_mode option" into release-4-5-patches
Kasson [Mon, 3 Sep 2012 10:53:57 +0000 (12:53 +0200)]
Merge "Document correct comm_mode option" into release-4-5-patches

11 years agoMerge "Improved pdb2gmx output" into release-4-5-patches
Kasson [Mon, 3 Sep 2012 10:51:40 +0000 (12:51 +0200)]
Merge "Improved pdb2gmx output" into release-4-5-patches

11 years agoMerge branch 'release-4-5-patches' into release-4-6
Szilard Pall [Mon, 3 Sep 2012 10:40:56 +0000 (12:40 +0200)]
Merge branch 'release-4-5-patches' into release-4-6

Conflicts:
src/mdlib/tpi.c

Change-Id: I1b5d92291ece7cf3194b4e1d88cd686a5aa18696

11 years agoFix VMD plugins on Windows
Roland Schulz [Mon, 3 Sep 2012 02:49:27 +0000 (22:49 -0400)]
Fix VMD plugins on Windows

VMD libraries are named *.so even on Windows

Change-Id: I4502af3a716b79820502c70fcfe2fc68749a77fc

11 years agoFix stack error in grompp
Roland Schulz [Sun, 2 Sep 2012 16:26:22 +0000 (12:26 -0400)]
Fix stack error in grompp

vsiteatoms array was one to short

Fixes #997

Change-Id: I0897694dfc431a20bd1ebf769b24d09038d588b2

11 years agoReorganize CommandLineHelpWriter implementation.
Teemu Murtola [Sun, 26 Aug 2012 03:50:07 +0000 (06:50 +0300)]
Reorganize CommandLineHelpWriter implementation.

Instead of separate classes to write out descriptions and different
types of options, there is now three main local classes:
 - OptionsFilter: has output format independent logic to do the
   filterting that was previously implemented in each class separately.
 - OptionsFormatterInterface: interface that OptionsFilter uses to do
   output format specific formatting for the options.
 - OptionsConsoleFormatter: implements the above interface to produce
   the console help that was previously done by the separate classes.

Prerequisite for #969 independent of the chosen solution.
May need additional work as part of that issue.

Change-Id: Ica506f3567b4527f210c48c1b43069d4b64007ec

11 years agoUpdate use of CPack components and add install targets
Mark Abraham [Wed, 22 Aug 2012 08:21:34 +0000 (18:21 +1000)]
Update use of CPack components and add install targets

* Removed component runtime and replaced it with component "scripts",
a component for each tool, and the component group tools. This means
CPack is capable of dealing with a single tool, or with the whole
group.
* Moved gmxpreprocess library to libraries component.
* Created CPack dependencies so that shared libraries accompany
executables.
* Created non-CPack install targets for each GROMACS tool, e.g.
"make install-grompp". Shared libraries are installed with these
tools as appropriate. Using library suffices could be right here,
but that's the user's problem to solve.

Development, regression testing and bug testing is more convenient if
you can easily build and install just a subset of tools. This could
always have been done with CMake black magic, but these targets makes
lives easier. Also users can now easily install MPI or
double-precision flavours of selected tools as suitable.

Change-Id: I1053f7ff91d50169ac930f1ac5b84378d3ab2e67

11 years agoImproved pdb2gmx output
Mark Abraham [Fri, 31 Aug 2012 03:43:29 +0000 (13:43 +1000)]
Improved pdb2gmx output

Now there is explicit feedback that pdb2gmx is starting generating
hydrogens and termini, which can help the user deduce that problems
lie with those databases, and not necessarily the residue topology
database.

Change-Id: Ie4100b8586d6389a6965ea8cb09eb24cc4e7d3d9

11 years agoRemove obsolete .gitignore entries.
Teemu Murtola [Fri, 31 Aug 2012 04:30:13 +0000 (07:30 +0300)]
Remove obsolete .gitignore entries.

Now that binaries are built under bin/ and libraries under lib/, most
.gitignore files are unnecessary (and they didn't work previously that
well, either).

Change-Id: Id438f45e896a0d0018c80feafc32242067248855

11 years agoMore generic way to obtain OptionInfo for options.
Teemu Murtola [Thu, 30 Aug 2012 19:08:55 +0000 (22:08 +0300)]
More generic way to obtain OptionInfo for options.

Options::addOption() now returns a pointer to the OptionInfo object that
corresponds to the created option.  This provides a nicer and more
generic way compared to SelectionOption::getAdjuster(), and hopefully
makes it easier for static analysis and compilers to understand that the
info object always gets initialized to a non-NULL value.

Since this change requires the declaration of the corresponding info
object to be available whenever addOption() is called, one could also
get rid of the separate *optioninfo.h headers and merge them to the
corresponding *option.h headers.  This would reduce the number of files
for one option type, and possibly make it a bit easier to maintain.
Didn't do that in this change to keep it more clear.

Change-Id: I143592ed3a0750d3908c6bc8897179d9059ea546

11 years agoFixes too many backup files for *.nroff files
Roland Schulz [Thu, 30 Aug 2012 03:34:21 +0000 (23:34 -0400)]
Fixes too many backup files for *.nroff files

Problem introduced by 26bd5f7ac7af. nroff files are generated
automatically and one could get erorr message when 99 backup files
existed.

Change-Id: Ia0a5c7e04064a0d304266e1dc6af347d3e846864

11 years agoFix SelectionParserParameter move constructor problem.
Teemu Murtola [Thu, 30 Aug 2012 02:58:05 +0000 (05:58 +0300)]
Fix SelectionParserParameter move constructor problem.

C++11 only declares move constructors implicitly if a class does not
have a user-defined destructor.

Change-Id: I3c12b0e93920c102d77bb436c417ceef90a9c6c6

11 years agobug fix for pme.c MPI_COMM_NULL fix dcf8b67e
Berk Hess [Wed, 29 Aug 2012 16:00:08 +0000 (18:00 +0200)]
bug fix for pme.c MPI_COMM_NULL fix dcf8b67e

Change-Id: Idb233db1337bcb881041caec96572e5df6183e6e

11 years agoEnable C++ use in selection methods.
Teemu Murtola [Fri, 24 Aug 2012 09:56:42 +0000 (12:56 +0300)]
Enable C++ use in selection methods.

The method that frees the internal data structure for a selection method
now also has the responsibility of freeing the data structure itself.
This makes it possible to allocate the data structure using operator new
in the initialization function, and then correctly free it.

Prerequisite for using C++ types in selection methods before #652 is
implemented.

Change-Id: I99e5a907cbdc4975d20becb0fb1d33e0026c135c

11 years agoAdd syntax to force selection string matching mode.
Teemu Murtola [Fri, 24 Aug 2012 09:42:19 +0000 (12:42 +0300)]
Add syntax to force selection string matching mode.

The selection syntax for string keyword matching no longer depends on
whether regular expression support is available.  Instead, an error is
now given if the string looks like a regexp (the logic for the deduction
is not changed), but regexp support is not available.  Added syntax to
force the string matching to use either literal, wildcard, or regexp
matching.

This change allows removing a few more direct prints to stderr (related
to #655).

Closes #938.

Change-Id: I7b998050c8b00b5f1229ed23a0a15685c514010f

11 years agoRemove remaining GMX_ERROR uses.
Teemu Murtola [Thu, 23 Aug 2012 17:44:31 +0000 (20:44 +0300)]
Remove remaining GMX_ERROR uses.

Replaced those still left in selection parsing code by exceptions or
assertions.

Related to #655 and #880.

Change-Id: I89bff0c03eb15176e699529888aaae532f0c4138

11 years agoFix internal error with selection "resname help".
Teemu Murtola [Thu, 23 Aug 2012 04:00:56 +0000 (07:00 +0300)]
Fix internal error with selection "resname help".

- Always recognize "help" as a help request token, which then causes a
  syntax error in invalid context instead of an internal error in the
  tokenizer symbol table lookup.
- Change the internal error in question to use an exception for error
  reporting to make it possible to easily check it in a unit test.

Change-Id: I4a4057840b47a818cc840654945e84ec536e35b0

11 years agoHandle SelectionParserParameter as a value type.
Teemu Murtola [Thu, 23 Aug 2012 03:24:07 +0000 (06:24 +0300)]
Handle SelectionParserParameter as a value type.

Now that SelectionParserValue is also a C++ object, it is
straightforward to treat SelectionParserParameter as a (movable, but not
copyable) value type instead of storing it through a smart pointer in a
container.  Leads to more consistent and less complex code.

Related to #655 and #880.

Change-Id: I377bac05b1bd990ad95b38887f0f7b825bf0a805

11 years agoC++ classes for selection parser values.
Teemu Murtola [Wed, 22 Aug 2012 15:32:29 +0000 (18:32 +0300)]
C++ classes for selection parser values.

Converted t_selexpr_value to gmx::SelectionParserValue and introduced
smart pointers and standard containers to manage all memory related to
these objects.

Related to #655 and #880.

Change-Id: Ide2d9db80e89f36c94dccc25085d49959e4115a8

11 years agoC++ classes for selection parser parameters.
Teemu Murtola [Fri, 17 Aug 2012 11:13:40 +0000 (14:13 +0300)]
C++ classes for selection parser parameters.

Converted t_selexpr_param to gmx::SelectionParserParameter and
introduced smart pointers and standard containers to manage all memory
related to these objects.  Solves several exception safety issues in the
selection parser.

Related to #655 and #880.

Change-Id: Ia4c477f1313b49cd1da3b0407bec6e7a1a8b9296

11 years agoC++ classes for selection parser symbol table.
Teemu Murtola [Sat, 11 Aug 2012 11:53:38 +0000 (14:53 +0300)]
C++ classes for selection parser symbol table.

Convert the implementation of selection parser symbol table to use C++
classes.
 - Removes a few exception safety issues that were present in the
   initialization, as well as direct prints to stderr.
 - Documentation now follows the new Doxygen layout.
 - Removes some underscore-prefixed global names.

Related to #655 and #880.

Change-Id: Iecb690fa2e413c9dc487aacffac62a248ea3867a

11 years agoRationalize selection element name handling.
Teemu Murtola [Thu, 2 Aug 2012 19:13:24 +0000 (22:13 +0300)]
Rationalize selection element name handling.

The name of SelectionTreeElement is now a plain std::string that manages
its own memory instead of pointing to memory managed somewhere else.
The original design has been a pain to maintain at times, as the memory
for the name easily gets freed, leaving a dangling pointer.

Change-Id: I7b975c67ce9eee7f981128e29d8d9dd75fc70c89

11 years agoMoved selection parser helpers into separate file.
Teemu Murtola [Sun, 12 Aug 2012 09:24:45 +0000 (12:24 +0300)]
Moved selection parser helpers into separate file.

Makes parser.y much more streamlined, as there is now nearly only Bison
declarations and the actual semantic actions.  Also, editing the helpers
no longer requires regenerating the parser (which most likely also
changes the line numbers in parser.cpp, which is typically the largest
part of such changes).

Change-Id: I60e76b95725fb9f647f3cddf64773b3f94185b06

11 years agoUse smart pointers to manage the selection tree.
Teemu Murtola [Thu, 2 Aug 2012 04:14:25 +0000 (07:14 +0300)]
Use smart pointers to manage the selection tree.

Changed t_selelem to gmx::SelectionTreeElement and t_selelem * to
gmx::SelectionTreeElementPointer (or a const reference).  The latter is
a boost::shared_ptr because there may be multiple references to some
elements in the evaluation tree.  Some exceptions to the above rule are
present, because it was not straightforward to change those parts.

Prerequisite for using exceptions throughout the selection code, which
in turn is a prerequisite for many tasks that would introduce more C++
there.

There are some parts that are not yet exception-safe, but may throw
std::bad_alloc as the result of these changes.  Will fix those in
subsequent commits.

Related to #655 and #880.

Change-Id: Ib36c08bac1ab2c9818604e45e2eb14a90069efdb

11 years agoRemove most uses of t_selelem::refcount.
Teemu Murtola [Sat, 28 Jul 2012 19:35:28 +0000 (22:35 +0300)]
Remove most uses of t_selelem::refcount.

This is a prerequisite for using smart pointers to manage the selection
evaluation tree, as it's difficult to keep a similar reference count
up-to-date and (or use pointer reference counts for the purposes it is
currently used for).

Related to #655 and #880.

Change-Id: I9e6ae98067f8fe96d39aea6df076e2675ecb8a1f

11 years agoAdded a sfree_guard for exception safety.
Teemu Murtola [Thu, 2 Aug 2012 04:11:44 +0000 (07:11 +0300)]
Added a sfree_guard for exception safety.

Added a helper class for calling sfree() on scope exit.  This is useful
for exception safety in code that calls old C functions, as well as in
piecewise conversion of old code to use exceptions.

Change-Id: Ie31483734b66895ad8148eff3db0300ae28b38b4

11 years agoDocument correct comm_mode option
Mark Abraham [Tue, 28 Aug 2012 01:16:19 +0000 (11:16 +1000)]
Document correct comm_mode option

Change-Id: I18d9896c51d486dfcc52e4d15b052d65de91426d

11 years agoNewer version of thread_mpi, with various fixes, including tMPI_Scan()
Sander Pronk [Tue, 21 Aug 2012 11:10:45 +0000 (13:10 +0200)]
Newer version of thread_mpi, with various fixes, including tMPI_Scan()

- Implements tMPI_Scan()
- Many doxygen fixes
- removed unused variables from atomic operations
- Added C++11 compatible thread and mutex class

Change-Id: I4cce48627fa846da3c599a7de64d3898c358390b

11 years agoFixed segfault with FE code for older tpr files.
Sander Pronk [Thu, 23 Aug 2012 09:16:05 +0000 (11:16 +0200)]
Fixed segfault with FE code for older tpr files.

Full all_lambda array wasn't allocated for gmx 4.5 tpr files, even
though the rest of the code depends on it.

Change-Id: I3e4b6273d9e769a430fffc95e3a9c94fb672f6f3

11 years agoAdded PGLU entry in aminoacids.n.tdb for OPLS-AA.
Bogdan Iorga [Wed, 22 Aug 2012 16:30:26 +0000 (18:30 +0200)]
Added PGLU entry in aminoacids.n.tdb for OPLS-AA.

Previously, pdb2gmx would fail during terminus selection for this residue.

Change submitted initially on the master branch, then abandoned.
(https://gerrit.gromacs.org/#/c/1290/)

Fixes #804.

Change-Id: Ic810242dc65019858c0332d352ef1ba96d4662d6

11 years agoMerge "Fixing of things associated with aminoacid.rtp header" into release-4-6
Christoph Junghans [Mon, 20 Aug 2012 17:52:48 +0000 (19:52 +0200)]
Merge "Fixing of things associated with aminoacid.rtp header" into release-4-6

11 years agoMerge "Clean up some variable naming for eigensolving" into release-4-6
Christoph Junghans [Mon, 20 Aug 2012 17:51:08 +0000 (19:51 +0200)]
Merge "Clean up some variable naming for eigensolving" into release-4-6

11 years agoMerge "Fix coordinate is zero check in gmxcheck" into release-4-5-patches
Christoph Junghans [Mon, 20 Aug 2012 17:50:53 +0000 (19:50 +0200)]
Merge "Fix coordinate is zero check in gmxcheck" into release-4-5-patches