3 ms·
Why Eigen is not run in parallel mode w/ Open-MP? Eigen handle most (if not all, I just skimmed the tables) tasks in parallel [0]. Plus, it has hand-tuned SIMD
by bayindirh 3y ago
Why Eigen is not run in parallel mode w/ Open-MP?
Eigen handle most (if not all, I just skimmed the tables) tasks in parallel [0]. Plus, it has hand-tuned SIMD code inside, so it needs "-march=native -mtune=native -O3" to make it "full send".
Some solvers' speed change more than 3x with "-O3", to begin with.
This is the Eigen benchmark file [1].
[0]: https://eigen.tuxfamily.org/dox/TopicMultiThreading.html https://eigen.tuxfamily.org/dox/TopicMultiThreading.html
[1]: https://github.com/sarah-ek/faer-rs/blob/main/faer-bench/eigen.cpp https://github.com/sarah-ek/faer-rs/blob/main/faer-bench/eig...
- dannyz 3y agoRelated on the Eigen benchmarking, I see a lot of use of auto in the benchmarks. Eigen does not recommend using it like this (https://eigen.tuxfamily.org/dox/TopicPitfalls.html https://eigen.tuxfamily.org/dox/TopicPitfalls.html) because the template expressions can be quite complicated. I'm not sure if it matters here or not, but it would probably better not to use it in the benchmarks.
- sarah-ek 3y agoi've contributed to eigen in the past and know enough about the internals of the codebase to know my way around safe `auto` usage
- dannyz 3y agoI wasn't worried about safe usage, more that some of the initialization may be moved inside the benchmarking function instead of outside of it like intended. I'm sure you know more about it than me though.
- bayindirh 3y agoWhile auto is a compile time burden, it creates a lot of load during compilation of this benchmark. My complete Ph.D., using ton of Eigen components plus other libraries was compiling in 10 seconds flat on a way older computer. This requires gigs of RAM plus a minute.
- sarah-ek 3y agothe long compile times are mostly because im instantiating every dense decomposition in the library in one translation unit, for several data types (f32, f64, f128, c32, c64, c128)
- sarah-ek 3y agoauthor here, eigen is compiled with -fopenmp, which enables parallelism by default