Re: [eigen] Re: tests taking forever when run with -j8 and OpenMP is enabled

[ Thread Index | Date Index | More Archives ]

On Sat, 3 Jul 2010 18:59:21 +0300, Aron Ahmadia <aja2111@xxxxxxxxxxxx>


> In the world of scientific computing, your code is usually assumed to be

> the

> only process on the system, so this is normally a fairly safe assumption


> make.  In fact, the OpenMP library has an API which allows you to ask


> many cores are on the physical CPU you are running on, which usually


> you to leverage the entire machine.  I think for 99% of the users you

> encounter who are using Eigen and care about this sort of thing, they


> want you to utilize the memory hierarchy as if you have the whole


> cache (L1-L3) at your disposal.


> A

Unfortunately, I think the optimal cores & caches usage is somewhat more

complicated that

giving all the ressources (i.e. cores/caches ) to Eigen operations because

of the following

usecases even when the running process is the only "important" one (as in

"performance constrained"):

1°) you can have n concurrent Eigen operations in a n threads

2°) other threads in the process might also be important

So I think it would be interesting to be able to tune at runtime the nb of

cores allocated to various

Eigen operations. Of course it is a difficult problem because for maximal

efficiency it

would be best to select amongst near of far (i.e. sharing or not L2 cache)

core at runtime

and OpenMP did not allow that last time I checked ☹:.

my .02€

Best Regards,


[0] and a single global setNbThreads() is unsatisfactory because it is not

threadsafe itself.

Mail converted by MHonArc 2.6.19+