Skip to content

[GROMACS] [package list]

GROMACS/2024.3-cpeGNU-24.03-CPU (GROMACS-2024.3-cpeGNU-24.03-CPU.eb)

Install with the EasyBuild-user module:

eb GROMACS-2024.3-cpeGNU-24.03-CPU.eb -r
To access module help after installation and get reminded for which stacks and partitions the module is installed, use module spider GROMACS/2024.3-cpeGNU-24.03-CPU.

EasyConfig:

# Contributed by Luca Marsella and Victor Holanda Rusu (CSCS)
#
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
# Copyright:: Copyright 2012-2013 University of Luxembourg / LCSB, Cyprus Institute / CaSToRC, Ghent University
# Authors::   Wiktor Jurkowski <wiktor.jurkowski@uni.lu>, Fotis Georgatos <fotis.georgatos@uni.lu>, \
# George Tsouloupas <g.tsouloupas@cyi.ac.cy>, Kenneth Hoste
# License::   MIT/GPL
# $Id$
#
# This work implements a part of the HPCBIOS project and is a component of the policy:
# http://hpcbios.readthedocs.org/en/latest/HPCBIOS_2012-93.html
#
# Adapted by Kurt Lust (kurt.lust@uantwerpen.be) for the LUMI consortium
#
easyblock = 'CMakeMake'

name =          'GROMACS'
version =       '2024.3'
versionsuffix = '-CPU'

homepage = 'http://www.gromacs.org'

whatis = [
    'Description: GROMACS is a versatile package to perform molecular dynamics, i.e. simulate the Newtonian equations of motion for systems with hundreds to millions of particles.',
]

description = """
GROMACS is a versatile package to perform molecular dynamics, i.e. simulate the
Newtonian equations of motion for systems with hundreds to millions of
particles.

Binaries included:
* gmx: Compiled with support for OpenMP
* gmx_mpi: Compiled with support for MPI and OpenMP.
* gmx_d: Compiled with support for OpenMP and using double precision arithmetic.
* gmx_mpi_d: Compiled with support for MPI and OpenMP and using double precision
  arithmetic.

The module sets the environment variables that would otherwise be set by running
the script $EBROOTGROMACS/bin/GMXRC. So running this script snould not be
necessary in most cases.

The module also defines the shell function gromacs-completion that can be used to
turn bash command completion on for GROMACS. Note that unloading the module will
not turn this off, so it may have consequences for things you do later on or
conflict with the command completion of a different version of GROMACS.

This module is compiled with support for huge pages via the cray-hugepages modules.
Using those can significantly lower the cost of memory access. However, to benefit
from this you will have to load a suitable cray-hugepages module, e.g.,
$ module load cray-hugepages8M
However, if the size is too large, you may get out-of-memory messages due to memory
fragmentation. Hence it may require some experimenting to find the optimal page
size.
"""

toolchain = {'name': 'cpeGNU', 'version': '24.03'}
toolchainopts = {'opt': True, 'usempi': True, 'verbose': False, 'pic': True, 'openmp': True}

source_urls = ['https://ftp.gromacs.org/pub/gromacs/']
sources =     [SOURCELOWER_TAR_GZ]
checksums =   ['bbda056ee59390be7d58d84c13a9ec0d4e3635617adf2eb747034922cba1f029']

builddependencies = [
    ('buildtools',         '%(toolchain_version)s', '', True), # For CMake
    ('craype-hugepages8M', EXTERNAL_MODULE),
]

local_common_opts  = '-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=lib '  # General CMake options
local_common_opts += '-DGMX_OPENMP=ON -DGMX_GPU=OFF ' # Build type: No GPU, OpenMP for CPU, MPI specified elsewhere
local_common_opts += '-DBUILD_SHARED_LIBS=ON ' # REquired to be able to build GMXAPI
local_common_opts += '-DGMX_SIMD=AVX2_256 '
local_common_opts += '-DGMX_CYCLE_SUBCOUNTERS=ON '
local_common_opts += '-DGMX_BUILD_OWN_FFTW=ON '
local_common_opts += '-DGMX_DEFAULT_SUFFIX=ON '

configopts = [
    # single precision
    local_common_opts + '-DGMX_MPI=OFF',
    local_common_opts + '-DGMX_MPI=ON',
    # double precision
    local_common_opts + '-DGMX_MPI=OFF -DGMX_DOUBLE=ON',
    local_common_opts + '-DGMX_MPI=ON  -DGMX_DOUBLE=ON',
]

#onlytcmod = True
skipsteps = ['test']

# This does what GMXRC.bash does except that it does not enable the command completion.
modextravars = {
    'GROMACS_DIR':     '%(installdir)s',
    'GMXBIN':          '%(installdir)s/bin',
    'GMXLDLIB':        '%(installdir)s/lib64',
    'GMXMAN':          '%(installdir)s/share/man',
    'GMXDATA':         '%(installdir)s/share/data',
    'GMXTOOLCHAINDIR': '%(installdir)s/share/cmake', # Defined in the standard script but not exported.
}

local_bash_completion = """
[==[
  if test -n "${BASH_VERSION+set}" && (complete) > /dev/null 2>&1; then
    if (shopt -s extglob) > /dev/null 2>&1; then
      shopt -s extglob ;
      if [ -f $GMXBIN/gmx-completion.bash ]; then
        source $GMXBIN/gmx-completion.bash ;
        for cfile in $GMXBIN/gmx-completion-*.bash ; do
          source $cfile ;
        done ;
      fi ;
    fi ;
  elif test -n "${ZSH_VERSION+set}" > /dev/null 2>&1 ; then
    autoload bashcompinit ;
    if (bashcompinit) > /dev/null 2>&1; then
      bashcompinit ;
      if [ -f $GMXBIN/gmx-completion.bash ]; then
        source $GMXBIN/gmx-completion.bash ;
        for cfile in $GMXBIN/gmx-completion-*.bash ; do
          source $cfile ;
        done ;
      fi ;
    fi ;
  fi
]==]
"""

local_csh_completion = '"echo \'Not implemented\'"'

modluafooter = """
set_shell_function( 'gromacs-completion', %(bash_completion)s, %(csh_completion)s )
""" % {
    'bash_completion': local_bash_completion,
    'csh_completion':  local_csh_completion,
}

moduleclass = 'bio'

[GROMACS] [package list]