Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions easybuild/toolchains/fft/intelfftw.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ def _set_fftw_variables(self):
# so make sure libraries are there before FFT_LIB is set
imklroot = get_software_root(self.FFT_MODULE_NAME[0])
fft_lib_dirs = [os.path.join(imklroot, d) for d in self.FFT_LIB_DIR]
imklfftwroot = get_software_root('imkl-FFTW')
if imklfftwroot:
# only get cluster_interface_lib from seperate module imkl-FFTW, rest via libmkl_gf/libmkl_intel
fft_lib_dirs += [os.path.join(imklfftwroot, 'lib')]
fftw_libs.remove(interface_lib)
fftw_mt_libs.remove(interface_lib)

def fftw_lib_exists(libname):
"""Helper function to check whether FFTW library with specified name exists."""
Expand Down
2 changes: 1 addition & 1 deletion test/framework/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@


# number of modules included for testing purposes
TEST_MODULES_COUNT = 82
TEST_MODULES_COUNT = 87


class ModulesTest(EnhancedTestCase):
Expand Down
31 changes: 31 additions & 0 deletions test/framework/modules/imkl-FFTW/2021.4.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#%Module
proc ModulesHelp { } {
puts stderr {

Description
===========
FFTW interfaces using Intel oneAPI Math Kernel Library


More information
================
- Homepage: https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html
}
}

module-whatis {Description: FFTW interfaces using Intel oneAPI Math Kernel Library}
module-whatis {Homepage: https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html}
module-whatis {URL: https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html}

set root /tmp/imkl-FFTW/2021.4.0

conflict imkl-FFTW

prepend-path CMAKE_PREFIX_PATH $root
prepend-path LD_LIBRARY_PATH $root/lib
prepend-path LIBRARY_PATH $root/lib
setenv EBROOTIMKLMINFFTW "$root"
setenv EBVERSIONIMKLMINFFTW "2021.4.0"
setenv EBDEVELIMKLMINFFTW "$root/easybuild/imkl-FFTW-2021.4.0-easybuild-devel"

# Built with EasyBuild version 4.5.0dev
37 changes: 37 additions & 0 deletions test/framework/modules/imkl/2021.4.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#%Module
proc ModulesHelp { } {
puts stderr {

Description
===========
Intel oneAPI Math Kernel Library


More information
================
- Homepage: https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html
}
}

module-whatis {Description: Intel oneAPI Math Kernel Library}
module-whatis {Homepage: https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html}
module-whatis {URL: https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html}

set root /tmp/eb-bI0pBy/eb-DmuEpJ/eb-leoYDw/eb-UtJJqp/tmp8P3FOY

conflict imkl

prepend-path CMAKE_PREFIX_PATH $root
prepend-path CPATH $root/mkl/2021.4.0/include
prepend-path CPATH $root/mkl/2021.4.0/include/fftw
prepend-path LD_LIBRARY_PATH $root/compiler/2021.4.0/linux/compiler/lib/intel64_lin
prepend-path LD_LIBRARY_PATH $root/mkl/2021.4.0/lib/intel64
prepend-path LIBRARY_PATH $root/compiler/2021.4.0/linux/compiler/lib/intel64_lin
prepend-path LIBRARY_PATH $root/mkl/2021.4.0/lib/intel64
setenv EBROOTIMKL "$root"
setenv EBVERSIONIMKL "2021.4.0"
setenv EBDEVELIMKL "$root/easybuild/Core-imkl-2021.4.0-easybuild-devel"

setenv MKL_EXAMPLES "$root/mkl/2021.4.0/examples"
setenv MKLROOT "$root/mkl/2021.4.0"
# Built with EasyBuild version 4.5.0dev
42 changes: 42 additions & 0 deletions test/framework/modules/impi/2021.4.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#%Module
proc ModulesHelp { } {
puts stderr {

Description
===========
Intel MPI Library, compatible with MPICH ABI


More information
================
- Homepage: https://software.intel.com/content/www/us/en/develop/tools/mpi-library.html
}
}

module-whatis {Description: Intel MPI Library, compatible with MPICH ABI}
module-whatis {Homepage: https://software.intel.com/content/www/us/en/develop/tools/mpi-library.html}
module-whatis {URL: https://software.intel.com/content/www/us/en/develop/tools/mpi-library.html}

set root /tmp/impi/2021.4.0

conflict impi

prepend-path CMAKE_PREFIX_PATH $root
prepend-path CPATH $root/mpi/2021.4.0/include
prepend-path FI_PROVIDER_PATH $root/mpi/2021.4.0/libfabric/lib/prov
prepend-path LD_LIBRARY_PATH $root/mpi/2021.4.0/lib
prepend-path LD_LIBRARY_PATH $root/mpi/2021.4.0/lib/release
prepend-path LD_LIBRARY_PATH $root/mpi/2021.4.0/libfabric/lib
prepend-path LIBRARY_PATH $root/mpi/2021.4.0/lib
prepend-path LIBRARY_PATH $root/mpi/2021.4.0/lib/release
prepend-path LIBRARY_PATH $root/mpi/2021.4.0/libfabric/lib
prepend-path MANPATH $root/mpi/2021.4.0/man
prepend-path PATH $root/mpi/2021.4.0/bin
prepend-path PATH $root/mpi/2021.4.0/libfabric/bin
setenv EBROOTIMPI "$root"
setenv EBVERSIONIMPI "2021.4.0"
setenv EBDEVELIMPI "$root/easybuild/impi-2021.4.0-easybuild-devel"

setenv I_MPI_ROOT "$root/mpi/2021.4.0"
setenv UCX_TLS "all"
# Built with EasyBuild version 4.5.0dev
41 changes: 41 additions & 0 deletions test/framework/modules/intel-compilers/2021.4.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#%Module
proc ModulesHelp { } {
puts stderr {

Description
===========
Intel C, C++ & Fortran compilers (classic and oneAPI)


More information
================
- Homepage: https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit.html
}
}

module-whatis {Description: Intel C, C++ & Fortran compilers (classic and oneAPI)}
module-whatis {Homepage: https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit.html}
module-whatis {URL: https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit.html}

set root /tmp/intel-compilers/2021.4.0

conflict intel-compilers

prepend-path CPATH $root/tbb/2021.4.0/include
prepend-path LD_LIBRARY_PATH $root/compiler/2021.4.0/linux/lib
prepend-path LD_LIBRARY_PATH $root/compiler/2021.4.0/linux/lib/x64
prepend-path LD_LIBRARY_PATH $root/compiler/2021.4.0/linux/compiler/lib/intel64_lin
prepend-path LD_LIBRARY_PATH $root/tbb/2021.4.0/lib/intel64/gcc4.8
prepend-path LIBRARY_PATH $root/compiler/2021.4.0/linux/lib
prepend-path LIBRARY_PATH $root/compiler/2021.4.0/linux/lib/x64
prepend-path LIBRARY_PATH $root/compiler/2021.4.0/linux/compiler/lib/intel64_lin
prepend-path LIBRARY_PATH $root/tbb/2021.4.0/lib/intel64/gcc4.8
prepend-path OCL_ICD_FILENAMES $root/compiler/2021.4.0/linux/lib/x64/libintelocl.so
prepend-path PATH $root/compiler/2021.4.0/linux/bin
prepend-path PATH $root/compiler/2021.4.0/linux/bin/intel64
prepend-path TBBROOT $root/tbb/2021.4.0
setenv EBROOTINTELMINCOMPILERS "$root"
setenv EBVERSIONINTELMINCOMPILERS "2021.4.0"
setenv EBDEVELINTELMINCOMPILERS "$root/easybuild/Core-intel-compilers-2021.4.0-easybuild-devel"

# Built with EasyBuild version 4.5.0dev
36 changes: 36 additions & 0 deletions test/framework/modules/intel/2021b
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#%Module

proc ModulesHelp { } {
puts stderr { Intel Cluster Toolkit Compiler Edition provides Intel C/C++ and Fortran compilers, Intel MPI & Intel MKL. - Homepage: http://software.intel.com/en-us/intel-cluster-toolkit-compiler/
}
}

module-whatis {Intel Cluster Toolkit Compiler Edition provides Intel C/C++ and Fortran compilers, Intel MPI & Intel MKL. - Homepage: http://software.intel.com/en-us/intel-cluster-toolkit-compiler/}

set root /tmp/intel/2021b

conflict intel

if { ![is-loaded intel-compilers/2021.4.0] } {
module load intel-compilers/2021.4.0
}

if { ![is-loaded impi/2021.4.0] } {
module load impi/2021.4.0
}

if { ![is-loaded imkl/2021.4.0] } {
module load imkl/2021.4.0
}

if { ![is-loaded imkl-FFTW/2021.4.0] } {
module load imkl-FFTW/2021.4.0
}


setenv EBROOTINTEL "$root"
setenv EBVERSIONINTEL "2021b"
setenv EBDEVELINTEL "$root/easybuild/intel-2021b-easybuild-devel"


# built with EasyBuild version 4.5.0dev
87 changes: 83 additions & 4 deletions test/framework/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,7 @@ def test_fft_env_vars_foss(self):
def test_fft_env_vars_intel(self):
"""Test setting of $FFT* environment variables using intel toolchain."""

self.modtool.purge()
self.setup_sandbox_for_intel_fftw(self.test_prefix)
self.modtool.prepend_module_path(self.test_prefix)

Expand Down Expand Up @@ -1079,6 +1080,64 @@ def test_fft_env_vars_intel(self):
libfft_mt += '-Wl,-Bdynamic -liomp5 -lpthread'
self.assertEqual(tc.get_variable('LIBFFT_MT'), libfft_mt)

self.modtool.purge()
self.setup_sandbox_for_intel_fftw(self.test_prefix, imklver='2021.4.0')
tc = self.get_toolchain('intel', version='2021b')
tc.prepare()

fft_static_libs = 'libmkl_intel_lp64.a,libmkl_sequential.a,libmkl_core.a'
self.assertEqual(tc.get_variable('FFT_STATIC_LIBS'), fft_static_libs)
self.assertEqual(tc.get_variable('FFTW_STATIC_LIBS'), fft_static_libs)

fft_static_libs_mt = 'libmkl_intel_lp64.a,libmkl_intel_thread.a,libmkl_core.a,'
fft_static_libs_mt += 'libiomp5.a,libpthread.a'
self.assertEqual(tc.get_variable('FFT_STATIC_LIBS_MT'), fft_static_libs_mt)
self.assertEqual(tc.get_variable('FFTW_STATIC_LIBS_MT'), fft_static_libs_mt)

libfft = "-Wl,-Bstatic -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core "
libfft += "-Wl,--end-group -Wl,-Bdynamic"
self.assertEqual(tc.get_variable('LIBFFT'), libfft)

libfft_mt = "-Wl,-Bstatic -Wl,--start-group -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core "
libfft_mt += "-Wl,--end-group -Wl,-Bdynamic -liomp5 -lpthread"
self.assertEqual(tc.get_variable('LIBFFT_MT'), libfft_mt)

tc = self.get_toolchain('intel', version='2021b')
tc.set_options({'openmp': True})
tc.prepare()

self.assertEqual(tc.get_variable('FFT_STATIC_LIBS'), fft_static_libs)
self.assertEqual(tc.get_variable('FFTW_STATIC_LIBS'), fft_static_libs)

self.assertEqual(tc.get_variable('FFT_STATIC_LIBS_MT'), fft_static_libs_mt)
self.assertEqual(tc.get_variable('FFTW_STATIC_LIBS_MT'), fft_static_libs_mt)

self.assertEqual(tc.get_variable('LIBFFT'), libfft)
self.assertEqual(tc.get_variable('LIBFFT_MT'), libfft_mt)

tc = self.get_toolchain('intel', version='2021b')
tc.set_options({'usempi': True})
tc.prepare()

fft_static_libs = 'libfftw3x_cdft_lp64.a,libmkl_cdft_core.a,libmkl_blacs_intelmpi_lp64.a,'
fft_static_libs += 'libmkl_intel_lp64.a,libmkl_sequential.a,libmkl_core.a'
self.assertEqual(tc.get_variable('FFT_STATIC_LIBS'), fft_static_libs)
self.assertEqual(tc.get_variable('FFTW_STATIC_LIBS'), fft_static_libs)

fft_static_libs_mt = 'libfftw3x_cdft_lp64.a,libmkl_cdft_core.a,libmkl_blacs_intelmpi_lp64.a,'
fft_static_libs_mt += 'libmkl_intel_lp64.a,libmkl_intel_thread.a,libmkl_core.a,libiomp5.a,libpthread.a'
self.assertEqual(tc.get_variable('FFT_STATIC_LIBS_MT'), fft_static_libs_mt)
self.assertEqual(tc.get_variable('FFTW_STATIC_LIBS_MT'), fft_static_libs_mt)

libfft = '-Wl,-Bstatic -Wl,--start-group -lfftw3x_cdft_lp64 -lmkl_cdft_core '
libfft += '-lmkl_blacs_intelmpi_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -Wl,-Bdynamic'
self.assertEqual(tc.get_variable('LIBFFT'), libfft)

libfft_mt = '-Wl,-Bstatic -Wl,--start-group -lfftw3x_cdft_lp64 -lmkl_cdft_core '
libfft_mt += '-lmkl_blacs_intelmpi_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group '
libfft_mt += '-Wl,-Bdynamic -liomp5 -lpthread'
self.assertEqual(tc.get_variable('LIBFFT_MT'), libfft_mt)

def test_fosscuda(self):
"""Test whether fosscuda is handled properly."""
tc = self.get_toolchain("fosscuda", version="2018a")
Expand Down Expand Up @@ -1124,17 +1183,37 @@ def setup_sandbox_for_intel_fftw(self, moddir, imklver='2018.1.163'):
])
write_file(imkl_module_path, imkl_mod_txt)

fftw_libs = ['fftw3xc_intel', 'fftw3xc_pgi', 'mkl_cdft_core', 'mkl_blacs_intelmpi_lp64']
fftw_libs += ['mkl_intel_lp64', 'mkl_sequential', 'mkl_core', 'mkl_intel_ilp64']
mkl_libs = ['mkl_cdft_core', 'mkl_blacs_intelmpi_lp64']
mkl_libs += ['mkl_intel_lp64', 'mkl_sequential', 'mkl_core', 'mkl_intel_ilp64']
fftw_libs = ['fftw3xc_intel', 'fftw3xc_pgi']
if LooseVersion(imklver) >= LooseVersion('11'):
fftw_libs.extend(['fftw3x_cdft_ilp64', 'fftw3x_cdft_lp64'])
else:
fftw_libs.append('fftw3x_cdft')

for subdir in ['mkl/lib/intel64', 'compiler/lib/intel64', 'lib/em64t']:
if LooseVersion(imklver) >= LooseVersion('2021.4.0'):
imkl_fftw_module_path = os.path.join(moddir, 'imkl-FFTW', imklver)
imkl_fftw_dir = os.path.join(self.test_prefix, 'software', 'imkl-FFTW', imklver)
imkl_fftw_mod_txt = '\n'.join([
"#%Module",
"setenv EBROOTIMKLMINFFTW %s" % imkl_fftw_dir,
"setenv EBVERSIONIMKLMINFFTW %s" % imklver,
])
write_file(imkl_fftw_module_path, imkl_fftw_mod_txt)

subdir = 'mkl/%s/lib/intel64' % imklver
os.makedirs(os.path.join(imkl_dir, subdir))
for fftlib in fftw_libs:
for fftlib in mkl_libs:
write_file(os.path.join(imkl_dir, subdir, 'lib%s.a' % fftlib), 'foo')
subdir = 'lib'
os.makedirs(os.path.join(imkl_fftw_dir, subdir))
for fftlib in fftw_libs:
write_file(os.path.join(imkl_fftw_dir, subdir, 'lib%s.a' % fftlib), 'foo')
else:
for subdir in ['mkl/lib/intel64', 'compiler/lib/intel64', 'lib/em64t']:
os.makedirs(os.path.join(imkl_dir, subdir))
for fftlib in mkl_libs + fftw_libs:
write_file(os.path.join(imkl_dir, subdir, 'lib%s.a' % fftlib), 'foo')

def test_intel_toolchain(self):
"""Test for intel toolchain."""
Expand Down