Runing OpenMP with Matlab

Greetings,
I have a piece of c code that runs in parallel (OpenMP).
I have wrap the code (.mex64) so that it can be executed in Matlab (R2010b).
However, when executed over matlab (with multiple threads), it takes longer to complete. The problem is not with the size of the data as it happens to be quite big.
Does anyone know the possible cause of this?
Thank you.
-Dwin

댓글 수: 2

Kaustubha Govind
Kaustubha Govind 2011년 4월 4일
Could you provide some statistics about how much longer? How does this scale with the size of data? Note that there is some expected overhead due to marshaling of data in and out of the MEX-file.
James Tursa
James Tursa 2011년 4월 4일
Impossible to say without seeing the code. If a program has poor memory access patterns and you simply slap an OpenMP construct around it then I would expect it to get worse, potentially much worse depending on circumstances. A program with good memory access patterns that is parallelized *might* get better depending on how it scales. Just can't tell without seeing your code.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2011년 4월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by