Skip to content

[GROMACS] [package list]

GROMACS/2023.2-cpeAMD-22.12-VkFFT-GPU (GROMACS-2023.2-cpeAMD-22.12-VkFFT-GPU.eb)

This software is archived in the LUMI-EasyBuild-contrib GitHub repository as easybuild/easyconfigs/__archive__/g/GROMACS/GROMACS-2023.2-cpeAMD-22.12-VkFFT-GPU.eb. The corresponding module would be GROMACS/2023.2-cpeAMD-22.12-VkFFT-GPU.

# Based on recipe from Rasmus Kronberg (CSC) 
#
easyblock = 'CMakeMake'

name =          'GROMACS'
version =       '2023.2'
versionsuffix = '-VkFFT-GPU' 

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 tMPI, hipSYCL and VkFFT, recommended only for a single GPU use (no support for a direct GPU communication) 
* gmx_mpi: Compiled with MPI, hipSYCL and VkFFT, recommended for a single GPU use or multi GPU runs with exactly one separate PME rank (no support for PME decomposition)


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.

"""

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

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

builddependencies = [
    ('buildtools', '%(toolchain_version)s', '', True), 
    ('gcc-mixed/11.2.0', EXTERNAL_MODULE),
]

dependencies = [
    ('hipSYCL', '0.9.4', '-rocm-5.2.3'),
    ('Boost', '1.81.0'),
    ('cray-fftw/3.3.10.3', EXTERNAL_MODULE),
    ('cray-python/3.10.10', EXTERNAL_MODULE),
    ('cray-libsci/22.12.1.1', EXTERNAL_MODULE),
    ('rocm/5.2.3', EXTERNAL_MODULE),
]

# These options are taken from CSC installation developed by Rasmus 

local_configopts =  '-D CMAKE_BUILD_TYPE=Release '
local_configopts += '-D CMAKE_C_COMPILER=${ROCM_PATH}/llvm/bin/clang '
local_configopts += '-D CMAKE_CXX_COMPILER=${ROCM_PATH}/llvm/bin/clang++ '
local_configopts += '-D CMAKE_PREFIX_PATH=${CRAY_MPICH_PREFIX} '
local_configopts += '-D CMAKE_CXX_FLAGS="--gcc-toolchain=/opt/cray/pe/gcc/11.2.0/snos/" '
local_configopts += '-D GMX_GPU=SYCL '
local_configopts += '-D GMX_MPI=OFF '
local_configopts += '-D GMX_OPENMP=ON '
local_configopts += '-D GMX_SYCL_HIPSYCL=ON '
local_configopts += '-D GMX_GPU_FFT_LIBRARY=VKFFT '
local_configopts += '-D GMX_BUILD_OWN_FFTW=OFF '
local_configopts += '-D GMX_BLAS_USER=${CRAY_LIBSCI_PREFIX_DIR}/lib/libsci_amd.so '
local_configopts += '-D GMX_LAPACK_USER=${CRAY_LIBSCI_PREFIX_DIR}/lib/libsci_amd.so '
local_configopts += '-D HIPSYCL_TARGETS="hip:gfx90a" '

configopts = [
    local_configopts + '-DGMX_MPI=OFF',
    local_configopts + '-DGMX_MPI=ON',
]

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',
    '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]