GROMACS/2024.3-cpeGNU-24.03-PLUMED-2.9.2-cray-python-3.11.7-CPU (GROMACS-2024.3-cpeGNU-24.03-PLUMED-2.9.2-cray-python-3.11.7-CPU.eb)
Install with the EasyBuild-user module:
To access module help after installation and get reminded for which stacks and partitions the module is installed, usemodule spider GROMACS/2024.3-cpeGNU-24.03-PLUMED-2.9.2-cray-python-3.11.7-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
#
#DOC Version with PLUMED and GMXAPI with support for Cray Python 3.11.7.
#DOC Only the single precision MPI+OpenMP executable `gmx_mpi` is included as
#DOC GMXAPI does not support a multiple binary setup.
#DOC This is not a containerised build. The `gmxapi` package is not problematic,
#DOC but care may be needed with `networkx` dependency as that contains a lot of small files.
#DOC Unfortunately the Python developers in their infinite wisdom and lack of understanding
#DOC of HPC stopped supporting running from zipped egg files as that would have been
#DOC perfect for the `networkx` package and solve all file system issues.
#DOC Hence this recipe is only useful if you don't need much more than what cray-python
#DOC provides and the base packages for PLUMED and GMXAPI with the mandatory dependencies.
easyblock = 'CMakeMake'
local_crayfftw_version = '3.3.10.1'
local_craypython_version = '3.11.7'
local_PLUMED2_9_version = '2.9.2' # https://github.com/plumed/plumed2/releases
name = 'GROMACS'
version = '2024.3'
versionsuffix = f'-PLUMED-{local_PLUMED2_9_version}-cray-python-{local_craypython_version}-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.',
'Extensions: Includes PLUMED %s' % local_PLUMED2_9_version,
]
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.
As GMXAPI does not support installations with multiple binaries, only the
single precision executable gmp_mpi with support for MPI and OpenMP is
included.
The module sets the environment variables that would otherwise be set by running
the script $EBROOTGROMACS/bin/GMXRC. So running this script should not be
necessary in most cases.
It is compiled with support for PLUMED.
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']
local_pyshortver = '.'.join( local_craypython_version.split('.')[:2] )
builddependencies = [
('buildtools', '%(toolchain_version)s', '', True), # For CMake
('buildtools-python', '%(toolchain_version)s', f'-cray-python{local_pyshortver}', True), # wheel
('craype-hugepages8M', EXTERNAL_MODULE),
]
dependencies = [
(f'cray-fftw/{local_crayfftw_version}', EXTERNAL_MODULE),
(f'cray-python/{local_craypython_version}', EXTERNAL_MODULE),
('PLUMED', local_PLUMED2_9_version, f'-cray-python-{local_craypython_version}'),
]
preconfigopts = ' cd ../gromacs-%(version)s && plumed-patch -p -e gromacs-%(version)s -m shared && cd - && '
#
configopts = ' '.join([
'-DCMAKE_BUILD_TYPE=Release',
'-DCMAKE_INSTALL_LIBDIR=lib', # Install in lib instead of lib64 for consistency with autotools installations
'-DBUILD_SHARED_LIBS=ON', # Required to be able to build GMXAPI
'-DGMX_DOUBLE=OFF',
'-DGMX_MPI=ON',
'-DGMX_OPENMP=ON',
'-DGMX_GPU=OFF', # CPU build
'-DGMX_SIMD=AVX2_256', # Force AVX2_256, as this is best for Zen3 (the manual claims that AVX2_128 is best for Zen2 and we don't want GROMACS to take that when cross-compiling).
'-DGMX_CYCLE_SUBCOUNTERS=ON',
'-DGMX_BUILD_OWN_FFTW=OFF', # We already use cray-fftw for PLUMED and would have conflics otherwise
'-DGMX_DEFAULT_SUFFIX=ON',
'-DGMX_THREAD_MPI=OFF', # According to the PLUMED manual, PLUMED is not compatible with Thread-MPI and it should be turned off.
'-DGMXAPI=ON', # Should be the default anyway.
'-DGMX_PYTHON_PACKAGE=ON',
])
skipsteps = ['test']
exts_defaultclass = 'PythonPackage'
exts_default_options = {
'source_urls': [PYPI_SOURCE],
'use_pip': True,
'download_dep_fail': True,
'sanity_pip_check': False,
}
exts_filter = ("python -c 'import %(ext_name)s'", '')
exts_list = [
('networkx', '3.3', {
#'zipped_egg': True, # pip does no longer support --egg unfortunately.
'checksums': ['0c127d8b2f4865f59ae9cb8aafcd60b5c70f3241ebd66f7defad7c4ab90126c9'],
}),
('gmxapi', '0.4.2', {
'preinstallopts': 'export CMAKE_ARGS="-Dgmxapi_ROOT=%(installdir)s ' +
'-C %(installdir)s/share/cmake/gromacs_mpi/gromacs-hints_mpi.cmake" && ',
'checksums': ['c746c6498c73a75913d7fcb01c13cc001d4bcb82999e9bf91d63578565ed1a1f'],
}),
]
# Ensure that plumed is indeed present using sanity_check_commands
sanity_check_commands = [
'gmx_mpi mdrun -h |& grep plumed',
# Check if we didn't break the PLUMED Python integration.
'python -c "import plumed"',
'python -c "import plumed; plumed.Plumed()"', # This really triggers loading the .so and is a better test than just importing the package.
# Check gmxapi
'python -c "import gmxapi"', # Not that useful as EasyBuild will automatically test the extensions
'python -c "import gmxapi; gmxapi.utility.config()"',
'python -c "import gmxapi; gmxapi.runtime.filtered_mpi_environ()"',
'python -c "import gmxapi; gmxapi.version.api_is_at_least(0,4,2)"',
'python -c "import gmxapi ; print( gmxapi.version.has_feature(\'mpi_bindings\') )" | grep -q True', # Test mpi4py integration
]
# 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.
}
modextrapaths = {
'PYTHONPATH': f'lib/python{local_pyshortver}/site-packages',
}
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'