Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Anaconda MKL and threading on macOS

Craig_Warren
Beginner
587 Views

Hi,

I am not sure if this is the correct forum for this, so bear with me!

I am using MKL (2019.1) installed via Miniconda (4.6.8) on macOS (10.14.2). The open source code I develop (gprMax - https://github.com/gprMax/gprMax) is written in Python, uses NumPy, and has modules that are Cythonized and use OpenMP. The conda environment that I use is relatively simple - https://github.com/gprMax/gprMax/blob/master/conda_env.yml On Linux and Windows the simulation software behaves normally, however, on macOS the simulations become unstable. This has only started happening recently when I updated the conda environment. Interestingly, if I set the simulation to use a single thread on macOS it behaves normally and is stable. Also if I use OpenBLAS instead of MKL, by specifying blas=*=openblas in my conda environment file, I have no problems with stability and using multiple threads.

I am interested to know if anyone else has experience similar problems, and also how I might further debug the issue.

Kind regards,

Craig

0 Kudos
1 Reply
Craig_Warren
Beginner
587 Views

So a workaround seems to be setting MKL_THREADING_LAYER=sequential before launching Python. Setting it within the Python application does not work, as I assume it is only being applied to child processes, and whatever module is using MKL has already been loaded.

Craig

0 Kudos
Reply