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

Parallelization in Python #58

Open
langenil opened this issue Feb 14, 2022 · 4 comments
Open

Parallelization in Python #58

langenil opened this issue Feb 14, 2022 · 4 comments

Comments

@langenil
Copy link

Although in the original publication I think it's being stated that the python version features parallelization out of the box, since being only a wrapper for the actual code, I find no remark in the documentation where the steps that are to be taken are addressed. Am I just missing something, or is it not supported yet?

@eromero-vlc
Copy link
Collaborator

PRIMME supports thread parallelization and that is given if PRIMME is compiled with OpenMP and linked with a threaded BLAS (which usually it does). If your are referring to MPI, the current python interface does not export the function globalSumReal, and I will have to check about nLocal. Otherwise it should be ready if the user provides a matvec with MPI. If you are interested in using the python interface with an MPI matvec, please let us know and we can do the changes.

@langenil
Copy link
Author

Thank you for the comment. So when it's installed with standard settings and I have intel one api with BLAS and ifort etc. installed it should support multithreading through openMP. What settings do I have to set when I run my python code to get it run multithreaded?

@eromero-vlc
Copy link
Collaborator

Unfortunately it isn't enough to just have installed a compiler or a blas library into the system. You have to make sure that they are used during the compilation of primme and the python module. Nevertheless, the compiler isn't important and compiling primme with OpenMP gives great speedups only on particular cases. Linking with a threaded blas such as MKL usually gives better performance than with a non-threaded blas on large problems.

Primme's setup.py gets the linking flags for blas (and lapack) from numpy. Depending on your operating system, python distribution (conda or system), and source (pip or from source code), the steps are different to mess with the linking flags. The easiest thing, it is to use conda and install the conda pacakge mkl-devel before primme.

If you give me more details about the installation, I can be more concrete about the steps.

@langenil
Copy link
Author

langenil commented Mar 1, 2022

Sorry for not writing back, I was sick the last two weeks...
So on my installation: Debian 10, Python is installed normally without conda and I installed PRIMME with pip. I have the latest INTEL one api 2022 Version including MKL installed on my system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants