Changes to GROMACS tools

Improved selection error messages (use exceptions)

Make all selection parsing error handling use exceptions for error reporting, and improve the understandability and context-sensitivity of the messages. Make the code in params.cpp exception-safe. issue 655

Supported more complex fixed position selections

Make it possible to create selections like [0,0,0] plus [0,1,0] to specify a fixed set of positions. This can be useful at least for gmx gangle to calculate angles from a fixed reference vector. Such selections were already understood properly by the parser, but caused various crashes elsewhere in the code. Fixed those crashes by consistently managing the memory for the involved t_block structures (always allocate one value in the index array, even if the block is empty), and by not assuming that a plus-like keyword always has a child element in the evaluation tree. issue 1619.

Fixed crash with ‘z of ...’ within a selection expression

When a z of ... construct was used within an arithmetic expression in a selection, there were out-of-bounds array writes occurring during selection compilation. Initialize the number of values produced by such constructs correctly to avoid this.

Reworked gmx solvate, gmx insert-molecules and gmx sasa

This now use a branch-new analysis-tools neighbour-search implementation. These tools are now faster and less buggy!

Converted gmx rdf to the C++ analysis framework

Convert the RDF calculation tool to the new framework. Main changed beyond mechanical conversion:

  • Remove -com and -rdf options in favor of using selections directly. Both functionality, and a lot more, is now directly supported with proper selections.
  • Remove -hq and -fade options, as both are just post-processing that can be trivially done based on the output .xvg file alone.
  • Normalization is reworked to work with dynamic selections.
  • Add an -rmax parameter that allows specifying an upper cutoff for the RDF. Combined with the use of the neighborhood search routines, this potentially makes the tool a lot faster if the RDF is not required up to half the box length.

Add basic unit/regression tests for a simple water box. The reference values are not verified in any way, so they mainly catch regression bugs.

Added basic GPU support for gmx tune-pme

New functionality

  • permits the user to specify a per-node list of eligible GPU ids (as distinct from mdrun, which permits the user to specify the array of actual GPU ids to use), which it will then map to the PP ranks in round-robin style during the optimization
  • detects whether the mdrun is GPU-aware if the user specifies GPU ids
  • handles error from mdrun when number of PP ranks does not match the GPU id string provided
  • handles error from mdrun when GPU with given id is invalid
  • runs check that a .tpr will work mdrun with -npme 0, which is less likely to run into issues at small scale with eligible partitioning issues than -npme -1

This code does not do anything active about optimizing the use of OpenMP, as current-generation gmx tune_pme is basically designed to have no ability to change the number of MPI ranks at all. However, if the MPI system is set up such that mdrun’s automatic allocation of OpenMP threads to ranks will work, then the optimization can take place over runs that actually trigger the use of OpenMP. (This was true before this patch.)

issue 1119

Required gmx tune_pme to take -mdrun parameter

The transition away from many binaries in 5.0, and the removal of symlinks in 5.1 mean there is even less chance that a sensible default command line for calling mdrun can be provided. In general, mdrun might be in either precision, with or without MPI, with or without some custom suffix, inside the wrapper binary or from an mdrun-only build, or from a custom directory. Thus, the user is now required to say what command to call to run the simulation they want to optimize.

issue 1754

Added gmx pairdist tool as partial gmx mindist replacement

Add a new tool that can compute pairwise distances from one reference selections to one or more calculation selections. The tool can do minimum or maximum distance over the whole selection, as well as between each residue/molecule pair in the selections. This should provide (nearly) all the distance outputs that gmx mindist has, and with a bit of effort also be able to replace gmx mdmat.

The tool intentionally does not compute contact counts; those should be added into a separate tool to keep things simpler.

Fixed gmx trjconv modifying frame time stamp unnecessarily

There was a bug where gmx trjconv modified the input frame time, which caused issues with seeking in XTC files. This has recently been fixed by commit 81d10b25, but it’s better not to mess with the input frame and only modify the output frame.

issue 1405, issue 1406

Reorganized analysis of and documenting correlation functions

Moved routines computing correlation functions and fitting to those in a special subdirectory not dependent on gmxana. The autocorrelation now functions as it should (previously there were issues with long-time correlations). New manual section for curve fitting.

Replaced Levenberg-Marquardt algorithm by another implementation from http://apps.jcns.fz-juelich.de/doku/sc/lmfit, under a FreeBSD license.

The routines many_auto_correl and many_cross_correl are optimized using OpenMP.

Made ‘gmx sasa’ calculation thread-safe

Made gmx sasa computation mostly thread-safe (only the Connolly surface output isn’t). This in turn gives the first analysis tool that does a non-trivial amount of computation per frame in a thread-safe manner. Once we have TBB or some other proper threading library in use, it should then be straightforward to also implement threading support for the analysis framework, and actually have a tool where the benefit could be observable.

Made ‘gmx sasa’ volume computation translation-invariant

Compute the center of the molecule also when PBC is used, instead of using the origin as the center. The center is used for volume computation, and this makes the output translation-invariant with PBC. This also makes the results of PBC and no-PBC computation match for the same structure in case there are no contacts over the PBC.

The whole volume algorithm is broken if the molecule is split across PBC in the input structure (which is likely the case if one wants to use -pbc), and that would require substantially more effort (essentially, making each continuous surface whole before computing the volume), so only added a note to gmx sasa -h to explain this for now.

Added OpenMP parallelization to gmx wham

The inner loops of gmx wham now allow OpenMP parallelization. The computed PMFs are identical up to 5 digits at different number of threads and compared to a previous version of gmx wham. Compiles also without OpenMP support. Number of threads set with option -nt.