alexxy/gromacs.git
10 years agoFirst part of commit for redesigned SIMD module - namechanges.
Erik Lindahl [Fri, 24 Jan 2014 20:04:47 +0000 (21:04 +0100)]
First part of commit for redesigned SIMD module - namechanges.

This patch contains the bulk part of trivial name changes
in preparation for the new SIMD module.
- Add the gmx_simd_ prefix, and _r suffix for real simd data.
  This makes the module more generic, and we separate the
  gromacs SIMD layer from x86 implementation better.
- epi32 (intel name to indicate 64-bit var extended to 128 bits)
  has been changed to int32 in types and defines.
- Negated-fused-multiply-add nomenclature has been changed
  so "-a*b+c" is fnmsub. This is the standard on both Intel
  and AMD, where most people have SIMD coding experience.
  My apologies for first recommending Berk to use the opposite.
- GMX_CPU_ACCELERATION_ strings have been changed to GMX_SIMD_,
  both in the code and in CMake.
- Defines like GMX_X86_SSE2 that indicate instruction set
  availability have received the _OR_HIGHER suffix to clarify
  that those are cumulative in contrast to the SIMD setting,
  which only indicates the highest level. These will be moved
  away from config.h to the simd headers in the next patch.
- GMX_SIMD_WITDH_HERE has been changed to GMX_SIMD_REAL_WIDTH.

Change-Id: I7a2567f7ddaf8ecd95a4f3b1162bbf03342b2b63

10 years agoAdded information about how to cite the TNG paper.
Magnus Lundborg [Thu, 6 Feb 2014 15:13:27 +0000 (16:13 +0100)]
Added information about how to cite the TNG paper.

Change-Id: I698582f296603f741842f99437bcf872a42682d7

10 years agoMoved conditional cmake code for vmdio.
David van der Spoel [Mon, 10 Feb 2014 12:08:24 +0000 (13:08 +0100)]
Moved conditional cmake code for vmdio.

When moving the vmdio.c file to the fileio directory the
corresponding conditional was left in the gmxlib/CMakeLists.txt
file. This is corrected here.

Change-Id: I91a7123aebe639b89a19733ef972699a2c8c9630

10 years agoShell completions through Options
Teemu Murtola [Fri, 7 Feb 2014 18:52:53 +0000 (20:52 +0200)]
Shell completions through Options

- Implement shell completion generation for command line options
  specified through an Options object.
- Use this support to generate the list of options for the wrapper
  binary instead of hardcoding them.
- Use this support and the conversion from t_pargs/t_filenm to Options
  to generate the existing completions.  The only differences in the
  generated completions are in the order of the options and in changing
  "$n == 1" to "$n <= 1" and ".@(xtc|trr|...)" to "@(.xtc|.trr|...)".
- Extend some of the options to expose information necessary for this.

Related to #969 and #1410.

Change-Id: Ib77543367c38803ef186f6024a1af14feb806d80

10 years agoMove orientation restraints checks inside init function
Mark Abraham [Tue, 4 Feb 2014 15:29:15 +0000 (16:29 +0100)]
Move orientation restraints checks inside init function

This removes clutter from runner(), much like init_disre() already
does. Removed duplicate check for the number of orientation restraints
being zero. Removed an unused function parameter.

Change-Id: Icc6a08a2ed4af010e65bfe1f5e49b6c229454df1

10 years agoMake 'gmx -h' invariant wrt. provided options
Teemu Murtola [Fri, 7 Feb 2014 18:38:13 +0000 (20:38 +0200)]
Make 'gmx -h' invariant wrt. provided options

The help output no longer depends on what the user provided on the
command line.  To do this, initialize a separate copy of the options
holder for writing the help.  This decouples the module manager and the
actual help output a bit more.  Make the option holder implementation
shared through cmdlinemodulemanager-impl.h.

Change-Id: I82ea1e969c7d02eadcb2a9f519af30561cb19991

10 years agoRemove old help formatting code
Teemu Murtola [Mon, 23 Dec 2013 18:14:22 +0000 (20:14 +0200)]
Remove old help formatting code

Make parse_common_args() format its help using the new
CommandLineHelpWriter class.  To support this:
 - Add conversion functions that map t_filenm and t_pargs options to
   corresponding Option classes.
 - Add support for arbitrary file types from the filenm.h enum to
   FileNameOption.
 - Add support for writing a list of known issues from
   CommandLineHelpWriter.
 - Some minor extensions to the Option classes to make it easy to do
   the conversion.
 - Fix gmx_hbond to not specify the same option twice.
 - Remove wman.* as unused after the change.

Related to #969.

Change-Id: I25143ddfa4226abd5ae5b95172f69c8fc615b720

10 years agoMake FileNameOption behave more like old filenm parser
Teemu Murtola [Wed, 5 Feb 2014 19:59:17 +0000 (21:59 +0200)]
Make FileNameOption behave more like old filenm parser

If a required file name option is provided without a value, then it is a
no-op.  Previously, FileNameOption raised an exception for such usage.
Add a test to cover this case.

Related to #642.

Change-Id: I89d6cc8ee5d5bf2915bb6841317b402ade00b99b

10 years agoImplement synopsis for help output
Teemu Murtola [Tue, 4 Feb 2014 18:41:19 +0000 (20:41 +0200)]
Implement synopsis for help output

Print all the options into the synopsis, for all the output formats
(console, man pages, and HTML).  Formatting is not the nicest possible,
but surely better than what it was (in wman.cpp, the synopsis is only
printed into the man pages, with no wrapping whatsoever).

Part of #969.

Change-Id: Ic09ac91b3d5b5e2d42d41b83935d54c894eb8e97

10 years agoRefactor new help formatting implementation
Teemu Murtola [Tue, 4 Feb 2014 15:42:39 +0000 (17:42 +0200)]
Refactor new help formatting implementation

- Merge formatFileOption() and formatOption() into one.
- Remove unnecessary generality by splitting description formatting into
  its own class, and make OptionsFilter only do option filtering.  All
  output handling is now in OptionsListFormatter (which was renamed from
  OptionsExportFormatter).
- Split formatting basic option name and value placeholders into a
  separate function.

There should be no functional change.  Preparation for a proper synopsis
implementation.

Part of #969.

Change-Id: I900883eb39853ed67d5f6177ae06847283348d9e

10 years agoClean up .log file dump of inputrec
Mark Abraham [Thu, 6 Feb 2014 06:15:19 +0000 (07:15 +0100)]
Clean up .log file dump of inputrec

New wide name made formatting ugly. Renamed a few things to follow
.mdp convention.

Change-Id: I39550bff607a9ead01d228a7ab297eac1dde2523

10 years agoFix & update docs for GMX_TEST_OPTIONS
Teemu Murtola [Tue, 4 Feb 2014 20:20:18 +0000 (22:20 +0200)]
Fix & update docs for GMX_TEST_OPTIONS

The macro did not appear in Doxygen documentation, because it was
excluded to avoid warnings from undocumented instances of it.  Since
there aren't that many, opted to protect those with \cond instead.  Also
some minor updates and additions to the documentation, and some minor
cleanup of touched code.

Change-Id: I04785e6d66f124ae8ec5dde87bb7c7442230d83a

10 years agoInitialize inputrec better in genbox
Mark Abraham [Thu, 6 Feb 2014 17:23:49 +0000 (18:23 +0100)]
Initialize inputrec better in genbox

Incoming NBNXN patches change the behaviour if you just leave the VDW
modifier set to zero. The modifier is not supposed to be zero, because
grompp is supposed to change eintmodPOTSHIFT_VERLET to something
non-zero, but since we don't have a vanilla constructor for an
inputrec and use it outside grompp, we have a horrible flow-on effect.

So we set both the modifiers explicitly, to avoid these problems.

Change-Id: I2f8381e81104e673fb1a602b2d9cac1ccd81fff0

10 years agoFix build of share/template when installed
Teemu Murtola [Sat, 1 Feb 2014 18:08:09 +0000 (20:08 +0200)]
Fix build of share/template when installed

It is now possible to build the analysis tool template using the
Makefile.pkg and the CMakeLists.txt that are installed with it, at least
under some conditions.  FindGROMACS.cmake could probably be improved
further by using gromacs/version.h to detect the version for those
installations where it is present (4.6 and up); the current list of
functions is confusing (init_domdec_vsites, for example, already appears
in 4.6, but causes the detected version to be set to 5.0), and requires
extra maintenance for each release.

Remove obsolete Template.mak, which was used by autoconf to generate an
installed Makefile.

Change-Id: Ibcaa792b721db7fc9729710e36ace29bddbb82c3

10 years agoEE dhdl header should not specify one lambda
Michael Shirts [Sun, 1 Dec 2013 04:19:34 +0000 (23:19 -0500)]
EE dhdl header should not specify one lambda

The header for dhdl for expanded ensemble should not specify a single
lambda value because the simulation visits many lambdas.  This commit
fixes this problem.

Change-Id: I717203a58657fbce2bf3739c15be5f05a61435bf

10 years agoRemove antiquated and unused gmxpar.tex documentation
Mark Abraham [Wed, 5 Feb 2014 00:46:17 +0000 (01:46 +0100)]
Remove antiquated and unused gmxpar.tex documentation

Change-Id: I7c7637c38063f8d511c575990bf5c5542beaa725

10 years agoUse random seeds by default
Roland Schulz [Tue, 4 Feb 2014 02:26:22 +0000 (21:26 -0500)]
Use random seeds by default

A stocastic simulation not being reproducible by default is less
surprising. It wasn't true that lmc-seed was intialized using
ld-seed.

Change-Id: I5c95f1957b926287c8436d081661cb9d7504ee76

10 years agoUpdate description of genrestr
Mark Abraham [Tue, 4 Feb 2014 14:39:07 +0000 (15:39 +0100)]
Update description of genrestr

Change-Id: Ib5e34a40bee8154dc291121cbefd6cd73c6e1760

10 years agoFix and simplify rpath
Roland Schulz [Mon, 3 Feb 2014 23:19:57 +0000 (18:19 -0500)]
Fix and simplify rpath

- GMXLIB was removed by 0b2344 but forgotten to change for rpath.
- CMAKE_SKIP_BUILD_RPATH and CMAKE_BUILD_WITH_INSTALL_RPATH
  default to false
- No need to relink (CMAKE_BUILD_WITH_INSTALL_RPATH=false) if
  installing in the default lib directory. Saves the relinking
  time and makes rpath work correctly if build folder is moved.
- The extra escaping isn't needed anymore. Tested with 2.8.8,
  2.8.10.2 and 2.8.12.2

Change-Id: I09cf0f9a31c2c891d2aec6ab52dd9cd1d089cb97

10 years agoUse feature to explain that tpbconv has moved
Mark Abraham [Sun, 2 Feb 2014 19:26:19 +0000 (20:26 +0100)]
Use feature to explain that tpbconv has moved

Also replaced generation of the the symlink, which will also trigger
the explanation.

Change-Id: I960713aec5bc511341221cd6d334298a2822c040

10 years agoAdd hack to fix genbox
Mark Abraham [Sat, 1 Feb 2014 20:03:46 +0000 (21:03 +0100)]
Add hack to fix genbox

Using a lighter-weight neighbour search is a better idea, but this bug
needs fixing right now.

Add integration tests for major functionality of genbox. These pass
only with the fix in this patch. These are not the most glorious
tests, but as demonstrated by this bug, "does not segfault in routine
workflows" is useful.

Fixes #1393

Change-Id: I5628f52cd91dcb64d66e690b2e611e524f450972

10 years agoClean up genbox and associated code
Mark Abraham [Sat, 1 Feb 2014 19:12:17 +0000 (20:12 +0100)]
Clean up genbox and associated code

Moved genbox utility to preprocessing module from analysis module.
Renamed its addconf implementation files. Fixed necessary #include
dependencies. Made several functions static.

Renamed gbutil.[ch] to conformation-utilities.[ch], because they are
not exclusive to anything abbreviated "gb." These are mostly used by
gmxpreprocess, but also mdlib/tpi.c, and the header file is not really
useful to install, so the only current place they should move is
gmxlib. Removed unused orient(). Renamed genconf() and gen_box() to
avoid confusion with the utilities of those names. Moved the new
make_new_conformation into genbox.cpp because it is only used there.
Made two functions static. Removed unused (maybe broken?) NTB
parameter of the new make_new_box() function. Removed some debug
code that used a print function in a different compilation unit.

Change-Id: I33d15b2df63c9422ce241782a922145f4626b0fb

10 years agoMerge "Merge release-4-6 into master"
Teemu Murtola [Mon, 3 Feb 2014 04:45:37 +0000 (05:45 +0100)]
Merge "Merge release-4-6 into master"

10 years agoOptimize Doxygen build
Teemu Murtola [Sat, 1 Feb 2014 04:57:34 +0000 (06:57 +0200)]
Optimize Doxygen build

- Don't include verbatim headers in the documentation.  In addition to
  marginally reducing disk usage and processing time, this hides
  undocumented files from the file list, making it look better.
- Generate svg instead of png images. This reduces the disk usage of the
  build output by ~30%.  Change HTML file extension to .xhtml per
  Doxygen documentation to support svg images on IE.
- Add a CMake option GMX_COMPACT_DOXYGEN that disables most
  automatically generated graphs.  Compared to the original
  png-containing build, this reduces the disk usage by ~70%.

Times it takes to generate the documentation are reduced comparably.
Also enable generating multiple DOT graphs in one run, significantly
speeding up the build.  graphviz versions that don't support this are
ancient.

Change-Id: I5dd91779a8086025d9f0c0e477ce300d6a75a580

10 years agoImproved wallcycle reporting
Mark Abraham [Tue, 28 May 2013 10:28:18 +0000 (12:28 +0200)]
Improved wallcycle reporting

Removed reporting of MPI and thread counts on each row, in
favour of a header with that information.

With npme > 0, prints a note that the time column is not
supposed to add up.

Works correctly with a range of -npme, -ntomp and -ntomp_pme values:
PP times add up to the total, which equals the final walltime
reported; cycle count and percentage column totals are correct and
reflect the actual work done.

Partial fix for #1188

Change-Id: Ic870d981bf0375189601bf8c9bc67bc5d6226497

10 years agoMerge release-4-6 into master
Roland Schulz [Sun, 2 Feb 2014 22:30:03 +0000 (17:30 -0500)]
Merge release-4-6 into master

Conflicts (only Copyright header):
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h

Change-Id: I0c9b713d95343c13fa6e3154b8d08a9ca43e7363

10 years agoFix segfault in 'gmx -h'
Teemu Murtola [Sun, 2 Feb 2014 12:22:33 +0000 (14:22 +0200)]
Fix segfault in 'gmx -h'

Combination of two recent changes caused 'gmx -h' to segfault because of
an uninitialized variable.  This fix is in cmdlinehelpcontext.cpp.

Added a test for this case, which required some extra functionality in
the module manager.  This is all the other changes.

Change-Id: Ie845c287975575c51c42763c03ac99bca047699c

10 years agoGet rid of src/programs/gmx/
Teemu Murtola [Sun, 2 Feb 2014 12:19:57 +0000 (14:19 +0200)]
Get rid of src/programs/gmx/

Move the few remaining files from src/programs/gmx/ to src/programs/.
Since we are by default only building a single binary that contains all
the contents of src/programs/, it makes more sense to have the main
routine in src/programs/.

Change-Id: Icef3a539861e3246b469b98e985c514ec87df675

10 years agoSimplify Options::setDescription() usage
Teemu Murtola [Sun, 2 Feb 2014 06:22:52 +0000 (08:22 +0200)]
Simplify Options::setDescription() usage

Remove the need for all tools to call concatenateStrings() to pass the
description to Options::setDescription().  In addition to marginally
simplifying the calling code, this allows more elaborate processing of
the input array to fix issues that there currently are, e.g., with
descriptions that include significant leading spaces in the input
strings.  Not done in this change, though.

Change-Id: Ibe295d5e578222c43f01c1248989d119aa60f0bd

10 years agoExtend valgrind suppressions for OpenMPI
Teemu Murtola [Sun, 2 Feb 2014 12:04:00 +0000 (14:04 +0200)]
Extend valgrind suppressions for OpenMPI

There was already a suppression for Addr4, but some command lines or
other environmental causes seem to trigger a similar path with an 8-wide
read, so added Addr8 rule for the same.

Change-Id: I54cebc02163a08884838068917018735098c58cd

10 years agoAdded AVX2 detection to cmake and created CPU acceleration macro
Erik Lindahl [Wed, 11 Dec 2013 21:46:13 +0000 (22:46 +0100)]
Added AVX2 detection to cmake and created CPU acceleration macro

The main CMakeLists.txt has been cleaned up by moving
the CPU SIMD acceleration tests to a separate module,
which now also supports AVX2 detection. Acceleration
detection has been improved by actually testing SSE/AVX/AVX2
codes with the flags, rather than first testing flags and
then code (since some compilers silently accept illegal flags).
Cmake now also now detects options to use the clang built-in
assembler on OS X together with the gcc compiler when AVX
acceleration is selected, which makes it possible to use
AVX/AVX2 in combination with OpenMP support on OS X using
free compilers.

Change-Id: I6f9de80a87283cec4cf4211c4d0068d32315ba90

10 years agoFix some issues reported by 'make depcheck doccheck'
Teemu Murtola [Sat, 1 Feb 2014 13:52:08 +0000 (15:52 +0200)]
Fix some issues reported by 'make depcheck doccheck'

Fix some minor documentation issues and make swapcoords.h not installed,
since that is internal mdrun functionality.

There is a dependency issue in update.h including a non-installed
random/random.h, but this is planned to go away when the stateful RNG is
replaced in mdrun, so left it there for now.  User code probably doesn't
have much use for including update.h, anyways.

Change-Id: I491697f8528d9dd5da299f366ccccf7eecb46f8a

10 years agoUse pseudo-random instead of random streams to intialize seeds
Erik Lindahl [Sat, 1 Feb 2014 12:46:30 +0000 (13:46 +0100)]
Use pseudo-random instead of random streams to intialize seeds

The /dev/random stream will block if enough entropy is not
present in the system. This has not historically been a problem,
but with the unit tests initializing dozens of new random number
generators the entropy pool becomes exhausted, and the tests
block 10-20 seconds before each cool quote call for recent gcc
versions on our Ubuntu versions. This is also a seriously bad
abuse of the system random stream on shared systems.
Since /dev/urandom (which does not block) should be sufficiently
random for everything apart from long-term cryptographic keys,
we should use this one instead and leave /dev/random alone.

This patch solves an issue problems where recent gcc versions
took several minutes to complete unit tests.

Change-Id: I4a8fcf7e302d94f5ec3c9715593fbfd257decdd9

10 years agoOverview docs for unit testing
Teemu Murtola [Wed, 8 Jan 2014 19:11:34 +0000 (21:11 +0200)]
Overview docs for unit testing

Add overview documentation for how unit testing is organized for new C++
code.  Also, include guidance for getting started with writing new
tests.

Change-Id: I6c3e01bbc15af278e4b28723b0650825f6104065

10 years agoAdd cmake option for Reference kernel
Roland Schulz [Fri, 10 Jan 2014 22:42:02 +0000 (17:42 -0500)]
Add cmake option for Reference kernel

Change-Id: I6b6cb9c7eb575d8511dccd8e0bf410f44383259d

10 years agoMinor improvements to ewald_LRcorrection
Mark Abraham [Wed, 22 Jan 2014 13:32:53 +0000 (14:32 +0100)]
Minor improvements to ewald_LRcorrection

LJ-PME code doesn't need terms in odd powers of r or beta, so the code
might run a litte faster if expressed this way (fewer flops and fewer
registers).

Made the code that needs dr explicit by declaring dr only where it is
used.

Moved declaration of the fscal temporary to the blocks where it is
used, and commented that it is actually not the scalar force, but the
scalar force pre-multiplied by rinv. Probably that comment should
go in the generic kernels, also.

Change-Id: I052cb5a9b3bdf67a582aec0fcd99ad5da33a3b77

10 years agoMade reference SIMD work again
Berk Hess [Thu, 9 Jan 2014 19:54:28 +0000 (20:54 +0100)]
Made reference SIMD work again

The nbnxn reference SIMD code broke during reorganization.
Added GMX_SIMD_HAVE_ERFC macro.

Change-Id: I601dccab52ea2a7dc1341ce984c514679bdbfee1

10 years agoFix shell completions of ffMULT options
Teemu Murtola [Thu, 30 Jan 2014 16:28:43 +0000 (18:28 +0200)]
Fix shell completions of ffMULT options

Now file names for options with ffMULT set are completed also after one
file name has already been provided.

Fixes #1159, related to #1410.

Change-Id: I1f4f0b6a5817ce3193a0195d1cb4a2491c397593

10 years agoOverview docs for wrapper binary implementation
Teemu Murtola [Wed, 1 Jan 2014 05:21:43 +0000 (07:21 +0200)]
Overview docs for wrapper binary implementation

Add an overview of how the gmx wrapper binary is implemented.
Also some minor clean-up for related module documentation.
Remove test directories from public documentation.

Change-Id: If21cd14d189f239bed19def0acba43681013b0c6

10 years agoOverview docs for using Gromacs as a library
Teemu Murtola [Tue, 31 Dec 2013 11:15:53 +0000 (13:15 +0200)]
Overview docs for using Gromacs as a library

Add some documentation for the commandline module, and make the set of
installed headers provide a useful set of features.
Add an overview documentation for how to initialize Gromacs as a library
under different contexts.  Also, include some general notes about the
Gromacs API.  Can be extended in the future.

Change-Id: I13921fe1f1434fee8c495a169e6f5db645711f79

10 years agoRename ProgramInfo to CommandLineProgramContext
Teemu Murtola [Sun, 29 Dec 2013 12:55:06 +0000 (14:55 +0200)]
Rename ProgramInfo to CommandLineProgramContext

This better reflects its use.  The file containing it was already
renamed in the previous commit, where it was moved.

Change-Id: Ia2a73db10c185d5e290f8d98a2e74c382f141e36

10 years agoRefactor ProgramInfo use
Teemu Murtola [Sun, 29 Dec 2013 11:46:11 +0000 (13:46 +0200)]
Refactor ProgramInfo use

Instead of having ProgramInfo in src/gromacs/utility/, declare only
a program context interface there, and provide simple setters and
accessors for it.  Move all the logic related to actually providing the
values (in particular, the location of the binary) into
src/gromacs/commandline/, which provides an implementation for the new
interface.

This provides two main benefits:
 - The responsibilities of the different modules are clearer, and there
   is no complex logic related to command line programs in the
   bottom layer.
 - The API provided for external code for initializing the library is a
   lot cleaner.  They can either choose to use all the command line
   logic by using gmx::initForCommandLine(), or provide their own
   implementation for the program context, and set it directly with
   gmx::setProgramContext().

Thread safety guarantees have changed somewhat; the implementation is
much simpler this way, and I don't think we need to be 100% thread safe
in methods such as setProgramContext() (gmx::init() isn't, either).

Change-Id: I2b89aeb3833e7e40e5dd2322745efbc44581e15b

10 years agoRemoved ions.itp from GMX/share/top directory.
Rossen Apostolov [Mon, 20 Jan 2014 12:07:36 +0000 (13:07 +0100)]
Removed ions.itp from GMX/share/top directory.

Topologies of the ions should go in the corresponding xxxx.ff/ions.itp
files, there is no need for a top level one.

Change-Id: I9c711b75f494211d9ba86a6b375e8ca69c7a1df2

10 years agoMove command listing to 'gmx help commands'
Teemu Murtola [Sat, 25 Jan 2014 18:07:47 +0000 (20:07 +0200)]
Move command listing to 'gmx help commands'

Instead of printing the list of commands on 'gmx' or 'gmx help', print
it only when explicitly requested with 'gmx help commands'.  This makes
it easier to see the help about the common command line options that
'gmx' accepts.  The list of available help topics lists the 'commands'
topic, so it should be easy to find.

Related to #685.

Change-Id: I00e9ceae15ebd47d2ac129aae8e6e407f86c388a

10 years agoAllocate memory for MD5 on heap
Roland Schulz [Wed, 29 Jan 2014 20:06:39 +0000 (15:06 -0500)]
Allocate memory for MD5 on heap

1MB on stack can cause issues with stack size limits (e.g. MSVC).

Change-Id: I1e9858ae32d78b4d494652f4aaed5354b9276669

10 years agoImproved dependencies on maths includes
Mark Abraham [Mon, 20 Jan 2014 17:57:55 +0000 (18:57 +0100)]
Improved dependencies on maths includes

Our physics.h should have a dependency on our maths header for
PI.

Made explicit some dependencies on system math.h that were being
covered transitively.

Change-Id: I5a35ff10860a84688bfe73260acbd63166f4caec

10 years agoKeep clang Address Sanitizer happy
Mark Abraham [Tue, 28 Jan 2014 01:43:21 +0000 (02:43 +0100)]
Keep clang Address Sanitizer happy

Allocating 15 bytes with the 8-byte aligned memory at offset 8 of
15, would overflow the buffer, which would be fairly likely to
have no effect. But ASan notices this if you run it on AVX hardware,
unlike the Jenkins build which runs on SSE4.1. The good news is
that this fix is enough to make all the existing tests pass under
ASan on AVX.

Change-Id: I61ff11687709e096c70a162d3514227cb243561d

10 years agoFixes to filename shell completions
Teemu Murtola [Tue, 28 Jan 2014 20:37:21 +0000 (22:37 +0200)]
Fixes to filename shell completions

- When completing a file name, don't add a space after a directory name
  has been completed.
- Don't exclude directory names starting with . from the completions.
  This also excludes ../foobar/.
- Use a more reasonable pattern to match the file names: expect exactly
  one of the acceptable extensions, and at most one .gz/.Z extension.
- Complete directory names for mdrun -multidir.

Issues that remain:
- Completions for paths that contain spaces doesn't really work.
  The only difference to earlier behavior is that now, completing
  something that starts with a " gets an appended space before the
  closing ".
- When completing to subdirectories, the list of possible completions
  shows the subdirectory for each alternative.  This doesn't happen with
  standard bash completion.  Not sure whether this is feasible to fix.

Part of #1410 and #1159.

Change-Id: I1aff3ab89419e0ed4b53bc998c9a50b9a1879e9c

10 years agoUncrustify all files
Roland Schulz [Sat, 18 Jan 2014 04:47:30 +0000 (23:47 -0500)]
Uncrustify all files

Add a script that can be used to do this again if necessary.  The script
also supports listing the files based on the filter attribute, and
checking the copyright; can be extended if/when there is need.

Some manual reformatting in gpu_utils.cu, nbnxn_cuda_data_mgmt.cu, and
nbnxn_cuda_kernel.cuh.  Updated the Sparc kernel generator to generate
code that is invariant under uncrustify, like the other kernels already
do.

Copyright not updated, except for fixing readpull.c such that the script
doesn't complain.

Part of #845

Change-Id: Ia77738ec781f75f1c4e7a264734aac884321f3e5

10 years agoPrint common options to 'gmx -h'
Teemu Murtola [Sat, 25 Jan 2014 05:38:21 +0000 (07:38 +0200)]
Print common options to 'gmx -h'

The help shown for the wrapper binary now includes the command line
options it accepts.  Remaining issues that will be fixed separately:
 - Unlike other help output, this output is actually influenced by what
   the user specifies on the command line.
 - The information is not so easy to find, because of the long list of
   subcommands that comes after it.
 - The information should go to some man page as well.

Related to #685.

Change-Id: Iac72dd21d4a733016b331549e139d4184bd3e283

10 years agoClarified use of table-extension..
Justin Lemkul [Wed, 29 Jan 2014 14:03:30 +0000 (09:03 -0500)]
Clarified use of table-extension..

Following some discussion on gmx-users of the implications of
table-extension, added a clarifying remark in mdp_opt.html for
online and printed manual.  I did not add all of the suggested
fixes, as most were redundant, and this single sentence should
alleviate anything that may have been unclear.

Change-Id: I89bcecee2d0b11149423990f957b7092b0f083b9

10 years agoAutomated Verlet rlist for NVE simulations
Berk Hess [Thu, 9 Jan 2014 12:58:12 +0000 (13:58 +0100)]
Automated Verlet rlist for NVE simulations

NVE simulations with the Verlet scheme will now automatically have
the list buffer set using verlet-buffer-tolerance and the initial
temperature, unless this is zero in which case a 10% buffer is used.
A warning is added for potentially large drift over the simulation.
This change makes empty mdp files valid again.

Change-Id: Iae2d3d8ba212dd9e57783d9fb3d84f7cfc1efdd0

10 years agoMerge "Merge branch 'release-4-6'"
Teemu Murtola [Wed, 29 Jan 2014 05:14:11 +0000 (06:14 +0100)]
Merge "Merge branch 'release-4-6'"

10 years agoMoved random number generator code to separate dir.
David van der Spoel [Sun, 19 Jan 2014 07:51:06 +0000 (08:51 +0100)]
Moved random number generator code to separate dir.

GROMACS sports two random number generators for historical
reason. The oldest one is phased out in this patch.
Changing the random number
generator means that e.g. replica exchange simulations will
not be reproducible (if they ever were in practice).

Change-Id: If24f1019fba9b9412713b5fe04b5c0a8a7638468

10 years agoMerge branch 'release-4-6'
Mark Abraham [Tue, 28 Jan 2014 20:06:13 +0000 (21:06 +0100)]
Merge branch 'release-4-6'

Conflicts:
src/contrib/fftw/CMakeLists.txt
Resolved by merging bump to 3.3.3 and increased variable indirection
from both branches

src/gromacs/legacyheaders/nbnxn_cuda_data_mgmt.h
Resolved with master - both branches have now removed fplog parameter
from the free function

src/gromacs/legacyheaders/sim_util.h
src/gromacs/mdlib/minimize.c
src/gromacs/mdlib/tpi.c
src/programs/mdrun/md.c
These are text clashes between master branch runtime ->
walltime_accounting encapsulation transition, and the recently merged
release-4-6 consolidation of start-time printing. There's no code
clash, though. Resolved by using the code that works consistent with
both refactorings. The call to the print_start function has to follow
the call to the walltime_accounting_start function, of course.

Change-Id: I1559fbadfc15eb7b7e880b17e4519159ba9b534e

10 years agoAllow for "computational electrophysiology" simulations (CompEl)
Carsten Kutzner [Fri, 13 Dec 2013 09:41:57 +0000 (10:41 +0100)]
Allow for "computational electrophysiology" simulations (CompEl)

The basic new functionality is to allow exchanges of molecular
positions, e.g. of an ion with a distant water molecule. Whereas
this could be used for different things, the target application is
to determine electrophysiological properties of membrane channels.
In a double-membrane setup the number of ions, and thus the
charge imbalance, and thus the potential difference between
the two compartments can be controlled and kept constant.
If ionic flow occurs through membrane channels, which
dissipates the charge imbalance, ions can be swapped back
to restore the desired charge imbalance between the
compartments. A continuous flow of ions through the
membrane channels can be established that allows to
measure channel conductance and selectivity for example.

If requested by .mdp file settings, the do_swapcoords() routine
is called in the main MD loop. It checks whether the actual
ion counts deviate from the specified reference values and
restores the reference values by ion/water swaps. It also
reports how many ions of each type pass through which channel.

Most of this functionality is in ./src/gromacs/swap/swapcoords.c,
but there is also some new code scattered over the source tree
allowing for grompp reading of CompEl parameters, writing CompEl
data to checkpoint and letting other programs as g_tune_pme
deal with that.

There is also a section in the Latex manual in the special
section describing the protocol.

Some tests have been added in mdrun/tests/swapcoords.cpp that
at the moment only check whether the CompEl parameters are
understood, whether mdrun exits without error code when
running a CompEl simulation and whether checkpointing works.
Some extras have been added to the MdrunTestFixture
class to handle more mdrun-related filenames.

Added doxygen documentation for the new functions.

Ran uncrustify on all new files for up-to-date copyright headers
and proper code formatting. Also uncrustified tpxio.c and
changed the tpx_version from 95 to 96.

Change-Id: Iffda273fd9f47a43e511e70ecdf849f881e933c1

10 years agocmake: added FFTW_URL to allow easy offline build
Christoph Junghans [Mon, 27 Jan 2014 18:30:52 +0000 (11:30 -0700)]
cmake: added FFTW_URL to allow easy offline build

Change-Id: I9904ce03e0ee1b377e4961c1f8481fc98c10cba4

10 years agoBump own fftw build to version 3.3.3
Rossen Apostolov [Mon, 27 Jan 2014 14:50:32 +0000 (15:50 +0100)]
Bump own fftw build to version 3.3.3

Change-Id: I2a4e6acff97e1895517fd58314a010610c0637f5

10 years agoRemove "gmx trjconv -app"
Mark Abraham [Sat, 11 Jan 2014 20:52:55 +0000 (21:52 +0100)]
Remove "gmx trjconv -app"

This functionality is present in gmx trjcat and should not be
duplicated.

Change-Id: I29657de3f488549e3ce7f708c35be41b705416a3

10 years agoRemove unused fplog
Mark Abraham [Tue, 28 Jan 2014 13:24:31 +0000 (14:24 +0100)]
Remove unused fplog

Keeps gcc 4.8 build happy

Change-Id: I392b02c0950ead04c414dffd6340b364b804b7aa

10 years agoShell completion export from the wrapper binary
Teemu Murtola [Wed, 4 Sep 2013 03:39:16 +0000 (06:39 +0300)]
Shell completion export from the wrapper binary

Bash completions now complete the arguments to the wrapper binary
itself, as well as the subcommand names.  After a subcommand has been
specified, use the existing completion logic.  Completions now work also
for arbitrarily suffixed binaries (which the old system didn't work at
all).  No completion is generated for symlinks, but should be
straightforward to do if really required; approach would be the same as
for GMX_BUILD_MDRUN_ONLY.

Other completions are not working for the wrapper binary, and as far as
I can tell, require a completely different approach. Removed the
non-functional code.

Related to #685 and #1410.

Change-Id: I55b13a65c176dab6e2f4f41bf6e829112c99e6b3

10 years agoUnify logic for timing counts
Mark Abraham [Tue, 28 May 2013 08:35:24 +0000 (10:35 +0200)]
Unify logic for timing counts

Made all integrators use the same logic for starting timing
mechanisms.

Change-Id: Id8cb154f7b96d977efffcc9533d4a6dd9894afbd

10 years agoclarified OpenMP-related things in mdrun help/man
Szilárd Páll [Tue, 26 Feb 2013 22:06:42 +0000 (23:06 +0100)]
clarified OpenMP-related things in mdrun help/man

Added note on OMP_NUM_THREADS/GMX_PME_NUM_THREADS env vars and
improved description on the use-cases when MPI+OpenMP improves
performance.

Change-Id: I904f00c8a4b6907a006b9d4367406d3fa3f3ce42

10 years agoExtend version information output
Teemu Murtola [Mon, 27 Jan 2014 19:57:04 +0000 (21:57 +0200)]
Extend version information output

The output of 'gmx -version' now identifies more configuration options
that have been introduced for 5.0:
- Whether C++11 compilation was enabled when compiling the library.
- What version of Boost was used, and whether that was internal or
  external.
- Whether TNG support was configured in.

Change-Id: I5a00165d1d66d0221e895f9c13c28309b904dafa

10 years agoDon't number a list manually
Mark Abraham [Sat, 11 Jan 2014 20:44:50 +0000 (21:44 +0100)]
Don't number a list manually

There's no point in numbering this list, and the numbers are
about to change, anyway.

Change-Id: I015f931086b52a26e91deb3e18210132f02f392d

10 years agoSimplify ProgramInfo
Teemu Murtola [Sat, 28 Dec 2013 06:35:26 +0000 (08:35 +0200)]
Simplify ProgramInfo

Remove realBinaryName() and invariantBinaryName() from ProgramInfo, as
they were only necessary for the command line module manager.  Instead,
pass the binary name to CommandLineModuleManager constructor and move
the invariant name logic into the manager.  This removes unnecessary
functionality from ProgramInfo, allowing to simplify it further.

Change-Id: I2f18dffcb5dde8e2101376444435bb13daf8c236

10 years agoBreak dependency of fileio on tools
Mark Abraham [Tue, 21 Jan 2014 09:52:04 +0000 (10:52 +0100)]
Break dependency of fileio on tools

The issue fixed in Change-Id: I674d41d contributed to the creation of
poor dependencies while trying to avoid yet other dependencies. This
solution relaxes all the constraints, and fixes the mdrun-only build.

Change-Id: I372d5e390469e99ba2d2a4fb70caf2e9a1c404eb

10 years agoUpdate libxml2 CMake detection
Mark Abraham [Mon, 20 Jan 2014 18:57:19 +0000 (19:57 +0100)]
Update libxml2 CMake detection

find_package doesn't check that the library found can be linked.
Particularly when cross-compiling (observed on Power7 front end to
BlueGene/Q), this can be a problem. We need libxml2 to be reliably
detected in order to know whether we should attempt to build the test
binaries.

Change-Id: Iaf9aa2c9577ed66bd41a03c97c13b6e4d6f493c0

10 years agoBug-fix in long-range correction for LJ-PME
Christian Wennberg [Wed, 22 Jan 2014 08:09:19 +0000 (09:09 +0100)]
Bug-fix in long-range correction for LJ-PME

Missing 1/r in the force, when multiplying with the distance vector in order
to get the direction.

Change-Id: I572706b6066cdeb84a2e574b87d077969e166d8c

10 years agoUse local ProgramInfo in CommandLineModuleManager
Teemu Murtola [Sat, 28 Dec 2013 06:12:47 +0000 (08:12 +0200)]
Use local ProgramInfo in CommandLineModuleManager

Remove all usage of the global ProgramInfo object from
CommandLineModuleManager and the classes it uses.  Instead, use the
local instance.  This allows further refactoring.

Change-Id: I52d930ae4bd6bca8a9b4d12c2d0d66470e56a645

10 years agoMove more preprocessing files into the module
Mark Abraham [Fri, 17 Jan 2014 16:38:47 +0000 (17:38 +0100)]
Move more preprocessing files into the module

This removes the need for the gmx_objlib CMake object library, because
there is no longer random functionality orphaned in src/programs/gmx
(which is there because it was orphaned in src/kernel in release-4-6).

Moved legacyheaders/grompp.h to gmxpreprocess/grompp-impl.h since it
only declared structures that are (now) only used in that module (and
it no longer #includes stdio.h). gmxpreprocess/grompp.h now only
declares gmx_grompp().

Likewise, pdb2gmx, protonate and x2top now have their own
single-function headers.

Removed useless declaration of ncontrol from h_db.h

Removed grompp.h-related useless dependencies, declarations and
definitions from Generalized Born files.

Updated include and added C++ guards for files already within the
module (and new ones). Uncrustified, bumped copyrights

Refs #1415

Change-Id: Ie7967d7d7f61df684d530e3c2d982486a3cd128f

10 years agoFixed wrong message when building own FFTW.
Rossen Apostolov [Mon, 20 Jan 2014 11:46:59 +0000 (12:46 +0100)]
Fixed wrong message when building own FFTW.

Change-Id: I54d26291cce4f8986868f9463ecbc6701f974823

10 years agoFix race conditions
Roland Schulz [Mon, 18 Nov 2013 18:48:58 +0000 (13:48 -0500)]
Fix race conditions

progBal problem didn't cause probles because the value written
to the same value on each thread. mdatom.c (c6/c12) problem
was introduced in commit 1c4ab8dc85d1b.

Change-Id: Ia61d214f82771b181308573e4ae1adac94ce5ffa

10 years agoEnsure we don't #define constants before system headers
Mark Abraham [Mon, 20 Jan 2014 21:07:36 +0000 (22:07 +0100)]
Ensure we don't #define constants before system headers

For whatever reason, some older libc (e.g. as found on BG/Q login
nodes) live life such that they unilaterally #define some of the same
M_* constants that we do. If we ever #include <math.h> after
"gromacs/math/utilities.h" then those constants can differ and cause
compilation errors, because we've double-crossed our own #ifndef
attempts.

Change-Id: I4bd6d80e87489cc6f616ce0fb4260a0ac4f9e111

10 years agoAdded ASPP and GLUP to residuetypes.dat.
Justin Lemkul [Tue, 21 Jan 2014 15:40:36 +0000 (10:40 -0500)]
Added ASPP and GLUP to residuetypes.dat.

CHARMM force fields use this nomenclature for neutral forms of
Asp and Glu, unlike other force fields that use ASPH and GLUH.

Change-Id: Id67ab0bf336d9da5bbd62a68b86e0a79609253d1

10 years agoRemove hidden option to gmx dump
Mark Abraham [Tue, 21 Jan 2014 09:36:45 +0000 (10:36 +0100)]
Remove hidden option to gmx dump

gmx dump -xvg -f a.xtc duplicates gmx traj -ox a.xtc

Change-Id: I674d41de5dec9f99fac41f031be7c65e6bc72246

10 years agoRemove unused split.h
Teemu Murtola [Tue, 21 Jan 2014 04:10:57 +0000 (06:10 +0200)]
Remove unused split.h

The header declared functions that weren't even defined, and no one was
including it or using anyt of the definitions.

Change-Id: I53d3ee3b9bdcdcae3f8de1e1941f75cc310e6412

10 years agoImprove file name option help
Teemu Murtola [Mon, 20 Jan 2014 19:17:42 +0000 (21:17 +0200)]
Improve file name option help

- Add brackets for cases where the file name is actually optional.
- Add [...] for cases where multiple file names can be specified.

As supporting changes, extend the options machinery to be able to get
this information for the options, and fix an issue in the table
formatter that was causing some ugly formatting.

Related to #969.

Change-Id: I5b38d7ac6d7c58c3decce64ddfe60fff0a5797ed

10 years agoRemove various outdated things from the repo
Mark Abraham [Sun, 19 Jan 2014 23:27:20 +0000 (00:27 +0100)]
Remove various outdated things from the repo

RPM spec files can be added back if/when someone wants to work out how
to maintain them automatically.

tpbconv symlink can't work now that it is renamed.

Change-Id: Id9ee11a6a21784f68da462fb600243146a0e7b87

10 years agoRename 'gmx tpbconv' to 'gmx convert-tpr'
Mark Abraham [Sat, 18 Jan 2014 21:31:47 +0000 (22:31 +0100)]
Rename 'gmx tpbconv' to 'gmx convert-tpr'

This should help people find the tool they are looking for, rather
than one that is named for a file format that hasn't been written in
over 5 years. Updated comments and documentation accordingly.

Uncrustified, added copyright headers.

Change-Id: I5c29c30af54b90081cfb44f5b24764c8280c49fa

10 years agoFix test reference data
Teemu Murtola [Mon, 20 Jan 2014 19:06:09 +0000 (21:06 +0200)]
Fix test reference data

Combination of a few different changes getting submitted around the same
time led to test reference data not being up-to-date with what the code
actually produced, without producing any conflicts.

Change-Id: I22f9a43faa3bd88668ba4c655d8d26f2a12089d1

10 years agoRewrite help output from Options
Teemu Murtola [Thu, 17 Oct 2013 03:18:47 +0000 (06:18 +0300)]
Rewrite help output from Options

(Partially) rewrite the way command-line help is printed for an Options
object.  Now man pages and HTML output are supported in addition to
console output.  The console output is formatted in a simpler manner,
since there is no longer any need to cater for user-provided values in
the output.  There is some extra machinery now in cmdlinehelpwriter.cpp,
but left it there as it may still be useful in the future, and it does
structure the code a bit more cleanly.

As an extra bonus, the commandline module should no longer depend on the
selection module.

Things more or less work, but the following could still be addressed,
either in this change or later:
 - Re-add selection option help formatting tests somewhere else.
 - Add unit tests for various things about non-console help formatting.
 - Refactor the way the help information is fetched from OptionInfo
   objects: it would be cleaner to have a single method that returns all
   the information in a struct, instead of multiple virtual methods that
   return different pieces of information, many of which are not
   required for anything else except the help output.
 - Add proper synopsis that lists all the options.

Part of #969.

Change-Id: Iadf1b5df15f278547d5db6407f3e3c689fb88645

10 years agoFix .gitignore of some files
Mark Abraham [Mon, 20 Jan 2014 14:29:23 +0000 (15:29 +0100)]
Fix .gitignore of some files

Rooting "bin" and "lib" means they won't match sub-directories like
src/external/tng_io/src/lib.

I can't think of a good reason to .gitignore "log," whether rooted or
not.

Change-Id: Icf3a2fb54f9519dbb936ceabff290084b66f8711

10 years agoAdd TNG writing and reading support
Magnus Lundborg [Tue, 1 Oct 2013 08:11:00 +0000 (10:11 +0200)]
Add TNG writing and reading support

TNG is never read or written by default, but is available as
a trajectory format. The TNG repo is bundled in the GROMACS
source (commit 35827d2c19db8ad86690be32f33da7470abddf3d).

Tools such as trjconv, trjcat, gmxcheck and gmxdump have partial
support for TNG available. Full support for these tools (even only for
the subset of TNG features that GROMACS might want to use right now)
is currently difficult, because the code and data for existing
trajectory writing is a mess of excess functionality.  This will need
to be revisited when (at least) trjconv is broken up into more parts.

Writing with mdrun -x works (tests included)
Reading with mdrun -rerun works (tests included)
Reading and writing with trjconv works (tests included)
trjconv -n subsets work (tests included)

Reading works from e.g. dump, check, trjconv trjcat.
Writing works from e.g. mdrun trjconv, trjcat.
Some other tools seem to work as well, e.g., g_rms.

Reworked some integration test machinery to do more value-paramterized
tests.

Renamed status variable in gmx_trjconv.c to better reflect its usage
as an opaque trajectory-reading-management object.

Encapsulated gmx_mdoutf_t

Moved content of trajectory_writing_low_level.c to mdoutf.c

The Windows build with GMX_USE_TNG=ON is known to be broken with TNG
files.

Changed .mdp field and code variable names that were specific to XTC
to be more generic, now that there is more than one way to write a
trajectory file with lossy compression. Other associated documentation
updates also.

Change-Id: Ied156d8ad728711e08a0c61db5ee3472b0df39d5

10 years agoFix installed headers
Teemu Murtola [Sun, 19 Jan 2014 05:19:17 +0000 (07:19 +0200)]
Fix installed headers

It was not possible to compile anything against the installed headers
without including the installed legacyheaders/ directory in the include
path (which should not be required).

Change-Id: I2d0a65db8e84a3fc4f4a7fb01b359bf6a7d98cbe

10 years agoMove md5.* to fileio/
Teemu Murtola [Sun, 19 Jan 2014 06:00:18 +0000 (08:00 +0200)]
Move md5.* to fileio/

These are only used internally for gmxfio routines, so there is no need
to install the header.

Change-Id: I4e6a40e342108a87e3f88ced451a02e11403f9c1

10 years agoMove strdb.* to src/gromacs/fileio/
Teemu Murtola [Sun, 19 Jan 2014 05:39:46 +0000 (07:39 +0200)]
Move strdb.* to src/gromacs/fileio/

Don't install the header, since it is quite marginal functionality, and
typically user code would not use the string databases directly.

Change-Id: I169cfa6a54e284e3df44f4b1ea2e0b73b7fdfdec

10 years agoClean up after gmxcpp
Mark Abraham [Wed, 15 Jan 2014 17:02:33 +0000 (18:02 +0100)]
Clean up after gmxcpp

Using grompp in integration tests with potentially multiple different
calls to gmx_grompp per executable requires that we start from a clean
state every time we do such a call. Old code was re-using -I paths,
and both -D and #defines, which was breaking some tests I am working
on.

Also added some other done_* calls on the general theory of trying not
to be evil.

Change-Id: I6016bc1786c8ecc9303eeee2ad4a83975117ca5f

10 years agoMove dump, check and tpbconv utilities
Mark Abraham [Sat, 18 Jan 2014 21:28:14 +0000 (22:28 +0100)]
Move dump, check and tpbconv utilities

These now form the start of the tools module, which is intended to
contain code for GROMACS tools whose use is not primarily for analysis
of data from simulations.

tpbcmp.* now named compare.*, since that code did not relate only to
run input files.

Removed declarations duplicated in legacycmodules.cpp in favour
of those in legacycmainfunctions.h.

Uncrustified, added copyright headers.

Change-Id: I48bf171f290fdfb177d5a020473b3a5296d89305

10 years agoFix that check_library_exist is rerun for FFTW
Roland Schulz [Thu, 16 Jan 2014 18:52:04 +0000 (13:52 -0500)]
Fix that check_library_exist is rerun for FFTW

If the library check for fftw plan fails (e.g. missing dependency or
shared library_exists not supported), then the message suggests to change
FFTWF_LIBRARY. But this failed because the check_library test wasn't
rerun because the result was already cached.

TODO: This only fixes it for FFTW. E.g. FindGsl has the same problem.

Change-Id: I170588b0fca2515e9626d7fd85a5730a10777355

10 years agoThis patch moves the statistics library to its own dir.
David van der Spoel [Tue, 14 Jan 2014 18:17:13 +0000 (19:17 +0100)]
This patch moves the statistics library to its own dir.

In the move to depopulate the legacyheaders directory
http://redmine.gromacs.org/issues/1415 this is a small
contribution. Histogram files removed.
Added doxygen style comments as well.

Change-Id: I9da9fefac0d4dd1c5de13862f348adc5c812ad4d

10 years agoFix, simplify and test XTC writing
Mark Abraham [Wed, 15 Jan 2014 13:02:24 +0000 (14:02 +0100)]
Fix, simplify and test XTC writing

The old implementation had various sins, including repeating setup and
leaking natoms_xtc rvecs of memory per step writing xtc-grps when they
are a subset of the whole system. Cleaned lots of things up.

Added integration-style tests for XTC writing.

Added more grompp -n support to integration-style tests, though not
all of it is actually used by this patch.

Also added a pragma to work around a curious warning by ICC 12 on
Windows.

Fixes #1423

Change-Id: I3a75f890f21e4a87be62bcf877eb5c471670286d

10 years agoThis patch moves preprocessing headers to gmxpreprocess
David van der Spoel [Tue, 14 Jan 2014 19:54:49 +0000 (20:54 +0100)]
This patch moves preprocessing headers to gmxpreprocess

In the move to depopulate the legacyheaders directory
http://redmine.gromacs.org/issues/1415 this is a small
contribution.

Change-Id: I209f6e5a1e76f2d3ea072f66eca9ae1f59bc0d42

10 years agoDefine MPI_INT64_T if not defined by mpi
Roland Schulz [Wed, 15 Jan 2014 19:15:33 +0000 (14:15 -0500)]
Define MPI_INT64_T if not defined by mpi

Change-Id: Ie3332ce85a5ef538d57b272ebe3e4326fb7a31ff

10 years agoClean up inputrec reading
Mark Abraham [Wed, 15 Jan 2014 22:11:26 +0000 (23:11 +0100)]
Clean up inputrec reading

In old code, there was no way to reset the state of the string buffers
that were used in parsing the inputrec from .mdp files. This was a
problem for test executables trying to parse more than one such
file. New code still doesn't permit more than one .mdp file to be
parsed at a time, but at least we can clean up and parse another one
from a fresh state.

Got rid of some useless #defines.

Change-Id: If3d72ba68e0addef18c9cf132025958995e7e2ee

10 years agoFix build with GMX_BUILD_UNITTESTS=OFF
Teemu Murtola [Wed, 15 Jan 2014 19:19:25 +0000 (21:19 +0200)]
Fix build with GMX_BUILD_UNITTESTS=OFF

Don't build the object libraries used for unit tests either if the unit
tests are disabled.  Added a helper macro for this as well.

Change-Id: I7b9f899dd2ee8adef261e49d3f8100530487ed54

10 years agoSupport for 64-bit int and real valued Options
Teemu Murtola [Mon, 23 Dec 2013 18:12:00 +0000 (20:12 +0200)]
Support for 64-bit int and real valued Options

Add Int64Option and FloatOption to the options machinery.
Add RealOption that aliases either DoubleOption or FloatOption,
depending on GMX_DOUBLE.
With these additions, the options machinery supports all the
functionality and types of the old t_pargs machinery.

Change-Id: I2260e52d3a220f824e1c3e790da2dba83f381972

10 years agoRemove unused PCA_KEEP_ARGS
Teemu Murtola [Tue, 24 Dec 2013 05:03:23 +0000 (07:03 +0200)]
Remove unused PCA_KEEP_ARGS

Simplifies the code, and removes one path to be tested.

Change-Id: Ie0fe8329a0a9130def5e03438a029ae88b6b1431

10 years agoUnit tests for parse_common_args()
Teemu Murtola [Sat, 21 Dec 2013 18:33:44 +0000 (20:33 +0200)]
Unit tests for parse_common_args()

Add unit tests for most of the basic command line parsing functionality
in parse_common_args(), including the file name handling.

To support these tests, extend arrayref.h to also include ArrayRef,
which provides a mutable wrapper for a C array.  This is complete enough
for the purpose of the tests, but may need additional work for more
general use.  Also fix some documentation typos noticed in the existing
code.

Also, fix unintuitive behavior of etTIME options that was revealed by
the tests.

Change-Id: I4b8b3ad92b0efe24fdf478cd39ba246692b036c7

10 years agoAdd nbnxn tree force reduction
Roland Schulz [Mon, 2 Dec 2013 15:07:55 +0000 (10:07 -0500)]
Add nbnxn tree force reduction

Alternative implementation of the nbnx force reduction. The previous
method is implemented as a loop over all thread buffers. Its advantage is
that it doesn't require any synchronizations during reduction and only
requires a single write per element. The new method utilizes a binary tree
for the reduction. Its advantage is that the data locality of the force
buffers is used during reduction.

The current implementation isn't faster on the CPU (for E526070 with icc).
On the MIC it is faster (36% reduction of buffer-f time for 32 threads).

Part of #1420

Change-Id: I2d84345e9a19d9030a837d324671f2ab0ba9b91b