Using Intel MKL with MATLAB - Matlab使用多核CPU
2010-07-04 21:11
337 查看
1. Overview
This guide is intended to help Intel® Math Kernel Library (Intel® MKL) customers use the latest version of Intel® MKL for Windows* with The MathWorks* MATLAB*.
MATLAB is an interactive software program that performs mathematical computations and visualization. For more information about MATLAB visit www.mathworks.com/products/matlab.
Version Information
This note was created to help users of MATLAB R2008a make use of Intel MKL 10.0.x.
2. Dependencies
Software
This note applies to MATLAB R2008a and Intel MKL 10.0.x
Hardware
The note should work for all hardware configurations that meet the system requirements for both MATLAB R2008a and Intel MKL 10.0.x. This note has been tested on Intel® Core®2 Duo processors.
Operating System
This note should work for Windows* users of MATLAB.
3. Obtaining the Latest Version of Intel MKL
The latest release of the Intel Math Kernel Library is available at www.intel.com/software/products/mkl. You can download the latest Intel MKL if you have a valid license. You can also obtain the latest version by renewing your current license or registering for a free 30-day evaluation.
4. Building a Custom DLL
By default, MATLAB R2008a uses the uses the Intel MKL 9.1 Basic Linear Algebra Subroutines (BLAS) libraries to perform computations. To upgrade to the Intel MKL 10.0.x release, you need to create a DLL using the Intel MKL 10.x or later custom DLL builder located in MKL\10.0\tools\builder:
Scroll to the bottom of this page and download the attached file matlab_custom_dll.zip.
Extract and copy the files from matlab_custom_dll.zip and copy them to MKL\10.0\tools\builder. It may be preferrable to save the old ones by renaming them or moving them to a temporary folder.
The custom DLL is built from the command line via a makefile. Set the command environment as appropriate for your compiler.
To start the Intel® Compiler Command Line Windows, from the Start Menu select Programs>> Intel(R) Software Development Tools >> Intel(R) Compiler [version] >> Build Environment for...
To Start the Microsoft® Compier, from the Start Menu seletc Programs>>Microsoft Visual Studio 2005(8)>> Visual Studio Tools>> Visual Studio 2005 Command Prompt
Build the custom DLL with the following command nmake ia32. For additional options such as customizing the name of the DLL, please refer to the Intel MKL User Guide (located at MKL\10.0\doc\userguide.pdf) section "Building Custom DLL".
You will find the resulting file at MKL\10.0\tools\builder\mkl_custom.dll.
5. MATLAB Configuration
Modify the system environment so that MATLAB uses the Intel MKL BLAS functions from the custom DLL. Set the BLAS_VERSION environment variable by following the steps on Windows XP:
Click Start, go to the Settings menu and select Control Panel.
Select System to open the System Properties dialog box.
Click the Advanced tab.
Click the Environment Variables button to open the Environment Variables dialog box.
Under the User variables section, click the New button to open the New User Variable dialog box.
Set the name of the variable to BLAS_VERSION and set the value of the variable to mkl_custom.dll.
Multiprocessor Performance
Intel MKL multi-threading mode is disabled by default. To benefit from Intel multi-core processors, enable multi-threading mode by following the steps above. Set the name of the environment variable to OMP_NUM_THREADS and set the value of the variable to the number of processors you want to use in your application.
6. Running MATLAB
Start MATLAB R2008a as you normally would and the Intel MKL BLAS library will be called.
7. Verifying Correctness
From MATLAB, run the command version -modules and check the output list to verify that the custom DLL is loaded.
8. Troubleshooting
The error "The specified module could not be found." occurs for two cases:
One or more of the required interfaces is missing from the custom DLL
Solution: Follow the steps in section 4 and rebuild the custom DLL.
The custom DLL is not found.
Solution: Verify that the path to and the name of the custom DLL is correct (see section 5).
This guide is intended to help Intel® Math Kernel Library (Intel® MKL) customers use the latest version of Intel® MKL for Windows* with The MathWorks* MATLAB*.
MATLAB is an interactive software program that performs mathematical computations and visualization. For more information about MATLAB visit www.mathworks.com/products/matlab.
Version Information
This note was created to help users of MATLAB R2008a make use of Intel MKL 10.0.x.
2. Dependencies
Software
This note applies to MATLAB R2008a and Intel MKL 10.0.x
Hardware
The note should work for all hardware configurations that meet the system requirements for both MATLAB R2008a and Intel MKL 10.0.x. This note has been tested on Intel® Core®2 Duo processors.
Operating System
This note should work for Windows* users of MATLAB.
3. Obtaining the Latest Version of Intel MKL
The latest release of the Intel Math Kernel Library is available at www.intel.com/software/products/mkl. You can download the latest Intel MKL if you have a valid license. You can also obtain the latest version by renewing your current license or registering for a free 30-day evaluation.
4. Building a Custom DLL
By default, MATLAB R2008a uses the uses the Intel MKL 9.1 Basic Linear Algebra Subroutines (BLAS) libraries to perform computations. To upgrade to the Intel MKL 10.0.x release, you need to create a DLL using the Intel MKL 10.x or later custom DLL builder located in MKL\10.0\tools\builder:
Scroll to the bottom of this page and download the attached file matlab_custom_dll.zip.
Extract and copy the files from matlab_custom_dll.zip and copy them to MKL\10.0\tools\builder. It may be preferrable to save the old ones by renaming them or moving them to a temporary folder.
The custom DLL is built from the command line via a makefile. Set the command environment as appropriate for your compiler.
To start the Intel® Compiler Command Line Windows, from the Start Menu select Programs>> Intel(R) Software Development Tools >> Intel(R) Compiler [version] >> Build Environment for...
To Start the Microsoft® Compier, from the Start Menu seletc Programs>>Microsoft Visual Studio 2005(8)>> Visual Studio Tools>> Visual Studio 2005 Command Prompt
Build the custom DLL with the following command nmake ia32. For additional options such as customizing the name of the DLL, please refer to the Intel MKL User Guide (located at MKL\10.0\doc\userguide.pdf) section "Building Custom DLL".
You will find the resulting file at MKL\10.0\tools\builder\mkl_custom.dll.
5. MATLAB Configuration
Modify the system environment so that MATLAB uses the Intel MKL BLAS functions from the custom DLL. Set the BLAS_VERSION environment variable by following the steps on Windows XP:
Click Start, go to the Settings menu and select Control Panel.
Select System to open the System Properties dialog box.
Click the Advanced tab.
Click the Environment Variables button to open the Environment Variables dialog box.
Under the User variables section, click the New button to open the New User Variable dialog box.
Set the name of the variable to BLAS_VERSION and set the value of the variable to mkl_custom.dll.
Multiprocessor Performance
Intel MKL multi-threading mode is disabled by default. To benefit from Intel multi-core processors, enable multi-threading mode by following the steps above. Set the name of the environment variable to OMP_NUM_THREADS and set the value of the variable to the number of processors you want to use in your application.
6. Running MATLAB
Start MATLAB R2008a as you normally would and the Intel MKL BLAS library will be called.
7. Verifying Correctness
From MATLAB, run the command version -modules and check the output list to verify that the custom DLL is loaded.
8. Troubleshooting
The error "The specified module could not be found." occurs for two cases:
One or more of the required interfaces is missing from the custom DLL
Solution: Follow the steps in section 4 and rebuild the custom DLL.
The custom DLL is not found.
Solution: Verify that the path to and the name of the custom DLL is correct (see section 5).
相关文章推荐
- Intel® MKL with Numpy, Scipy, Matlab, C#, Python, NAG and more
- Caffe:CPU模式下使用Intel MKL做mnist训练
- linux top命令查看内存及多核CPU的使用讲述【转】
- 配置Nginx多核CPU,worker_cpu_affinity使用方法和范例
- 高性能Numpy/Scipy加速:使用Intel MKL和Intel Compilers或OpenBLAS(待续)
- 多核新观念-象使用内存一样使用CPU?
- 利用Eclipse使用Java OpenCV(Using OpenCV Java with Eclipse)
- 在自定义指令中使用NgModelController(Using NgModelController with Custom Directives)
- 多核新观念-象使用内存一样使用CPU?
- [转载]在Eclipse中使用 JUnit(Using JUnit With Eclipse IDE)
- C++ openmp并行程序在多核linux上如何最大化使用cpu
- 在Ionic 2中使用TypeScript使用第三方cordova插件(Using a third-party cordova plugin in Ionic 2 with TypeScript)
- 高性能Numpy/Scipy:使用Intel MKL和Intel Compilers
- 在Eclipse中使用PHPUnit进行单元测试 | Using PHPUnit with eclipse
- REST with Java (JAX-RS) using Jersey - Tutorial(使用REST的Jersey与Java(JAX-RS)-教程)
- 配置Nginx多核CPU,worker_cpu_affinity使用方法和范例
- Using Intel® C++ Compiler with the Eclipse* IDE on Linux*
- Matlab 多核 多个CPU 并行运算
- 在 python3.5 下使用 Caffe Using Caffe with Python3.5
- 多核新观念-象使用内存一样使用CPU?