确保numpy在Mac Pro上使用MKL库 [英] Make sure numpy is using MKL library on mac pro

查看:617
本文介绍了确保numpy在Mac Pro上使用MKL库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Enthought的Canopy/EPD版本的python,该版本随附与MKL关联的numpy.我目前在我的工作计算机(Windows 7,Quad Core i5 @ 3.33 Ghz,4 GB内存)和家庭工作站(Mac Pro 3.1,Ubuntu 12.04、2x Quad Core Xeon)上并行(使用PP)运行一组模拟. @ 2.8 Ghz,6 GB内存).

I am using Enthought's Canopy/EPD version of python which ships with numpy linked against MKL. I am currently running a set of simulations in parallel (using PP) on both my work computer (Windows 7, Quad Core i5 @ 3.33 Ghz, 4 GB ram) and my home workstation (Mac Pro 3.1, Ubuntu 12.04, 2x Quad Core Xeon @ 2.8 Ghz, 6 GB ram).

但是,当我对模拟进行基准测试时,它们在工作计算机上的运行速度要快得多(每次迭代需要35秒,而Mac pro则需要60秒).这个问题在内核之间得到了完美的平衡(令人尴尬的并行问题),所以我怀疑家里的Linux工作站上的MKL库存在问题.有没有一种方法可以验证MKL库是否确实在python中使用.我读过一些说可以检查python是否链接到它的线程,但是它不能确保它正确构建并且正在实际使用中.

But when I benchmark my simulations, they run much quicker on the work computer (35 seconds per iteration vs. 60 on the mac pro). The problem is being perfectly balanced between cores (embarrassingly parallel problem), so I suspect there is an issue with the MKL library on the linux workstation at home. Is there a way to verify that the MKL library is actually being used in python. I've read threads that say you can check to see if python is linked to it, but it doesn't ensure that it was built correctly and is actually being used.

推荐答案

>>> numpy.show_config()

您将看到类似这样的输出,表明MKL确实已链接.

You will see output something like this, showing that MKL is indeed linked.

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']

这篇关于确保numpy在Mac Pro上使用MKL库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆