Open3D breaks available threads for MKL on macOS
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
**Describe the bug**
Importing Open3D on macOS changes the available threads for following MKL calls and prevents from setting them. This doesn't seem to occur on Linux.
**To Reproduce**
Steps to reproduce the behavior:
```
conda create -n myenv python=3.7 mkl-service
conda activate myenv
pip install open3d
```
Execute the following:
```
import mkl
import open3d as o3d
print(mkl.domain_get_max_threads(domain='all'))
print(mkl.get_max_threads())
mkl.domain_set_num_threads(4, domain='all')
print(mkl.domain_get_max_threads(domain='all'))
```
Output
```
1
8
1
```
while
```
import mkl
print(mkl.domain_get_max_threads(domain='all'))
import open3d as o3d
print(mkl.get_max_threads())
mkl.domain_set_num_threads(4, domain='all')
print(mkl.domain_get_max_threads(domain='all'))
```
gives the expected
```
8
8
4
```
**Expected behavior**
Importing Open3D should not change the threads that can be used by mkl (e.g. vml, fft).
**Environment:**
- Operating system: OSX 11.01
- Python version: 3.7.9
- Open3D version: 0.12.0
- Is this remote workstation?: no
- How did you install Open3D?: pip, see above
**Additional context**
Works as expected on Ubuntu 18.04.4
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.