-
Notifications
You must be signed in to change notification settings - Fork 216
support use of linalg without MPI, add iimkl toolchain definition #2082
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
Conversation
This is possible for non-MPI FFTW3 since those functions are included in the main MKL library binaries (see https://software.intel.com/en-us/articles/intel-mkl-main-libraries-contain-fftw3-interfaces )
This is useful in a compiler x MPI hierarchy since applications that use linalg but no MPI (e.g. numpy) can be put at the compiler level.
| check_fftw_libs.pop(0) | ||
| # and reduce functionality with MPI if wrappers are not built | ||
| if check_fftw_libs[0].startswith("fftw3x_cdft"): | ||
| check_fftw_libs.pop(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this is very dependent on the order in check_fftw_libs...
Can we make things more direct, by comparing directly with what should be removed from check_fftw_libs rather than making assumptions on order?
It's also not very clear to me what's going on here, can you clarify @bartoldeman?
easybuild/tools/toolchain/linalg.py
Outdated
| self._set_lapack_variables() | ||
| self._set_blacs_variables() | ||
| self._set_scalapack_variables() | ||
| if self.options.get('usempi', False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I feel we need a more direct check on whether or not the toolchain definition includes MPI or not, rather than relying on toolchain options...
Maybe check if the MPI_MODULE_NAME attribute is defined (and if it's not None)?
if hasattr(self, 'MPI_MODULE_NAME') and getattr(self, 'MPI_MODULE_NAME') is not None:
self._set_blacs_variables()
self._set_scalapack_variables()|
@bartoldeman One of the tests was broken, since This signifies a backward-incompatible change, some easyblocks may expect that Maybe we should just define these variables as empty rather than not defining them (which is very different in practice)? |
|
Actually from looking into the logs the test failed for goolfc. I have pushed the getattr change suggested by you (with a minor syntax change, as getattr accepts a default argument). We will see if that fixes the tests. I don't think iccifort defines $LIBSCALAPACK right? |
|
@bartoldeman Yes, you're right, my apologies, I was misled by the name of the test that was failing. |
| elif LooseVersion(imklver) >= LooseVersion("10.3"): | ||
| fftw_libs.append("fftw3x_cdft%s" % picsuff) | ||
| cluster_interface_lib = "fftw3x_cdft%s" % picsuff | ||
| fftw_libs.append(cluster_interface_lib) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about simplifying this a bit while we're at it:
if LooseVersion(imklver) >= LooseVersion('10.3'):
suff = picsuff
if LooseVersion(imklver) >= LooseVersion('11.0.2'):
suff = bitsuff + suff
cluster_interface_lib = 'fftw3x_cdft%s' % suff
fftw_libs.append(cluster_interface_lib)| # See https://software.intel.com/en-us/articles/intel-mkl-main-libraries-contain-fftw3-interfaces | ||
| # The cluster interface libs (libfftw3x_cdft*) can be omitted if the toolchain does not provide MPI-FFTW | ||
| # interfaces. | ||
| check_fftw_libs = [lib for lib in check_fftw_libs if lib != interface_lib and lib != cluster_interface_lib] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please change to:
check_fftw_libs = [l for l in check_fftw_libs if l not in [interface_lib, cluster_interface_lib]]|
@bartoldeman looks OK now, just a couple of code style suggestions This will need to be tested thoroughly though... Good candidates are builds using the |
|
@bartoldeman looks good now, how extensively have you tested this (with which easyconfigs)? |
|
So far tested with an iomkl toolchain with imkl at the bottom ('dummy':'dummy'), compiled boost, gromacs, hpl, fftw (iomkl) python, R (iimkl, without mpi4py/Rmpi). We will do a lot more this week (Compute Canada software installation hackathon this Thursday) so I will let you know. I think CP2K and QuantumESPRESSO both need to be installed. |
|
I'm testing this with numpy, CP2K, QuantumESPRESSO, Wien2k and XCrySDen, all of which rely on If those tests work out well (and I expect them too), I'll go ahead and merge this. |
|
Tests worked out well as expected, so no reason to hold this back further. Thanks @bartoldeman! |
PR easybuilders#2082 allowed the use of MKL without interface libraries (useful if neither FFTW2 nor MPI are needed in compiler+linalg toolchains without MPI). However I forgot to adjust fftw_libs and so the LIBFFT environment variable still included the non-existing interface libraries. This patch corrects this issue.
The motivation for this request is that at Compute Canada we'd like to install MKL at the core level.
However that means we have to set interfaces = False in the mkl easyconfig.
Since non-MPI FFTW3 interfaces are already included in MKL without compiling interfaces this MKL can be used in toolchains except when MPI-FFTW3 is required (and I don't think many applications use MPI-FFTW3? I should look up some examples).
Another advantage is that one can construct compiler+linalg+fftw toolchains without MPI which is useful for compiler x MPI hierarchies.