我正在使用Enthought的Canopy / EPD版本的python,它附带了与MKL相关联的numpy。我目前在我的工作计算机(Windows 7,四核i5 @ 3.33 Ghz,4 GB RAM)和我的家庭工作站(Mac Pro 3.1,Ubuntu 12.04,2x四核Xeon)上并行运行一组模拟(使用PP) @ 2.8 Ghz,6 GB ram)。
但是当我对我的模拟进行基准测试时,它们在工作计算机上的运行速度更快(每次迭代35秒,而在mac pro上为60秒)。问题是在核心之间完全平衡(令人尴尬的并行问题),所以我怀疑在家里的linux工作站上存在MKL库的问题。有没有办法验证MKL库实际上是否在python中使用。我已经读过线程,说你可以查看python是否链接到它,但它不能确保它是正确构建的并且实际上正在使用。
答案 0 :(得分:17)
>>> numpy.show_config()
你会看到类似这样的输出,表明MKL确实是链接的。
lapack_opt_info:
libraries = ['mkl_lapack95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'mkl_mc', 'mkl_mc3', 'pthread']
library_dirs = ['/Users/vagrant/src/master-env/Resources/Python.app/Contents/MacOS/../../../../lib']
define_macros = [('SCIPY_MKL_H', None)]
include_dirs = ['/Users/vagrant/src/master-env/Resources/Python.app/Contents/MacOS/../../../../include']
blas_opt_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'mkl_mc', 'mkl_mc3', 'pthread']
library_dirs = ['/Users/vagrant/src/master-env/Resources/Python.app/Contents/MacOS/../../../../lib']
define_macros = [('SCIPY_MKL_H', None)]
include_dirs = ['/Users/vagrant/src/master-env/Resources/Python.app/Contents/MacOS/../../../../include']
openblas_info:
NOT AVAILABLE
lapack_mkl_info:
libraries = ['mkl_lapack95_lp64', 'mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'mkl_mc', 'mkl_mc3', 'pthread']
library_dirs = ['/Users/vagrant/src/master-env/Resources/Python.app/Contents/MacOS/../../../../lib']
define_macros = [('SCIPY_MKL_H', None)]
include_dirs = ['/Users/vagrant/src/master-env/Resources/Python.app/Contents/MacOS/../../../../include']
blas_mkl_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'mkl_mc', 'mkl_mc3', 'pthread']
library_dirs = ['/Users/vagrant/src/master-env/Resources/Python.app/Contents/MacOS/../../../../lib']
define_macros = [('SCIPY_MKL_H', None)]
include_dirs = ['/Users/vagrant/src/master-env/Resources/Python.app/Contents/MacOS/../../../../include']
mkl_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'mkl_mc', 'mkl_mc3', 'pthread']
library_dirs = ['/Users/vagrant/src/master-env/Resources/Python.app/Contents/MacOS/../../../../lib']
define_macros = [('SCIPY_MKL_H', None)]
include_dirs = ['/Users/vagrant/src/master-env/Resources/Python.app/Contents/MacOS/../../../../include']