How can I use parallelized code when converting to a .mex file?
古いコメントを表示
Hi all,
I am converting a .m function to .mex in order to increase the speed. There is a loop that I cannot avoid. The conversion works fine and there is an increase of speed of a HUGE magnitude. However, when I build the .mex file using Matlab Coder I always get this message:
"The specified compiler (msvcsdk) does not support the OpenMP library; turning off parallelization."
I guess that parallelization will increase the speed even more (especially since the loop can be parallelized). Does anyone know how can I use the OpenMP library? I use Matlab R2012b, Windows 8, and the compiler I installed is the one from Microsoft Software Development Kit (SDK) 7.1
Thanks!
回答 (2 件)
Sean de Wolski
2013 年 9 月 12 日
0 投票
Hi Carlos,
I would recommend upgrading to R2013b. A lot of new support for parfor was added in this release:
2 件のコメント
Carlos
2013 年 9 月 12 日
Sean de Wolski
2013 年 9 月 12 日
On a campus-wide license, if the SMS is current, upgrading will be free and just require the physical download.
Jan
2013 年 9 月 12 日
0 投票
You need MSVC professional for OpenMP support.
You can find a complicated set of instructions for including the freely available OpenMP runtime libs and an explanantions how to modifying the setup of the free SDK compiler. I did not try this although it seems to be legal to combine different libs and downloads, which can be obtained legally. But for a stable procedure and the possibility to debug the code I'd prefer to buy the professional version of the compiler instead.
3 件のコメント
Carlos
2013 年 9 月 12 日
Fred Smith
2013 年 9 月 12 日
OpenMP is supported by gcc on linux for free. It is not supported by clang on Mac at all.
Jan
2013 年 9 月 12 日
@Carlos: You can check if your university participates on Microsoft's DreamSpark program. I do not understand the required details to participate on DreamSpark in any way, although I've read through https://www.dreamspark.com several times. But all I've found is that there is a chance that students get MSVC professional for free, almost free, a handful of money or perhaps not at all. In every case DreamSpark is extremely interesting, most likely.
カテゴリ
ヘルプ センター および File Exchange で MATLAB Coder についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!