Gromacs

Library Structure

    Version as of 00:08, 24 Aug 2019

    to this version.

    Return to Version archive.

    View current version

    Here is a discussion of how the gmxlib will change in the near future. This page contains a status overview and guidelines for coding.

    Current status

    The current directory structure is as follows (in CVS head before 4.1):

    gmx/
    gmx/admin
    gmx/config
    gmx/include/
    gmx/include/types
    gmx/man
    gmx/man1
    gmx/man7
    gmx/scripts
    gmx/share
    gmx/share/html
    gmx/share/template
    gmx/share/top
    gmx/share/tutor
    gmx/share/tutor/gmxdemo
    gmx/share/tutor/methanol
    gmx/share/tutor/mixed
    gmx/share/tutor/nmr1
    gmx/share/tutor/nmr2
    gmx/share/tutor/speptide
    gmx/share/tutor/water
    gmx/src/contrib
    gmx/src/gmxlib
    gmx/src/gmxlib/gmx_blas
    gmx/src/gmxlib/gmx_lapack
    gmx/src/gmxlib/gmx_statistics
    gmx/src/gmxlib/nonbonded
    gmx/src/gmxlib/nonbonded/mknb_generator
    gmx/src/gmxlib/nonbonded/nb_kernel
    gmx/src/gmxlib/nonbonded/nb_kernel_bluegene
    gmx/src/gmxlib/nonbonded/nb_kernel_f77_double
    gmx/src/gmxlib/nonbonded/nb_kernel_f77_single
    gmx/src/gmxlib/nonbonded/nb_kernel_ia32_3dnow
    gmx/src/gmxlib/nonbonded/nb_kernel_ia32_sse
    gmx/src/gmxlib/nonbonded/nb_kernel_ia32_sse2
    gmx/src/gmxlib/nonbonded/nb_kernel_ia64_double
    gmx/src/gmxlib/nonbonded/nb_kernel_ia64_single
    gmx/src/gmxlib/nonbonded/nb_kernel_power6
    gmx/src/gmxlib/nonbonded/nb_kernel_ppc_altivec
    gmx/src/gmxlib/nonbonded/nb_kernel_x86_64_sse
    gmx/src/gmxlib/nonbonded/nb_kernel_x86_64_sse2
    gmx/src/kernel
    gmx/src/mdlib
    gmx/src/ngmx
    gmx/src/tools
    

    (in alphabetical order). Four libraries are created: libgmx.a, libmd.a, libgmxpreprocess.a, libgmxana.a. Programs are installed from kernel, tools and ngmx.

    Future plans

    In order to make the layout easier to comprehend and to maintain (and test!) the following actions are proposed:

    • Gradually move independent parts of gmxlib and mdlib into subdirectories of gmxlib with minimal inter-dependencies. As an example one could have src/gmxlib/neighborsearching, src/gmxlib/coordinatefiles, src/gmxlib/topology and so on. Each sublibrary should contain a specific test program to test the code in that directory.
    • Eventually we probably want to rename this directory to "libgromacs" so that the directory and library has the same name, and it would also be a point to change the library name when we allow C++ after 4.1 and the linking actions will have to change.
    • Clean up the code according to the Encapsulation principles, adhering to the rules for Indentation and Block structure
    • Remove confusing datatypes (in particular "bool" which should be replaced by specific enumerated types)
    • Library functions may never crash or fail. All library functions should return a well-defined status, such that it can be checked by the calling routine.
    • Make a new subdirectory src/programs, and move all programs to a separate subdirectory within that one, e.g. src/programs/mdrun, src/programs/trjconv etc.
    • For each module, we want the interface (.h header file), implementation (.c or .cxx), and test driver (.test.c or .test.cxx) in the same location, with the same base name, and just different extensions.

    See also the page about Compilation for other changes that are imminent following 4.1.

    New library structure

    Here is a proposal for a structure of the gromacs tree (only for the source code for now). Note that we do not use gmx_ prefixes on subdirectories, since it is rather obvious we are in the gromacs tree.

    gmx/src/gmxlib/basic
    gmx/src/gmxlib/geometry
    gmx/src/gmxlib/io
    gmx/src/gmxlib/math
    gmx/src/gmxlib/math/blas
    gmx/src/gmxlib/math/lapack
    gmx/src/gmxlib/statistics
    gmx/src/gmxlib/interactions
    gmx/src/gmxlib/interactions/listed
    gmx/src/gmxlib/interactions/nonbonded (+ subdirectories, not ideal for now)
    gmx/src/gmxlib/parallel
    gmx/src/gmxlib/neighborsearch
    gmx/src/gmxlib/ More libraries here
    
    

    gmx/src/include (wrappers for header files installed in subdirectories under gmxlib)

    gmx/src/programs/mdrun
    gmx/src/programs/grompp
    gmx/src/programs/trjconv
    gmx/src/programs/ More programs here
    

    Tests for modules are included in gmxlib, higher-level tests for programs in src/programs.

    Page last modified 14:50, 21 Mar 2009 by rossen