Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
263ba87
added some paths to make compilers and libs discoverable
frankwillmore Jan 12, 2021
8cb4227
adding paths to LIBRARY_PATH so compiler wrappers will find -lmpi
frankwillmore Jan 14, 2021
c89813c
set I_MPI_CC=icx, I_MPI_CXX=icpx and I_MPI_FC=ifx in module
frankwillmore Jan 14, 2021
dd3b4a7
setting I_MPI_ROOT
frankwillmore Jan 18, 2021
ce4171d
Update var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
frankwillmore Jan 19, 2021
386ea66
Update var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
frankwillmore Jan 19, 2021
61ca210
Update var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
frankwillmore Jan 19, 2021
d32e600
merging changes
frankwillmore Jan 19, 2021
8c23680
add patching of libmpi.so so that it can find libfabric
frankwillmore Jan 20, 2021
34b452c
cleanup
frankwillmore Jan 20, 2021
bd9417d
moving I_MPI_{CC,CXX,FC} from mpi to compilers module
frankwillmore Jan 26, 2021
e8d0c68
moving I_MPI_{CC,CXX,FC} from mpi to compilers module
frankwillmore Jan 26, 2021
a0795da
clean up comments
frankwillmore Jan 26, 2021
7fea25d
clean up comments
frankwillmore Jan 26, 2021
6589415
Merge branch 'impi' of https://github.com/frankwillmore/spack into impi
frankwillmore Jan 26, 2021
a6dad9d
removed libfabric hard path
frankwillmore Feb 3, 2021
cb10242
Merge branch 'develop' into impi
frankwillmore Feb 3, 2021
579babc
add newline at end of file
frankwillmore Feb 3, 2021
787e956
style: removed newline
frankwillmore Feb 3, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,8 @@ def setup_run_environment(self, env):
env.set('CC', self._join_prefix('bin/icx'))
env.set('CXX', self._join_prefix('bin/icpx'))
env.set('FC', self._join_prefix('bin/ifx'))
# Set these so that MPI wrappers will pick up these compilers
# when this module is loaded.
env.set('I_MPI_CC', 'icx')
env.set('I_MPI_CXX', 'icpx')
env.set('I_MPI_FC', 'ifx')
43 changes: 43 additions & 0 deletions var/spack/repos/builtin/packages/intel-oneapi-mpi/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)


import subprocess

from spack import *

releases = {
Expand All @@ -21,6 +23,8 @@ class IntelOneapiMpi(IntelOneApiLibraryPackage):

provides('mpi@:3')

depends_on('patchelf', type='build')

def __init__(self, spec):
self.component_info(dir_name='mpi',
components='intel.oneapi.lin.mpi.devel',
Expand Down Expand Up @@ -50,3 +54,42 @@ def libs(self):
ldir = find_libraries('*', root=lib_path, shared=True, recursive=False)
libs += ldir
return libs

def _join_prefix(self, path):
return join_path(self.prefix, 'mpi', 'latest', path)

def _ld_library_path(self):
dirs = ['lib',
'lib/release',
'libfabric/lib']
for dir in dirs:
yield self._join_prefix(dir)

def _library_path(self):
dirs = ['lib',
'lib/release',
'libfabric/lib']
for dir in dirs:
yield self._join_prefix(dir)

def install(self, spec, prefix):
super(IntelOneapiMpi, self).install(spec, prefix)

# need to patch libmpi.so so it can always find libfabric
libfabric_rpath = self._join_prefix('libfabric/lib')
for lib_version in ['debug', 'release', 'release_mt', 'debug_mt']:
file = self._join_prefix('lib/' + lib_version + '/libmpi.so')
subprocess.call(['patchelf', '--set-rpath', libfabric_rpath, file])

def setup_run_environment(self, env):
env.prepend_path('PATH', self._join_prefix('bin'))
env.prepend_path('CPATH', self._join_prefix('include'))
for dir in self._library_path():
env.prepend_path('LIBRARY_PATH', dir)
for dir in self._ld_library_path():
env.prepend_path('LD_LIBRARY_PATH', dir)
# so wrappers know where MPI lives
mpi_root = join_path(prefix, 'mpi', 'latest')
env.set('I_MPI_ROOT', mpi_root)
# set this so that wrappers can find libfabric providers
env.set('FI_PROVIDER_PATH', self._join_prefix('libfabric/lib/prov'))