alexxy/gromacs.git
11 years agoMerge remote-tracking branch 'origin/release-4-6' into HEAD
Roland Schulz [Tue, 10 Jul 2012 04:46:15 +0000 (00:46 -0400)]
Merge remote-tracking branch 'origin/release-4-6' into HEAD

Conflicts:
admin/mknroff.pl (deleted)
share/template/CMakeLists.txt (added both)
src/CMakeLists.txt (trivial)
src/gromacs/gmxlib/oenv.cpp (see next)
src/gromacs/gmxlib/statutil.cpp (change moved to
           src/gromacs/utility/programinfo.cpp)
src/kernel/CMakeLists.txt (added gmx_add_man_page
           to programs/*/CMakeLists.txt)
src/kernel/mk_ghat.c (was deleted. no change)
src/ngmx/CMakeLists.txt (trivial)

Change-Id: Ic8c69541f8d801e3b1d32b26e886cf0602c34cf4

11 years agoExtension completion for FileNameOption.
Teemu Murtola [Sun, 8 Jul 2012 05:27:43 +0000 (08:27 +0300)]
Extension completion for FileNameOption.

- Make FileNameOption to complete extensions for input files, like the
  old file options did.
- Add descriptions for all file name options to improve the help output.
- Make defaultValueIfSet() really appear in the help output: it worked
  only in the case the option value was not stored.
- Adjust the reference for command-line help tests to match the new
  output.

Part of #642.

Change-Id: I4a749e3e82a42a6e64e0a78c91120f96a00381b9

11 years agoBetter invalid option value handling.
Teemu Murtola [Thu, 28 Jun 2012 09:04:31 +0000 (12:04 +0300)]
Better invalid option value handling.

- Give an error when trying to give an empty string as a value for a
  numeric option, as well as when the given value overflows/underflows
  the target variable.
- Don't give extra errors (e.g., about too few valid values) when a
  value for an option was invalid.
- Make assignment more atomic: if there was an error in a set of values,
  ignore other values.

Change-Id: I30fd471f6d65246b4215a5ee775f0d16492a21d0

11 years agoMerge "Remove remaining underscore-prefixed C++ symbols."
Roland Schulz [Fri, 6 Jul 2012 10:41:15 +0000 (12:41 +0200)]
Merge "Remove remaining underscore-prefixed C++ symbols."

11 years agoMerge "Set common output directory for binaries"
Roland Schulz [Fri, 6 Jul 2012 10:33:36 +0000 (12:33 +0200)]
Merge "Set common output directory for binaries"

11 years agoRemove remaining underscore-prefixed C++ symbols.
Teemu Murtola [Fri, 6 Jul 2012 05:19:14 +0000 (08:19 +0300)]
Remove remaining underscore-prefixed C++ symbols.

More of the same as in e39fb5f (I7f4bf42e), no manual editing.
The C++ code should now consistently use underscore suffixes instead of
prefixes for member variables.

Change-Id: I94ae31da201cc23d1a0d87e5ec1251b30c085cc0

11 years agoMerge "Test framework for TrajectoryAnalysisModules."
Teemu Murtola [Fri, 6 Jul 2012 05:10:20 +0000 (07:10 +0200)]
Merge "Test framework for TrajectoryAnalysisModules."

11 years agoTest framework for TrajectoryAnalysisModules.
Teemu Murtola [Wed, 23 May 2012 07:14:50 +0000 (10:14 +0300)]
Test framework for TrajectoryAnalysisModules.

- Add a test fixture that makes it simple to test analysis tools that
  are implemented as TrajectoryAnalysisModule subclasses (moduletest.*).
- Add tests using the new fixture for most of the functionality of the
  Select module.
- Minor adjustment to reference data test fixture to make it more usable
  in this context.
- Move all dataset registration calls to trajectory analysis module
  constructors from initAnalysis().  Also moved static initialization of
  the datasets, in particular calls to setMultipoint().
  In addition to enabling the tests to access the datasets before any
  initialization of the module is done, this also makes the modules
  easier to use for other interfacing than the command-line runner.

Main part of #920, may need some additional features.

Change-Id: I67e123f8361fe7710e936d9b4a880e65a3dc89c5

11 years agoAdding FFT Unit Tests
Roland Schulz [Tue, 5 Jun 2012 01:38:14 +0000 (21:38 -0400)]
Adding FFT Unit Tests

Change-Id: I3de741e6c66ac1e611d78962606253a3c903cbef

11 years agoDon't prevent GMX_PREFER_STATIC_LIBS with BUILD_SHARED_LIBS
Roland Schulz [Thu, 5 Jul 2012 23:08:41 +0000 (19:08 -0400)]
Don't prevent GMX_PREFER_STATIC_LIBS with BUILD_SHARED_LIBS

In general it seems better to not overwrite the user requested
settings unless the settings are not possible.
In this case the combination makes sense for binary packages.
Static external libraries make them easier to distribute and
shared gromacs libraries make them much smaller.

Change-Id: Icb9c4dfa2e7d211ab6bd2efcb2f2437504a87cfe

11 years agoSet common output directory for binaries
Roland Schulz [Tue, 3 Jul 2012 01:49:43 +0000 (21:49 -0400)]
Set common output directory for binaries

This causes all binaries to be placed in "bin" in the build
directory and all libraries in the "lib". This makes it easier
to call binaries without installing.

Change-Id: I9dd7b5bde06b1ff9b0e7e9171854198bb8c1d749

11 years agoMerge "Extract doxygen documentation for static symbols."
Christoph Junghans [Thu, 5 Jul 2012 21:00:15 +0000 (23:00 +0200)]
Merge "Extract doxygen documentation for static symbols."

11 years agoBuild man-pages instead of distributing them in the source
Roland Schulz [Wed, 4 Jul 2012 01:55:29 +0000 (21:55 -0400)]
Build man-pages instead of distributing them in the source

One less thing to do manual for releasing the code. And thus
avoiding to accidental releasing which old version of man-pages.

Writing copyright notice to stderr for all programs (was inconsistent)
and caused copyright notice to be displayed during build.

The CPack source package continues to contain the man pages pre-build.
CPack verifies that they are genenerated before building the source
package.

Added .isreposource to distinquish code obtained from git from code
downloaded as CPack source package.

Related to #645, #854, #735
Fixes #878

Change-Id: I7d7145fb99d3f1991d0f3992ca4f3ea20668dd9a

11 years agoMerge "Improve ProgramInfo and use it everywhere."
David van der Spoel [Thu, 5 Jul 2012 20:13:24 +0000 (22:13 +0200)]
Merge "Improve ProgramInfo and use it everywhere."

11 years agoExtract doxygen documentation for static symbols.
Teemu Murtola [Sat, 30 Jun 2012 09:35:16 +0000 (12:35 +0300)]
Extract doxygen documentation for static symbols.

The full doxygen documentation now includes documentation for static
methods.  Fixed warnings from undocumented static methods in documented
files.

Change-Id: Ib77dc8e19882c6b2f4a1a97a4fcab63277aae211

11 years agoMerge "Fix most doxygen warnings."
Christoph Junghans [Thu, 5 Jul 2012 19:53:55 +0000 (21:53 +0200)]
Merge "Fix most doxygen warnings."

11 years agoMerge "Don't rerun checks and be quiet 2nd time cmake is run" into release-4-6
Christoph Junghans [Thu, 5 Jul 2012 19:45:36 +0000 (21:45 +0200)]
Merge "Don't rerun checks and be quiet 2nd time cmake is run" into release-4-6

11 years agoMerge "Allow also FindMPI for cmake<2.8.5" into release-4-6
Christoph Junghans [Thu, 5 Jul 2012 19:42:15 +0000 (21:42 +0200)]
Merge "Allow also FindMPI for cmake<2.8.5" into release-4-6

11 years agoMerge "Finalized and extended Szilard's openMP cleanup of gmx_hbond.c:" into release-4-6
Christoph Junghans [Thu, 5 Jul 2012 19:26:41 +0000 (21:26 +0200)]
Merge "Finalized and extended Szilard's openMP cleanup of gmx_hbond.c:" into release-4-6

11 years agoDon't rerun checks and be quiet 2nd time cmake is run
Roland Schulz [Tue, 26 Jun 2012 19:23:38 +0000 (15:23 -0400)]
Don't rerun checks and be quiet 2nd time cmake is run

Change-Id: I86f8cb4dfb73898e74d320ae8ef3676e62ebde51

11 years agoFinalized and extended Szilard's openMP cleanup of gmx_hbond.c:
Erik Marklund [Thu, 28 Jun 2012 19:02:00 +0000 (21:02 +0200)]
Finalized and extended Szilard's openMP cleanup of gmx_hbond.c:

* Changed HAVE_OPENMP into GMX_OPENMP
* Fixed incorrect use of OpenMP API functions
* Made variables shared by default in parallel sections
  This also avoids problems with stderr being a macro in certain
  implementations, which caused compilation errors on some systems
  when stderr occurs explicitly in pragmas.
* Protected a block where reallocation of hbdata occurs with a critical section
* Cleaned out some output that was commented out anyway.
* Removed redundant preprocessor directives

Change-Id: I452ab2e873434086e6bc616d9d24a8d890147220

11 years agoMerge "Add FindGROMACS.cmake to template's CMakeLists.txt" into release-4-6
Roland Schulz [Wed, 4 Jul 2012 05:18:46 +0000 (07:18 +0200)]
Merge "Add FindGROMACS.cmake to template's CMakeLists.txt" into release-4-6

11 years agoMerge "Fixed bug in free energy calculation for Morse potentials" into release-4-6
Roland Schulz [Wed, 4 Jul 2012 05:16:56 +0000 (07:16 +0200)]
Merge "Fixed bug in free energy calculation for Morse potentials" into release-4-6

11 years agoRemove unused FFT functions
Roland Schulz [Tue, 5 Jun 2012 03:36:01 +0000 (23:36 -0400)]
Remove unused FFT functions

Change-Id: Ic3fd21579f6dcf7e57084c5a9beed4637a8cae6a

11 years agoFix most doxygen warnings.
Teemu Murtola [Fri, 29 Jun 2012 12:07:49 +0000 (15:07 +0300)]
Fix most doxygen warnings.

This makes it much more convenient to work locally with Doxygen.  Even
though Jenkins ignored these warnings, if you ran Doxygen locally, it
produced a long list of warnings in the log file, making it difficult to
spot if new warnings had appeared.

Also improved the Doxygen configuration files to have common settings in
a shared file that is then included from the actual configuration files.

Change-Id: Ic57576e2cb89f6d0e5929981553b48a61435c26c

11 years agoFixes for FFT libraries
Roland Schulz [Mon, 4 Jun 2012 15:56:42 +0000 (11:56 -0400)]
Fixes for FFT libraries

- Updated documentation
- Added gmx_fft_cleanup for any cleanup after using FFT
    (removing memory leak otherwise caused by FFTW)
- Replaced TMPI_THREAD_MUTEX_INITIALIZER with tMPI::mutex
    (otherwise tmpi leaks memory)

Change-Id: If3e9012da14ebf74d87d4d4647c2f17bd8380fc1

11 years agoset default for rcoulomb, rvdw and rlist to -1
Berk Hess [Mon, 2 Jul 2012 17:08:41 +0000 (19:08 +0200)]
set default for rcoulomb, rvdw and rlist to -1

To avoid users using the default values and to force them to think
about the cut-offs, all default values are now -1.
This also avoids grompp notes with the new Verlet scheme,
where the rlist value can be generated automatically.

Change-Id: I99bc7eee76953d06767f9c9916d1c9289badf74f

11 years agoImprove ProgramInfo and use it everywhere.
Teemu Murtola [Mon, 4 Jun 2012 09:03:50 +0000 (12:03 +0300)]
Improve ProgramInfo and use it everywhere.

- The ProgramInfo class now stores the full command line.
  Moved functionality to add quotes to arguments with spaces from
  gmx::test::CommandLine to ProgramInfo.
- ProgramInfo initialization is now protected by a mutex for
  completeness.
- oenv.c and statutil.c now use ProgramInfo internally to store/return
  the binary name and command line.  Removes duplicate implementations
  of this functionality.  Required changing the return values of
  ProgramInfo methods from std::string values to const references.
- Removed many unnecessary #include directives from these two files.
- Fixed warnings that were produced from these files when switching them
  to C++ compilation (one cppcheck warning suppressed for now).
- Add a temporary hack for Windows to try to make get_libdir() work for
  tests that are run through CTest.

Helps with #950.

Change-Id: I1bfd4231b8b7055d0a014b41be67a7c1c99e36b0

11 years agoError/exception handling improvements.
Teemu Murtola [Mon, 4 Jun 2012 05:10:09 +0000 (08:10 +0300)]
Error/exception handling improvements.

- Change formatErrorMessage() to printFatalErrorMessage() that directly
  prints the error message for an exception into a FILE (typically
  stderr) instead of creating a std::string.  This makes it possible to
  handle out-of-memory errors internally within the function.
  The function is much easier to use if we can guarantee that it never
  throws.
- Add basic handling of std::bad_alloc into the above function.
- Resolve clang warnings in the function.
- Add a macro for conveniently catching all exceptions at C++ - C
  boundary and reporting them as fatal errors.
- Initialize ProgramInfo in all C++ binaries.

Related to #838.

Change-Id: I77c355480485f563c57b6c6ea9b07a8ce7f433a8

11 years agoAlways build thread_mpi threading into libgromacs.
Teemu Murtola [Mon, 4 Jun 2012 10:18:04 +0000 (13:18 +0300)]
Always build thread_mpi threading into libgromacs.

This allows using basic thread synchronization primitives without
conditional compilation.
Adjusted the build system to build only the basic thread synchronization
files instead of full thread_mpi if GMX_THREAD_MPI is off.
This required splitting tMPI_Malloc and friends from tmpi_init.c into a
separate file (since tmpi_init.c depends on most other files), and also
moving TMPI_COMM_WORLD to the new file.
Also removed a few unused variables from atomic.h to avoid cppcheck
warnings.

Part of #948.

Change-Id: I3c6bd2cf084acd4a4e881b99a07bc3a4c878727e

11 years agoMerge "Minor formatting and consistency changes to txtdump.c" into release-4-6
Szilárd Páll [Tue, 3 Jul 2012 09:35:35 +0000 (11:35 +0200)]
Merge "Minor formatting and consistency changes to txtdump.c" into release-4-6

11 years agoDo not print disabled pressures and virials
Christoph Junghans [Mon, 2 Jul 2012 20:20:10 +0000 (14:20 -0600)]
Do not print disabled pressures and virials

* For some methods pressure and virial calculation is disabled
* md.bVir and md.bPress was added in
d870cd31bee97e277f48ba982da85303bce98611
* At this point only AdResS has md.bVir=md.bPress=FALSE

Change-Id: I6abe24a5c286d20dcf554831ade9540674df9d77

11 years agoFixed bug in free energy calculation for Morse potentials
David van der Spoel [Sat, 30 Jun 2012 13:18:31 +0000 (15:18 +0200)]
Fixed bug in free energy calculation for Morse potentials

Introduced recently when FEP was added to the Morse potential.

Change-Id: I90edfd13835637c872af31f2c7abf900ce8a8e5f

11 years agoAdd FindGROMACS.cmake to template's CMakeLists.txt
Christoph Junghans [Fri, 29 Jun 2012 20:18:17 +0000 (14:18 -0600)]
Add FindGROMACS.cmake to template's CMakeLists.txt

Change-Id: Id5adec8aa057f1d56021b06aaedd35dab108ead7

11 years agoMinor formatting and consistency changes to txtdump.c
Michael Shirts [Fri, 29 Jun 2012 17:35:59 +0000 (11:35 -0600)]
Minor formatting and consistency changes to txtdump.c

Change-Id: I2992a927ccf49b407fa985eb2283c37818bbd2a5

11 years agoCorrected checkpoint version issues with free energy changes.
Michael Shirts [Fri, 29 Jun 2012 17:28:37 +0000 (11:28 -0600)]
Corrected checkpoint version issues with free energy changes.

Change-Id: If9494aa0bdbd6f83cc2a8a57a5c7e399aaa787f4

11 years agoMerge "Fixed adress kernel for double precision" into release-4-6
Sebastian Fritsch [Fri, 29 Jun 2012 10:05:18 +0000 (12:05 +0200)]
Merge "Fixed adress kernel for double precision" into release-4-6

11 years agoFixed adress kernel for double precision
Christoph Junghans [Thu, 28 Jun 2012 17:27:58 +0000 (11:27 -0600)]
Fixed adress kernel for double precision

Change-Id: I5145ced14d59f7186dd8ef47fe6877fe00cbd94b

11 years agoAllow also FindMPI for cmake<2.8.5
Roland Schulz [Thu, 28 Jun 2012 16:29:02 +0000 (12:29 -0400)]
Allow also FindMPI for cmake<2.8.5

Using FindMPI instead of mpi-wrapper makes it easier to compile
with CUDA. While FindMPI of cmake<2.8.5 is unreliable it depends
on the OS whether it works. With this change FindMPI is attemted
if no mpi wrapper is used and if it fails, mpi-wrapper or cmake
upgrade is recommended.

Change-Id: I20c0ac3958724feecaaef5c20279d340ecca4b1a

11 years agoMerge "Fix MPI build for MPI library without mpi wrapper" into release-4-6
Christoph Junghans [Thu, 28 Jun 2012 16:22:44 +0000 (18:22 +0200)]
Merge "Fix MPI build for MPI library without mpi wrapper" into release-4-6

11 years agoRemove more underscore-prefixed C++ symbols.
Teemu Murtola [Thu, 28 Jun 2012 04:34:52 +0000 (07:34 +0300)]
Remove more underscore-prefixed C++ symbols.

More of the same as in e39fb5f (I7f4bf42e), no manual editing this time.
Now only trajectoryanalysis/modules/ contains these, will change that
separately as doing it here would create conflicts with I67e123f8.

Change-Id: Ic730a5f906b365212cd20da7b27d9c7b79316053

11 years agoFix MPI build for MPI library without mpi wrapper
Roland Schulz [Wed, 27 Jun 2012 07:31:12 +0000 (03:31 -0400)]
Fix MPI build for MPI library without mpi wrapper

Some MPI library (e.g. MPICH and OpenMPI on Windows) don't
contain any MPI wrappers and thus 417d0afff broke the support for
those MPI libraries.

This change uses the FindMPI module if the compiler is not a
mpi wrapper and cmake >= 2.8.5. Requiring mpi wrappers for
cmake < 2.8.5 avoids reintroducing the problems of #851.

To avoid any confusion of different behavior with older and newer
versions of cmake, all documentation should recommend the mpi wrapper
approach, which works for all versions. The FindMPI approach should
only be discussed for advanced users (to support e.g. Windows).

As a side effect this change makes it more convinient to use with
cmake>=2.8.5. No need to speciy mpi wrapper and less problems with
nvcc.

Fixes #958

Change-Id: Ic53d8125c5a58edc6789fe16f2b710e7e2568d4f

11 years agofixes typo gmx_omp introduced by 697bcdc
Szilard Pall [Tue, 26 Jun 2012 11:30:59 +0000 (13:30 +0200)]
fixes typo gmx_omp introduced by 697bcdc

Also removes an unnecessary include and replaces a few remaining
HAVE_OPENMP-s with GMX_OPENMP.

Change-Id: I8a92a5f1849d170951719b29b17e0ec6134ee556

11 years agoMerge "Make C++11 test quiet after the first cmake run."
Christoph Junghans [Wed, 27 Jun 2012 16:27:14 +0000 (18:27 +0200)]
Merge "Make C++11 test quiet after the first cmake run."

11 years agoMerge "Use VERSION_LESS in the version detection code."
Christoph Junghans [Wed, 27 Jun 2012 16:13:45 +0000 (18:13 +0200)]
Merge "Use VERSION_LESS in the version detection code."

11 years agoUse VERSION_LESS in the version detection code.
Teemu Murtola [Wed, 27 Jun 2012 05:44:24 +0000 (08:44 +0300)]
Use VERSION_LESS in the version detection code.

There was a comment in the cmake script that suggested this, and it is
already used elsewhere in the cmake code.

Change-Id: Ic63c52510d37b864f2f39c8bc2f3806783405cc2

11 years agoFix for boost version check added by 6b4c9bc
Roland Schulz [Tue, 26 Jun 2012 20:40:01 +0000 (16:40 -0400)]
Fix for boost version check added by 6b4c9bc

Change-Id: I96fdece894d0e0c767aee156f5e00016bf14a0e1

11 years agoUpdate CPack package version.
Teemu Murtola [Tue, 26 Jun 2012 19:27:58 +0000 (22:27 +0300)]
Update CPack package version.

Updated also the CPack package version to 5.0.

Change-Id: I7ba4af3fb697527e5007c5bc09df8543e5f371d5

11 years agoMake C++11 test quiet after the first cmake run.
Teemu Murtola [Tue, 26 Jun 2012 19:46:44 +0000 (22:46 +0300)]
Make C++11 test quiet after the first cmake run.

Change-Id: I08b03aad4980d748d67acc6cc48150afea6f6deb

11 years agoMerge "Make sure that found Boost version is new enough"
Roland Schulz [Tue, 26 Jun 2012 19:35:32 +0000 (21:35 +0200)]
Merge "Make sure that found Boost version is new enough"

11 years agoFix that rerunning cmake gives the same result as 1st run
Roland Schulz [Tue, 26 Jun 2012 18:50:55 +0000 (14:50 -0400)]
Fix that rerunning cmake gives the same result as 1st run

- SetBuildInformation: strip was missing for 3 of 6 CPU_* variables
  Not sure why this caused only for the first run an extra newline.
  Extra newline doesn't change the build but causes unnessray
  complete rebuild.
- IsFinite: The cached value of whether one of the 3 isfinite
  function was found wasn't set the 2nd time. Thus after reruninng
  cmake the isfinite function wasn't used anymore.

Change-Id: I988763e6b26cc5bae62c4da66cc7b30f2f93c128

11 years agoMerge "Merge remote-tracking branch 'origin/release-4-6'"
Teemu Murtola [Tue, 26 Jun 2012 13:47:13 +0000 (15:47 +0200)]
Merge "Merge remote-tracking branch 'origin/release-4-6'"

11 years agoMake sure that found Boost version is new enough
Roland Schulz [Mon, 25 Jun 2012 21:57:39 +0000 (17:57 -0400)]
Make sure that found Boost version is new enough

FindBoost only checks the first time cmake is run that the
available boost version is at least the required boost version.
If Boost_INCLUDE_DIR is already set from a prior cmake run,
the version isn't checked again. And thus it tries to use the
older external version.

Change-Id: I9897b49c895bb0263d7013b74afb54b921d077d6

11 years agoMerge "Fix gmx_fatal for serial compilation" into release-4-6
Roland Schulz [Tue, 26 Jun 2012 01:32:58 +0000 (03:32 +0200)]
Merge "Fix gmx_fatal for serial compilation" into release-4-6

11 years agoMerge "Merge remote-tracking branch 'gerrit/release-4-6'"
Christoph Junghans [Tue, 26 Jun 2012 00:08:14 +0000 (02:08 +0200)]
Merge "Merge remote-tracking branch 'gerrit/release-4-6'"

11 years agointroduce gmx_omp wrapper for the OpenMP API
Szilard Pall [Fri, 15 Jun 2012 15:03:41 +0000 (17:03 +0200)]
introduce gmx_omp wrapper for the OpenMP API

The gmx_omp_* OpenMP API wrappers should be used instead of directly
calling OpenMP functions. Therefore, gmx_omp.h should be included
instead of omp.h so OpenMP API functions don't need #ifdef-ing.

Additionally, moved GMX_OPENMP from command-line define to config.h.

Change-Id: If30f433946fef908c26a29f1bff3671580e90629

11 years agoadded check for log fp!=NULL when disabling acceleration
Berk Hess [Mon, 25 Jun 2012 08:03:11 +0000 (10:03 +0200)]
added check for log fp!=NULL when disabling acceleration

Change-Id: I79d16574b6c4cb039afa01240e7d3aa816b3f337

11 years agoMerge "Remove MPI define for FAH" into release-4-6
Christoph Junghans [Sun, 24 Jun 2012 20:26:37 +0000 (22:26 +0200)]
Merge "Remove MPI define for FAH" into release-4-6

11 years agoMerge remote-tracking branch 'origin/release-4-6'
Roland Schulz [Sun, 24 Jun 2012 17:35:21 +0000 (13:35 -0400)]
Merge remote-tracking branch 'origin/release-4-6'

Change-Id: I0c181ad8eb86d0cd130ea27b0cd896f5db581ab5

11 years agoMerge "Fix mdp_opt formatting of expanded ensemble" into release-4-6
Michael Shirts [Sun, 24 Jun 2012 17:27:15 +0000 (19:27 +0200)]
Merge "Fix mdp_opt formatting of expanded ensemble" into release-4-6

11 years agoMerge remote-tracking branch 'gerrit/release-4-6'
Teemu Murtola [Sun, 24 Jun 2012 17:00:12 +0000 (13:00 -0400)]
Merge remote-tracking branch 'gerrit/release-4-6'

Moved files added to include/ to src/gromacs/legacyheaders/ and
files added to src/gmxlib/ to src/gromacs/gmxlib/.

Conflicts:
    CMakeLists.txt
    src/config.h.cmakein

Conflicts for files removed from master:
    cmake/gmxTestInlineASM.cmake (resurrected)
    cmake/TestInlineASM_gcc_x86.c (no conflict, resurrected)
    src/gmxlib/CMakeLists.txt
        (changes applied to src/gromacs/CMakeLists.txt and
        src/gromacs/gmxlib/CMakeLists.txt)

Conflicts for files removed from release-4-6:
    src/gromacs/gmxlib/nonbonded/nb_kernel_ia32_sse/*
    src/gromacs/gmxlib/nonbonded/nb_kernel_ia32_sse2/*
    src/gromacs/gmxlib/nonbonded/nb_kernel_ia64_double/*
    src/gromacs/gmxlib/nonbonded/nb_kernel_ia64_single/*
    src/gromacs/gmxlib/nonbonded/nb_kernel_ppc_altivec/*
    src/gromacs/gmxlib/nonbonded/nb_kernel_x86_64_sse/*
    src/gromacs/gmxlib/nonbonded/nb_kernel_x86_64_sse2/*
    src/gromacs/legacyheaders/gmx_sse2_double.h
    src/gromacs/legacyheaders/gmx_sse2_single.h

Change-Id: I6202a89a802a8fd3e1788df95eac408cf60f3456

11 years agoFix mdp_opt formatting of expanded ensemble
Roland Schulz [Sun, 24 Jun 2012 15:07:04 +0000 (11:07 -0400)]
Fix mdp_opt formatting of expanded ensemble

Was introduced with c7a82654f2e. Broke the build of the manual
because dl tag wasn't closed.

Change-Id: I86afd4a2bdc638fb910cb0afa827b3f56447bb36

11 years agoRemove MPI define for FAH
Roland Schulz [Sun, 24 Jun 2012 05:11:58 +0000 (01:11 -0400)]
Remove MPI define for FAH

FAH will use with 4.6 the standard GMX_MPI define instead of MPI.
This removes problems with C++ compile.

This fixes #849 and is related to #853.

Change-Id: I63bfc14400cda096350aba9a94a676e9c0952d56

11 years agoFix illegal usage of MPI_Comm_create
Roland Schulz [Thu, 21 Jun 2012 16:28:36 +0000 (12:28 -0400)]
Fix illegal usage of MPI_Comm_create

Bug was introduced by 8cd25f0d45567
Illegal to call MPI_Comm_create with different group arguments

Change-Id: Ia70f81862fa50b03ab127e8796226369f6732942

11 years agoMerge "Simple patch for openmm_wrapper.cpp" into release-4-6
Christoph Junghans [Fri, 22 Jun 2012 21:04:20 +0000 (23:04 +0200)]
Merge "Simple patch for openmm_wrapper.cpp" into release-4-6

11 years agoIncrease coverate of selection unit tests.
Teemu Murtola [Fri, 22 Jun 2012 06:25:59 +0000 (09:25 +0300)]
Increase coverate of selection unit tests.

Add some tests and adjust existing tests to cover parts of the selection
compiler and evaluation functions that the coverage run showed as not
covered.
Fixed one issue found (can be backported to 4.5 if necessary).

Part of #651.

Change-Id: If92b5b1eb8cf6b3acb510ba43f64fc82b63ab82a

11 years agoFixed gcc inline assembly issue with PIC and older gcc compilers
Erik Lindahl [Thu, 21 Jun 2012 09:38:12 +0000 (11:38 +0200)]
Fixed gcc inline assembly issue with PIC and older gcc compilers

Some gcc versions had problems with the recently introduced inline
assembly for cpuid (clobbering of ebx register), and since we used
a slightly different inline assembly instruction test in cmake we
did not detect it properly. This patch both makes the inline asm
itself much more portable, and we also test with exactly the same
instruction in cmake so we don't set the flag for supporting inline
asm unless we know this instruction works.

Change-Id: Ib479e2706024abb5e3f66d0249291ce55f1257b1

11 years agoMake the selection parser exception-proof.
Teemu Murtola [Wed, 20 Jun 2012 03:47:36 +0000 (06:47 +0300)]
Make the selection parser exception-proof.

The parser now catches and stores any exception that occurs during
parsing, terminates the parser cleanly, and rethrows the exception.

The functions called from the parser are still not exception-safe, and
would require quite some work to make so, because they are code written
originally in C and do a lot of dynamic memory allocation, returning
some of the allocated memory to the caller.  But the generated code
should now work with exceptions.

Fixes #880.

Change-Id: I2d534d106a6fe20d949b3f24b0d7f9980c545fcf

11 years agoUse push parser for selection parsing.
Teemu Murtola [Thu, 14 Jun 2012 04:27:29 +0000 (07:27 +0300)]
Use push parser for selection parsing.

The push parser is new in Bison 2.4 (current parser.cpp files generated
with 2.5), and has two benefits in our case:
- Clearer control flow, since the interactive prompt loop is now outside
  the parser, so it doesn't need to behave like a state machine.
- Allows better exception handling: since it is possible to directly
  return from Flex actions, we should also be able to throw exceptions.
  But without this change, they would go through the generated part of
  the Bison parser, causing memory leaks since the code is generated for
  C.  With this change, the Flex scanner is called directly from C++
  code, eliminating this problem.

Since the Bison and Flex parsers are now decoupled, it should also be
possible to clarify the code further, by having a separate data
structure for parser-specific data instead of using yyscan_t.  For now,
kept the changes to a minimum.

Related to #880.

Change-Id: I43ea11561d3dd0577dd95eae3794ca621953d038

11 years agoAdd string utility functions for suffix handling.
Teemu Murtola [Thu, 14 Jun 2012 04:27:13 +0000 (07:27 +0300)]
Add string utility functions for suffix handling.

Added endsWith() and stripSuffixIfPresent() functions to stringutil.h.
Allows for much clearer and easier-to-write string manipulation code
where this kind of functionality is needed.

Change-Id: I853234ce3d8a11b88ee50225a66e061302e10de7

11 years agoRename format.h to more generic stringutil.h.
Teemu Murtola [Sat, 16 Jun 2012 05:04:49 +0000 (08:04 +0300)]
Rename format.h to more generic stringutil.h.

There were already some string helper functions not directly related to
formatting, and this header is a natural place to add more of such
things.

Change-Id: I46f7bd46393d27e49d46589b8d7b5c2362bcdc8c

11 years agoClean up option and selection flags.
Teemu Murtola [Sat, 9 Jun 2012 11:09:37 +0000 (14:09 +0300)]
Clean up option and selection flags.

Rename the enums used for flags such that they are more likely unique.
Also a bit of other clean-up to limit the use of the option flags more
into the generic parts.  Removed a few unnecessary flags.  Made
efClearOnNextSet work more correctly for classes that don't use
OptionStorageTemplate, although currently it didn't cause any issues
(noticed some issues while developing SelectionFileOption, but the final
version worked without these fixes).

Change-Id: I78c243c4f73b87b285eb54d6ff3ae42699678962

11 years agoRemove (part of) underscore-prefixed C++ symbols.
Teemu Murtola [Sat, 9 Jun 2012 05:27:03 +0000 (08:27 +0300)]
Remove (part of) underscore-prefixed C++ symbols.

This commit is mostly the result of (using GNU sed syntax)
  sed -i -re 's/\<_([a-zA-Z]+)\>/\1_/g'
on the affected files. Some additional manual renaming was done.
optionsassigner.cpp was manually edited a bit more to update comments
and to remove unnecessary use of bit flags.
Also added a few 'explicit' keywords to constructors.

selection/ and trajectoryanalysis/ directories still contain a lot of
these, but this commit is large enough as it stands.

Change-Id: I7f4bf42ec5d9d762fefcff289e38b6b6b231b82b

11 years agoFix gmx_fatal for serial compilation
Roland Schulz [Thu, 14 Jun 2012 23:16:06 +0000 (19:16 -0400)]
Fix gmx_fatal for serial compilation

With neither GMX_MPI nor GMX_THREAD_MPI gmx_fatal
called gmx_abort which called gmx_fatal.

Change-Id: Id18c3bc94f19a8008fa2aaa8335c221f115fcd8b

11 years agogmx_dyecoupl: check selected groups from user
Martin Hoefling [Wed, 13 Jun 2012 12:29:24 +0000 (14:29 +0200)]
gmx_dyecoupl: check selected groups from user

check if the user accidentally selected the same group twice. Abort
with error, since this will not produce any meaningful results.

Change-Id: Iace69c473e5f1b815e35d20a39845533297ad208

11 years agoNew CPU detection & AVX/SSE code, removed raw assembly files.
Erik Lindahl [Mon, 28 May 2012 18:54:17 +0000 (20:54 +0200)]
New CPU detection & AVX/SSE code, removed raw assembly files.

Removed all raw assembly files and deprecated altivec support.
Removed support for NASM and other assemblers, and replaced
previous SSE detection code with a new module using CPUID instead.
Added detection for SSE2, SSE4.1, AVX 128-bit with FMA, and AVX 256-bit.
Added Cmake detection of build platform based on CPUID, and output this
to the log file. The executables now compare the compile-time platform
and selected acceleration with the run-time platform and most suitable
acceleration and warns the user if they do not match. The compiler
detection code has also been reordered slightly to produce more readable
warnings when OpenMP is not available, and correctly disable pragma
warnings.

Added intrinsics code and math functions for SSE2, SSE4.1, AVX128/256
both in single and double precision. All math functions and permutation
code have been tested & verified. Single precision math functions are
correct apart from the least significant bit, and double precision has
roughly twice the accuracy.

This has forced me to temporarily disable the SSE & Fortran acceleration.
SSE will be added back soon based on new intrinsics-only kernels currently
in testing, and we will test if Fortran still makes sense then.

Finally, the patch includes a modification to gmx_rmsdist where
a regression issue was introduced recently by using sqrtf() for
the norm function. This caused the intel compiler to produce slightly
different results at high optimization leves, which got evident here.

Closes #926 - Raw assembly code has been removed.
Refs #923 - Old kernels removed, new will be added shortly.
Fixes #914 - Cmake now does architecture-speficic optimization.
Fixes #912, #913
Fixes #857 - We detect rdtscp support with CPUID and use it if possible.
Fixes #750
Closes #537, #574 - Altivec is now deprecated.

Change-Id: Icfca5a940762f8d82ae67b59c65b2d2ac683256d

11 years agoRemove unnecessary "move" on shared pointer
John Eblen [Fri, 15 Jun 2012 21:45:02 +0000 (17:45 -0400)]
Remove unnecessary "move" on shared pointer

Change-Id: I79d2d01307c014f4d40cfffc9dbd04067ed4f0fc

11 years agoSimple patch for openmm_wrapper.cpp
Justin Lemkul [Thu, 7 Jun 2012 00:11:26 +0000 (20:11 -0400)]
Simple patch for openmm_wrapper.cpp

The naming of several variables is changed to be consistent with the
latest free energy changes.  Allows mdrun-gpu to be compiled, which
otherwise fails (as reported on gmx-developers).

Change-Id: I497ba07ee6883ef78d23022450f6c3d971b2127e

11 years agoMerge "Remove unnecessary *-impl.h files."
Christoph Junghans [Fri, 15 Jun 2012 00:29:18 +0000 (02:29 +0200)]
Merge "Remove unnecessary *-impl.h files."

11 years agoUpdates to selection online help.
Teemu Murtola [Fri, 8 Jun 2012 15:44:56 +0000 (18:44 +0300)]
Updates to selection online help.

Some of the help topics were outdated after changes introduced by the
linked Redmine issues (some of them even before that).  Improved the
situation a bit and also did some misc. other documentation fixes.

Related to #656 and #666.

Change-Id: I7f18ca4ad8ce2aa5cd808281bab044253ca77f56

11 years agoRemove unnecessary *-impl.h files.
Teemu Murtola [Thu, 31 May 2012 09:34:02 +0000 (12:34 +0300)]
Remove unnecessary *-impl.h files.

Originally, I put all class declarations in headers, but for private
implementation classes used only from one source file, it just leads to
additional maintenance without much benefit.  Moved such class
declarations to the source files (quite a few private implementation
classes are already declared in the source files).

Removed some unnecessary destructors, and had to adjust some includes,
otherwise this change just copy-pastes code around.

Change-Id: Icfb30f88f593806971746d14e3fc0d9b5e7caa96

11 years agoMerge "Merge branch 'release-4-6'"
Christoph Junghans [Wed, 13 Jun 2012 21:17:35 +0000 (23:17 +0200)]
Merge "Merge branch 'release-4-6'"

11 years agoRenamed TestTemporaryFileManager to TestFileManager
Roland Schulz [Tue, 5 Jun 2012 20:55:36 +0000 (16:55 -0400)]
Renamed TestTemporaryFileManager to TestFileManager

Made utility functions static members of class

Change-Id: I706a9c4b5d6e8fe4f121d1e50d229b03f492e49d

11 years agoTestutils improvements for arrays and parameterized tests
Roland Schulz [Mon, 4 Jun 2012 15:48:58 +0000 (11:48 -0400)]
Testutils improvements for arrays and parameterized tests

- For parameterized tests replace / with _ to have all refdata
  xml files in one folder
- Print index in sequence in error message for value/refValue
  mismatch

Change-Id: Ic593b87f9c1e4cf2ea049044e48a705eca0aa839

12 years agoMerge branch 'release-4-6'
Roland Schulz [Wed, 6 Jun 2012 12:13:00 +0000 (08:13 -0400)]
Merge branch 'release-4-6'

Conflicts:
src/gromacs/gmxlib/dihres.c
src/gromacs/legacyheaders/dihre.h
src/gromacs/mdlib/force.c
src/gromacs/mdlib/mdebin.c
src/gromacs/mdlib/sim_util.c
src/programs/mdrun/md.c

Change-Id: I0c5e6d8e57f9f19da73a81737c3105dcd55488ec
Moved:
     src/mdlib/expanded.c ->
       src/gromacs/mdlib/expanded.c

12 years agoMerging in free energy, exp. ensemble, & andersen t-control to 4.6
Michael Shirts [Tue, 17 Jan 2012 14:51:13 +0000 (09:51 -0500)]
Merging in free energy, exp. ensemble, & andersen t-control to 4.6

Conflicts:
src/gmxlib/mvdata.c
src/gmxlib/txtdump.c
src/kernel/readir.c
src/mdlib/sim_util.c
src/tools/gmx_membed.c
include/mdrun.h
src/kernel/md.c
src/kernel/md_openmm.c
src/kernel/md_openmm.h
src/kernel/runner.c
src/mdlib/minimize.c
src/mdlib/tpi.c
src/tools/gmx_membed.c
src/kernel/md.c

Change-Id: Ide69a8dbfb96072d5c55d0a051dc9db788cbe144

12 years agoMerge release-4-6 into master
Roland Schulz [Sun, 3 Jun 2012 15:45:26 +0000 (11:45 -0400)]
Merge release-4-6 into master

Conflicts:
src/mdlib/CMakeLists.txt
          change applied to src/gromacs/mdlib/CMakeLists.txt
src/tools/gmx_tune_pme.c
  trivial conflict

Moved:
src/mdlib/fftpack.c & src/mdlib/fftpack.h to src/external/fftpack

Fixed paths in COPYING-OTHER and added boost and gtest/gmock.

Moved the copyright header and list of modifications from fftpack.c into
new README file. Reduces modifications to original file.

Fixed header location in src/gromacs/mdlib/gmx_fft_fftpack.c.

Added macros.h to g_tune_pme (fixing missing min/max)

Change-Id: I9324b1695412e21d16bdcb4d2dc316c53356da5f

12 years agothread_mpi C++11 compatible mutex classes
Sander Pronk [Thu, 31 May 2012 09:58:21 +0000 (11:58 +0200)]
thread_mpi C++11 compatible mutex classes

This brings the master branch thread_mpi up to date, and introduces
a C++11 compatible API for mutexes and lock_guards (found in
thread_mpi/mutex.h).

Partially fixes http://redmine.gromacs.org/issues/948

Change-Id: Ibce48ae10e84bedee9fe641b94a21f6674efcd6b

12 years agoMerge release-4-5-patches into release-4-6
Roland Schulz [Fri, 1 Jun 2012 06:24:10 +0000 (02:24 -0400)]
Merge release-4-5-patches into release-4-6

Changes in 4.5 for removed lines/files in 4.6:
Makefile.am
include/domdec.h
include/domdec_network.h

Trivial conflict:
include/types/commrec.h

Fixed GMX_THREADS into GMX_THREAD_MPI for those added in 4.5 in:
        include/mdrun.h
        src/gmxlib/shift_util.c
        src/mdlib/gmx_fft_fftw3.c

Change-Id: Id37bfbbacc945a7cf184fa21313c05e2680e1fba

12 years agoMerge "Use External BLAS/LAPACK by default" into release-4-6
Christoph Junghans [Fri, 1 Jun 2012 06:04:28 +0000 (08:04 +0200)]
Merge "Use External BLAS/LAPACK by default" into release-4-6

12 years agoMerge "Replace our fftpack version with Numpy's version" into release-4-5-patches
Christoph Junghans [Fri, 1 Jun 2012 05:35:50 +0000 (07:35 +0200)]
Merge "Replace our fftpack version with Numpy's version" into release-4-5-patches

12 years agoReplace our fftpack version with Numpy's version
Roland Schulz [Sun, 27 May 2012 18:07:30 +0000 (14:07 -0400)]
Replace our fftpack version with Numpy's version

Fixes incorrect results for vectors with length of multiples of 12

Fixes #946

Change-Id: I9a110de7334cbb96a72d0ced73ade4d55f665fee

12 years agoMore config.h cleanup.
Teemu Murtola [Thu, 31 May 2012 05:01:18 +0000 (08:01 +0300)]
More config.h cleanup.

Remove defines from config.h for standard types:
 - gid_t, never used.
 - uid_t, added an ifdef around the single use, should always be present
   if getuid() is.
 - off_t, was only used if HAVE_FSEEKO was set.

Also removed the code to check these types from CMake, as well as the
detection code for size_t (define already removed in Icc5bba87).

Change-Id: I2835b0bc0a524a30464230d65a2d873b611ed350

12 years agoMake get_libdir() robust when run from build tree.
Teemu Murtola [Wed, 30 May 2012 09:45:38 +0000 (12:45 +0300)]
Make get_libdir() robust when run from build tree.

get_libdir() now uses the share/top/ directory in the original source
tree if the binary is run from the build tree.  Makes it easier to run
tests.  GMXLIB environment variable can still override this detection.

Change-Id: I74a5d3ba5ff02d68e35ab169b5466d411bad2ae1

12 years agoFix use after free in g_anaeig projection code.
Teemu Murtola [Wed, 30 May 2012 04:18:10 +0000 (07:18 +0300)]
Fix use after free in g_anaeig projection code.

PBC removal structure was deleted immediately after it was initialized,
and used afterwards.

Change-Id: I6126967b34e8de289370dede79cc50a9924ac34d

12 years agoFixed some memory leaks.
Teemu Murtola [Wed, 30 May 2012 04:08:06 +0000 (07:08 +0300)]
Fixed some memory leaks.

- gmx_rmpbc_done() is now symmetric to gmx_rmpbc_init() in that it frees
  also the gmx_rmpbc_t pointer.
- gmx_fio_fclose() frees the memory for the removed t_fileio structure.
- gmxfio functions free t_fileio::fn when they free the structure.

Change-Id: I0d2d667d915109f8a2670aea21326d714ae25adb

12 years agoRemoved dependency on windows.h through commrec.h, domdec.h.
Sander Pronk [Tue, 22 May 2012 15:46:37 +0000 (17:46 +0200)]
Removed dependency on windows.h through commrec.h, domdec.h.

Change-Id: If40506b521a4b4690506465a3f421dab93bc9ce6

12 years agoMerge "Revised g_tune_pme" into release-4-6
Christoph Junghans [Tue, 29 May 2012 16:26:52 +0000 (18:26 +0200)]
Merge "Revised g_tune_pme" into release-4-6

12 years agoImprove 'g_ana help'.
Teemu Murtola [Wed, 16 May 2012 06:51:50 +0000 (09:51 +0300)]
Improve 'g_ana help'.

- 'g_ana help' now internally uses the new online help classes.
  Without any additional arguments, it still prints out the list of
  commands, and now also list of additional help topics.
- 'g_ana help <command>' prints help for the given command (the same as
  'g_ana <command> -h' for the trajectory analysis modules).
- 'g_ana help selections <subtopic>' can be used to access the general
  help for selections.

IssueID #666.

Change-Id: Id34044842b297591923bef242a93b4ae1ae9e14e

12 years agoGeneric handling of online help topics.
Teemu Murtola [Fri, 11 May 2012 18:08:47 +0000 (21:08 +0300)]
Generic handling of online help topics.

- Added a few simple classes for handling a tree of help topics
  (src/gromacs/onlinehelp/).
- Rewrote the selection help to use the new classes. Required changing
  the help parser slightly to pass all requested help topics in a single
  call to _gmx_sel_handle_help_cmd(). Although this changes the usage of
  the help slightly, did not yet update the help texts.
- Added a way to specify the bison and flex binaries to use for
  regenerate_parser.sh (useful, e.g., if multiple versions are
  installed).

Related to #666.

Change-Id: I318fc0fc42e4af39734a5aa65a503582302ecdd8