我想在我的linux mint 17.2上安装openBLAS来加速一些计算。我按照本教程[1]成功安装了openBLAS和numpy(我使用的是1.9.3版本)。我运行测试程序并得到以下结果:
dotted two (1000,1000) matrices in 167.9 ms
dotted two (4000) vectors in 6.85 us
SVD of (2000,1000) matrix in 2.860 s
Eigendecomp of (1500,1500) matrix in 26.969 s
实际上,当我用sudo apt-get install python-numpy删除numpy和安装的系统numpy时,我得到了以下resutls:
dotted two (1000,1000) matrices in 255.2 ms
dotted two (4000) vectors in 5.77 us
SVD of (2000,1000) matrix in 3.476 s
Eigendecomp of (1500,1500) matrix in 13.271 s
似乎openblas例程比本机blas和lapack慢。什么可能是错的?
这是numpy.show_config()输出:
lapack_opt_info:
libraries = ['openblas']
library_dirs = ['/opt/openblas/lib']
language = f77
blas_opt_info:
libraries = ['openblas']
library_dirs = ['/opt/openblas/lib']
language = f77
openblas_info:
libraries = ['openblas']
library_dirs = ['/opt/openblas/lib']
language = f77
openblas_lapack_info:
libraries = ['openblas']
library_dirs = ['/opt/openblas/lib']
language = f77
blas_mkl_info:
NOT AVAILABLE
我的处理器有4个CPU,每个核心有2个线程。我在运行测试示例时用htop检查了5-6个线程。