This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to disable OMP threading in Eigen

Tags: None
(comma "," separated)
danny.bickson
Registered Member
Posts
4
Karma
0
Hi!
We are using Eigen as part of our GraphLab project (http://graphlab.org).
We utilize many computation threads that does computation in parallel. When trying to call
ls_solve from several threads in parallel our program deadlocks. I tried version 3.0.2, 3.0.5
and 3.1.0-alph2 and saw this behavior in all versions. However, when we set
omp_set_num_threads(1) in our main function, namely allow only one open mp threads everything works fine, even when we work with many threads. Furthermore, when we change Eigen to It++ based implementation everything works fine.

Now to the question. Is there a way to disable parallel threaded solutions in Eigen? We would like to handle paralllelization ourselves by running many single threaded Eigen instances at once.
This looks very much like a report bug that should have been fixed:
http://stackoverflow.com/questions/8828 ... p-deadlock
But still we se the same behavior.

Any tips are appreciated!!

Danny Bickson
danny.bickson
Registered Member
Posts
4
Karma
0
We are aware of omp general setup commands, but since we use omp in our code as well, we can not setup omp differently between our code vs. eigen. So we wonder if there is a way to disable eigen parallelization, as can be done for example in intel mkl library, where you have mkl sequential version.

Thanks

Danny Bickson
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
you can compile with -DEIGEN_DONT_PARALLELIZE or use Eigen::setNbThreads(1); at runtime.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
in case you still get a deadlock, could you try to do a matrix multiply in your main (before the creation of the thread to "initialize" Eigen's products):

MatrixXf A = MatrixXf::Zeros(1,1); A = A*A;


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]