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

Eigen 3 multithreading

Tags: None
(comma "," separated)
blubber
Registered Member
Posts
6
Karma
0

Eigen 3 multithreading

Thu Oct 14, 2010 9:28 am
Hi
I want to use Eigen 3 and multithreading. Therefore I have questions:

1) Does Eigen 3 have a multithreaded "matrix-vector" product?

2) If I use openMP in my program, then Eigen 3 is also multithreaded?
Example:
I have 4 threads, which do some calculations with different parameters - does Eigen 3 use 4 threads or more?

3) Is Eigen 3 "threadsafe", can I use Eigen 3 and Open MPI?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Eigen 3 multithreading

Thu Oct 14, 2010 4:09 pm
blubber wrote:Hi
I want to use Eigen 3 and multithreading. Therefore I have questions:

1) Does Eigen 3 have a multithreaded "matrix-vector" product?


no, currently only matrix-matrix products are multithreaded.

2) If I use openMP in my program, then Eigen 3 is also multithreaded?
Example:
I have 4 threads, which do some calculations with different parameters - does Eigen 3 use 4 threads or more?


Eigen uses OpenMP for the parallelization, so you can use OpenMP API to control the number of threads, or the function:

Eigen::setNbThreads(n);

to overwrite default OpenMP settings for Eigen only.


3) Is Eigen 3 "threadsafe", can I use Eigen 3 and Open MPI?



Eigen's objects and methods are as thread-safe as a std::vector for instance.

gael
manuels
Registered Member
Posts
47
Karma
0

Re: Eigen 3 multithreading

Fri Nov 12, 2010 4:05 pm
Hi ggael,

no, currently only matrix-matrix products are multithreaded.

is there a reason for that or did you just not have enough time, yet?

Cheers,

Manuel

PS: I'm loving Eigen!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Eigen 3 multithreading

Fri Nov 12, 2010 9:46 pm
time, and I also need to find a way to factorize the multithreading logic which represent a quite large amount of code and that's far to be trivial.


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], Sogou [Bot]