Gromacs

Development Tools

    Table of contents
    No headers

    A useful (optional) development tool for memory debugging is Valgrind.

    Valgrind

    GROMACS is a complex software package with many different data structures. Programming errors can easily load to memory errors which often remain unnoticed and are difficult to track down. Here a memory error detector can be very helpful and save you (or others who use your code) a lot of frustrating time debugging or staring at the code.

    The Valgrind package contains several tools of which the memory error detector is the most useful. It will (probably) find all memory errors. Simply compile your code with the compiler option -g and run it with Valgrind. Valgrind will report uninitialized memory access and access beyond array boundaries including a report of the line where the array was allocated. The only problem is that is also finds some false positives. With GROMACS this mainly seems to happen with data structures that contain fixed sized arrays (version 3.3.1 is a significant improvement in this respect over version 3.2.3). The two most important GROMACS programs grompp and mdrun should not produce memory errors. Currently both programs produce memory leaks, but ideally this should also not happen. Another issue is that the MPI library can produce a lot of memory errors, which makes it difficult to find the relevant messages about GROMACS.

    Developers are encouraged to run Valgrind on grompp or mdrun before committing major changes to the code.

    Page last modified 19:51, 6 Jan 2014 by tmurtola