yixuan / spectra

A header-only C++ library for large scale eigenvalue problems
https://spectralib.org
Mozilla Public License 2.0
740 stars 130 forks source link

SymGEigsSolver fails on a (large ?) system #51

Closed cedhub closed 6 years ago

cedhub commented 6 years ago

Hi Yihuan !

I'm interested in solving a generalized eigenvalue problem for Finite Element Method. If the solver works well on small systems, it fails to extract the eigenvalues on a large sparse system (~70k x 70k).

I was wondering if I'm doing something wrong somewhere. I attach my test file (main.cpp) and matrices (CantileverClamped_[k|m]Matrix.txt):

https://www.dropbox.com/s/tnshw4yh4y98trr/Archive.zip?dl=0

Would you (or someone else who reads this post) have some time to test it and give me a feedback ?

Thanks in advance ! Cédric

yixuan commented 6 years ago

I was able to get the largest eigenvalues of this system in tens of seconds, but saw very slow convergence for the smallest ones. This is also expected since largest ones are much faster to converge.

I changed the ncv parameter to 50 in the constructor, and the solver converged at iteration 304, with the following output:

4659.39  4064.8 3539.79 2562.45 2510.54 1703.19 1175.99 972.458 315.557 162.213
cedhub commented 6 years ago

Thanks for testing Yihuan !

The result is OK. How long did it took to obtain this solution on your computer ? Did you compiled with OpenMP ?

On my machine (MBP i7@2.8GHz, without OMP), it took 305 iterations and 11m30s, with ncv=50 ! Thanks !

yixuan commented 6 years ago

I had similar timing, but without compiling with OpenMP. In fact the algorithm is mostly sequential, so OpenMP doesn't help much.