# IT4Innovations 2021
# LK

name = 'impi'
version = '2018.4.274'

homepage = 'https://software.intel.com/en-us/intel-mpi-library/'
description = "Intel MPI Library, compatible with MPICH ABI"

toolchain = {'name': 'iccifort', 'version': '2019.1.144-GCC-8.2.0-2.31.1'}

source_urls = ['https://registrationcenter-download.intel.com/akdlm/irc_nas/tec/13651/']
sources = ['l_mpi_%(version)s.tgz']
checksums = ['a1114b3eb4149c2f108964b83cad02150d619e50032059d119ac4ffc9d5dd8e0']

dontcreateinstalldir = True

components = ['intel-mpi', 'intel-psxe', 'intel-imb']

dependencies = [
    # needed by libfabric provider MLX introduced in Intel MPI v2019.6,
    # https://software.intel.com/en-us/articles/improve-performance-and-stability-with-intel-mpi-library-on-infiniband
    ('UCX', '1.9.0'),
]

# set up all the mpi commands to default to intel compilers
# set_mpi_wrappers_all = True

postinstallcmds = [
    'ln -s %(installdir)s/lib64/libmpi.so  %(installdir)s/lib64/libmpich.so',
    'ln -s %(installdir)s/lib64/libmpigc4.so  %(installdir)s/lib64/libmpichcxx.so',
    'ln -s %(installdir)s/lib64/libmpigf.so %(installdir)s/lib64/libfmpich.so',
    'ln -s %(installdir)s/lib64/libmpigf.so %(installdir)s/lib64/libmpichf90.so',
    'ln -s %(installdir)s/lib64/libmpi.so %(installdir)s/lib64/libmpl.so',
    'ln -s %(installdir)s/lib64/libmpi.so %(installdir)s/lib64/libopa.so'
]

modextravars = {
    "I_MPI_OFI_PROVIDER": "MLX",
    "FI_PROVIDER": "verbs",
    "I_MPI_CC": "icc",
    "I_MPI_CXX": "icpc",
    "I_MPI_F77": "ifort",
    "I_MPI_F90": "ifort",
    "I_MPI_FC": "ifort",
    "I_MPI_HYDRA_BOOTSTRAP": "ssh",
}

modaliases = {
    "mpigcc": "mpigcc -cc=gcc",
    "mpigxx": "mpigxx -cxx=g++",
    "mpiicc": "mpiicc -cc=icc",
    "mpiicpc":"mpiicpc -cxx=icpc",
    "mpiifort": "mpiifort -f90=ifort",
}

skipsteps = ['sanitycheck']

moduleclass = 'mpi'
