Does MATLAB auto parallelize

조회 수: 4 (최근 30일)
David Bergman
David Bergman 2012년 7월 28일
I recently started becoming familiar with pfor and the parallel programming toolbox. In discussing this with a colleague it was mentioned that MATLAB may do some parallelizing under the hood.
Is this true?
The reason its important is that we are evaluating performance of prototype algorithms in matlab that are to be converted to C++. Past experience has show that expertly written matlab may come out 2 times faster in C/C++ but matlab written by mortals (not fully vectorized) can gain a factor of 10 or more in speed when rewritten in C/C++.
Thanks for the information.

채택된 답변

Walter Roberson
Walter Roberson 2012년 7월 28일
MATLAB does do some parallelizing under the hood. In particular, for some of the more common array operations, once the array gets "big enough", MATLAB invokes LAPACK or BLAS to do the work. Those two libraries are both optimized and threaded.

추가 답변 (1개)

David Bergman
David Bergman 2012년 7월 28일
Walter, thanks. Can you elaborate on LAPACK and BLAS libs being threaded? does matlab use FORTRAN or C versions of these libs? Do you expect threaded behavior from these libs in C/C++ implementations? Lastly, can one turn this off with some flag?
I guess what I'm really after is a way of verifying algorithm performance honestly. For the applications I'm used to developing we can match performance to a hand count of flops fairly well.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by