GROMACS/2024.3-cpeAMD-24.03-PLUMED-2.9.2-noPython-rocm (GROMACS-2024.3-cpeAMD-24.03-PLUMED-2.9.2-noPython-rocm.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-cpeAMD-24.03-PLUMED-2.9.2-noPython-rocm
.
EasyConfig:
# Based on recipe from Rasmus Kronberg (CSC)
#
#DOC This EasyConfig provides two versions of GROMACS for the AMD GPUs in LUMI:
#DOC One compiled with heFFTe (gmx_mpi) and one compiled with VkFFT (gmx_mpi_vkffte).
#DOC See [the GROMACS installation guide](https://manual.gromacs.org/documentation/2024.3/install-guide/index.html#using-heffte)
#DOC for the differences between these two variants.
easyblock = 'CMakeMake'
local_crayfftw_version = '3.3.10.1'
local_AdaptiveCpp_version = '24.06.0'
local_HeFFTe_version = '2.4.0'
local_Boost_version = '1.83.0' # https://www.boost.org/
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}-noPythonrocm'
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.',
f'Extensions: Includes PLUMED {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.
Binaries included:
* gmx_mpi: with MPI and heFFTe support for multiple GPU compute nodes
* gmx_mpi_vkfft: with MPI and VkFFT support for single GPU node
Note that PLUMED itself is not GPU-accelerated, but should be taken into account
when GROMACS schedules between CPU and GPU. You'll need to reserve a sufficient
number of CPU cores per GPU though for this to be effective.
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.
The gmxapi support needed to interface with Python is turned off in this build as
one would need a Python distribution built with the Cray compilers for it to work due
to runtime conflicts between the GNU and Cray OpenMP runtimes.
"""
toolchain = {'name': 'cpeAMD', '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', '', SYSTEM),
]
dependencies = [
(f'cray-fftw/{local_crayfftw_version}', EXTERNAL_MODULE),
('AdaptiveCpp', local_AdaptiveCpp_version, '-rocm'),
('HeFFTe', local_HeFFTe_version, '-rocm'),
('Boost', local_Boost_version),
('PLUMED', local_PLUMED2_9_version, '-noPython'),
]
# These options are taken from CSC installation developed by Rasmus adapted for AMD toolchain
local_common_opts = ' '.join([
'-D CMAKE_BUILD_TYPE=Release',
'-D ROCM_PATH=${ROCM_PATH}',
'-D CMAKE_C_COMPILER=${ROCM_PATH}/llvm/bin/clang',
'-D CMAKE_CXX_COMPILER=${ROCM_PATH}/llvm/bin/clang++',
'-D CMAKE_PREFIX_PATH=${CRAY_MPICH_PREFIX}:${ROCM_PATH}/lib',
'-D GMX_GPU=SYCL',
'-D GMX_MPI=ON',
'-D GMX_THREAD_MPI=off',
'-D GMX_OPENMP=ON',
'-D GMX_SYCL_HIPSYCL=ON',
'-D GMX_BUILD_OWN_FFTW=OFF',
'-D GMX_BLAS_USER=${CRAY_LIBSCI_PREFIX_DIR}/lib/libsci_amd.so',
'-D GMX_LAPACK_USER=${CRAY_LIBSCI_PREFIX_DIR}/lib/libsci_amd.so',
'-D ACPP_TARGETS="hip:gfx90a"',
'-D HIPSYCL_ROCM_PATH=${ROCM_PATH}',
'-D HIPSYCL_TARGETS="hip:gfx90a"',
'-D GMXAPI=off', # Do not build GMXAPI as there are runtime conflicts with GNU-compiled Python distributions due to the different OpenMP runtime.
])
preconfigopts = ' cd ../gromacs-%(version)s && plumed-patch -p -e gromacs-%(version)s -m shared && cd - && '
configopts = [
# with heFFTe (recommended version see: https://manual.gromacs.org/current/install-guide/index.html#using-heffte)
(local_common_opts +
'-D GMX_USE_HEFFTE=ON ' +
'-D GMX_GPU_FFT_LIBRARY=rocFFT ' +
'-D Heffte_ROOT=${EBROOTHEFFTE} ' +
'-D SYCL_CXX_FLAGS_EXTRA=-DHIPSYCL_ALLOW_INSTANT_SUBMISSION=1'
),
# with VkFFT (reference version see: https://manual.gromacs.org/current/install-guide/index.html#using-vkfft)
(local_common_opts +
'-D GMX_GPU_FFT_LIBRARY=VKFFT ' +
'-D GMX_DEFAULT_SUFFIX=OFF ' +
'-D GMX_BINARY_SUFFIX="_mpi_vkfft" ' +
'-D GMX_LIBS_SUFFIX="_mpi_vkfft"'
),
]
prebuildopts = ['export CPATH="$ROCM_PATH/include/rocfft:$CPATH" && ', '']
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'