Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adopt module_load_environment: impi #3553

Open
wants to merge 1 commit into
base: 5.0.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 34 additions & 26 deletions easybuild/easyblocks/i/impi.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,63 +227,71 @@ def sanity_check_step(self):

super(EB_impi, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)

def make_module_req_guess(self):
def make_module_step(self, *args, **kwargs):
"""
A dictionary of possible directories to look for
Set paths for module load environment based on the actual installation files
"""
guesses = super(EB_impi, self).make_module_req_guess()
manpath = 'man'
fi_provider_path = None
mic_library_path = None

impi_ver = LooseVersion(self.version)
if impi_ver >= LooseVersion('2021'):
mpi_subdir = self.get_versioned_subdir('mpi')
path_dirs = [
os.path.join(mpi_subdir, 'bin'),
os.path.join(mpi_subdir, 'libfabric', 'bin'),
]
lib_dirs = [
os.path.join(mpi_subdir, 'lib'),
os.path.join(mpi_subdir, 'libfabric', 'lib'),
]
if impi_ver < LooseVersion('2021.11'):
lib_dirs.insert(1, os.path.join(mpi_subdir, 'lib', 'release'))
include_dirs = [os.path.join(mpi_subdir, 'include')]
path_dirs = [
os.path.join(mpi_subdir, 'bin'),
os.path.join(mpi_subdir, 'libfabric', 'bin'),
]

if impi_ver >= LooseVersion('2021.11'):
manpath = os.path.join(mpi_subdir, 'share', 'man')
else:
manpath = os.path.join(mpi_subdir, 'man')

if self.cfg['ofi_internal']:
libfabric_dir = os.path.join(mpi_subdir, 'libfabric')
lib_dirs.append(os.path.join(libfabric_dir, 'lib'))
path_dirs.append(os.path.join(libfabric_dir, 'bin'))
guesses['FI_PROVIDER_PATH'] = [os.path.join(libfabric_dir, 'lib', 'prov')]
lib_dirs.append(os.path.join(mpi_subdir, 'libfabric', 'lib'))
path_dirs.append(os.path.join(mpi_subdir, 'libfabric', 'bin'))
fi_provider_path = [os.path.join(mpi_subdir, 'libfabric', 'lib', 'prov')]

elif impi_ver >= LooseVersion('2019'):
path_dirs = [os.path.join('intel64', 'bin')]
# The "release" library is default in v2019. Give it precedence over intel64/lib.
# (remember paths are *prepended*, so the last path in the list has highest priority)
lib_dirs = [os.path.join('intel64', x) for x in ['lib', os.path.join('lib', 'release')]]
lib_dirs = [
os.path.join('intel64', 'lib'),
os.path.join('intel64', 'lib', 'release'),
]
include_dirs = [os.path.join('intel64', 'include')]
path_dirs = [os.path.join('intel64', 'bin')]

if self.cfg['ofi_internal']:
lib_dirs.append(os.path.join('intel64', 'libfabric', 'lib'))
path_dirs.append(os.path.join('intel64', 'libfabric', 'bin'))
guesses['FI_PROVIDER_PATH'] = [os.path.join('intel64', 'libfabric', 'lib', 'prov')]
fi_provider_path = [os.path.join('intel64', 'libfabric', 'lib', 'prov')]

else:
path_dirs = [os.path.join('bin', 'intel64'), 'bin64']
lib_dirs = [os.path.join('lib', 'em64t'), 'lib64']
include_dirs = ['include64']
path_dirs = [os.path.join('bin', 'intel64'), 'bin64']
guesses['MIC_LD_LIBRARY_PATH'] = [os.path.join('mic', 'lib')]

guesses.update({
'PATH': path_dirs,
'LD_LIBRARY_PATH': lib_dirs,
'LIBRARY_PATH': lib_dirs,
'MANPATH': [manpath],
'CPATH': include_dirs,
})

return guesses
mic_library_path = [os.path.join('mic', 'lib')]

self.module_load_environment.PATH = path_dirs
self.module_load_environment.LD_LIBRARY_PATH = lib_dirs
self.module_load_environment.LIBRARY_PATH = lib_dirs
self.module_load_environment.CPATH = include_dirs
self.module_load_environment.MANPATH = [manpath]
if fi_provider_path is not None:
self.module_load_environment.FI_PROVIDER_PATH = fi_provider_path
if mic_library_path is not None:
self.module_load_environment.MIC_LD_LIBRARY_PATH = mic_library_path

return super().make_module_step(*args, **kwargs)

def make_module_extra(self, *args, **kwargs):
"""Overwritten from Application to add extra txt"""
Expand Down
Loading