Timing issues (eigenvectors of symmetric matrix)

Open discussion regarding features, bugs, issues, vendors, etc.

Timing issues (eigenvectors of symmetric matrix)

Hello Everyone,

I'm trying to get all eigenvalues and eigenvectors of a real-valued symmetric matrix by using the ssyevr feature. I'm doing this in C and so using the LAPACKE_ssyevr_work(...) function. I've tested it with a trivial 4x4 matrix and the function gives the right answer and performs quickly in a fraction of a second. I think this means that I've used the function correctly in my code. However, when I try to solve my real problem with a 228x228 matrix, the function ran overnight and still was not done. According to the benchmark tests I found online for LAPACK, it should have performed in less than 10 seconds. What am I missing? Thank you very much for your help.

Here is my code
N = 228
VL = VU = 0.0
IL = IU = 0
ABSTOL = 0.0001
LWORK = 26*N
LIWORK = 10*N
support has length 2*N

LAPACKE_ssyevr_work(LAPACK_ROW_MAJOR, 'V', 'A', 'U', N, (float*) A.begin(), N, VL, VU, IL, IU, ABSTOL, &numberEigenVals, (float*) eigenValues.begin(), (float*) leftEigenVectors.begin(), N, (int*) support.begin(), (float*) WORK.begin(), LWORK, (int*) IWORK.begin(), LIWORK);
patbangert

Posts: 2
Joined: Tue May 30, 2017 12:12 pm

Re: Timing issues (eigenvectors of symmetric matrix)

The problem is not obvious to me. Can you try (1) using LAPACKE_ssyevr instead of LAPACKE_ssyevr_work? This clear up any problem of workspace. Maybe the workspace (26*N) is too small. I do not know. Can you please LAPACKE_ssyevr on the same matrix? (2) If (1) does not work, I would suggest then to try LAPACKE_ssyevr and set ABSTOL to 0.0. ? If you want to report, we can try to think some more of what the problem can then be. Cheers, Julien.
Julien Langou

Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: Timing issues (eigenvectors of symmetric matrix)

( You are correct that for a 228x228 matrix SSYEVR should not take `overnight` to complete. So there is a problem. )
Julien Langou

Posts: 835
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: Timing issues (eigenvectors of symmetric matrix)

Wow. That indeed fixed it. So it must have been the small size of the workspace. Now the runtime is about 1 second. Fantastic. Thank you.
patbangert

Posts: 2
Joined: Tue May 30, 2017 12:12 pm

Who is online

Users browsing this forum: No registered users and 4 guests