OpenMP incompatible with LAPACK & BLAS routines

I've written a few c mex files and have called dsyev to find eigenvalues etc. I want to call this routine in parallel in a threaded loop. Everything compiles OK without warnings (using MS Visual Studio Prof. Edition 2005).
However, when I call it from Matlab it just crashes, without any error messages...
Anyone have any ideas?!?
Thanks in advance
Adam

5 Kommentare

James Tursa
James Tursa am 26 Feb. 2011
Well, I think your title already says it. The LAPACK and BLAS libraries that ship with MATLAB are probably not thread-safe. However, many of the routines in these libraries are already multi-threaded, so I don't know how much speed up you would get even if they were thread-safe.
Adam connolly
Adam connolly am 26 Feb. 2011
OK thanks anyway. Thing is, I'm calling them on loads of little matrices which are built in a loop, so want the loop to run in parallel. Think maybe a rewrite in straight c or fortran may be the way forward!
James Tursa
James Tursa am 5 Mär. 2011
I should have asked this before, but are you sure your C code for calling dsyev is correct (argument type, etc)? Can you run it in a single thread to verify that it is coded correctly?
zhuanyi
zhuanyi am 31 Mär. 2024
Hi Adam, do you have any update? I am facing the same problem.
James Tursa
James Tursa am 2 Apr. 2024
Bearbeitet: James Tursa am 2 Apr. 2024
@zhuanyi Can you open a new Question, and maybe include a minimal complete example that reproduces the problem?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Jill Reese
Jill Reese am 4 Mär. 2011

0 Stimmen

Running your original mex function within a MATLAB Parallel Computing Toolbox parfor loop might give you the parallelism you want.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Produkte

Gefragt:

am 26 Feb. 2011

Bearbeitet:

am 2 Apr. 2024

Community Treasure Hunt

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

Start Hunting!

Translated by