From fa1ad349a564a124131071039d04e984238f5884 Mon Sep 17 00:00:00 2001 From: jasminium Date: Tue, 27 Aug 2019 13:28:46 +0100 Subject: [PATCH] Move MKL bug fix --- gprMax/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gprMax/__init__.py b/gprMax/__init__.py index 28cc3df2..643af488 100644 --- a/gprMax/__init__.py +++ b/gprMax/__init__.py @@ -7,6 +7,14 @@ Electromagnetic wave propagation simulation software. """ +import os +import sys +# There is a bug with threading and MKL on macOS +# (https://github.com/gprMax/gprMax/issues/195) . Setting the MKL threading +# layer to sequential solves it, but must be done before numpy is imported. +if sys.platform == 'darwin': + os.environ["MKL_THREADING_LAYER"] = 'sequential' + from ._version import __version__ from .cmds_single_use import Discretisation from .cmds_single_use import Domain