Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6956 Discussions

mkl_sparse_?_ev and mkl_sparse_?_gv, the eigenvalues obtained by the solution are incorrect

NEROKAI
Beginner
1,105 Views

HI

I use mkl_sparse_d_ev and mkl_sparse_d_gv to solve the eigenvalues, I tested 10000*10000 matrix, got perfect result output, and got validation of the result.
In my actual use, I have not used such a large matrix to calculate the generalized eigenvalue problem of a 462*462 matrix. The eigenvalues solved are very strange. I use the code for testing large sparse matrices, and there is no problem. Using the same code for small sparse matrices, the calculated results are wrong. Even I solve the eigenvalue problem of diagonal matrices. The result obtained is also not the value of the diagonal.

The two matrices are the stiffness matrix and the mass matrix generated by the finite element. The mass matrix imposes a consistent mass concentration, so it is a diagonal matrix, and I also did not get good results using the eigenvalues of solving the mass matrix.

Below is the test code for my problem, please what is the problem.

thank you for your help.

0 Kudos
8 Replies
ShanmukhS_Intel
Moderator
1,052 Views

Hi,

 

Thank you for posting on Intel Communities and sharing the project files. 

 

Could you please let us know the actual vs expected results in your case. In addition, please refer to mkl_sparse_d_ev.c example under below path for details regarding the usage of mkl_sparse_d_ev.

 

C:\Program Files (x86)\Intel\oneAPI\mkl\<your version>\examples\examples_core_c.zip\c\sparse_eigsolvers\source

 

 

Best Regards,

Shanmukh.SS

 

0 Kudos
NEROKAI
Beginner
1,034 Views

Thank you very much for your help, there is a zm.txt file in the testcase, where xm.txt ym.txt zm.txt is the diagonal matrix I want to solve, because it is a diagonal matrix, so the eigenvalues should be consistent with zm.txt , but what I solve is obviously inconsistent. I am using Intel Sequential and the code is modified from the example code.
The sample codes are all full matrices. If I want to deal with a symmetric matrix with only upper triangular data, what parameters should I set?
Very grateful for your help

0 Kudos
ShanmukhS_Intel
Moderator
996 Views

Hi,

 

>>The sample codes are all full matrices. If I want to deal with a symmetric matrix with only upper triangular data, what parameters should I set?

 

Below are the input parameters to be used.

 

Input Parameters:

 

Parameter    : sparse_matrix_type_t type

Significance : Specifies the type of a sparse matrix

                         SPARSE_MATRIX_TYPE_SYMMETRIC to be used for the matrix for symmetric matrix (only the requested triangle is processed).

 

Parameter    : sparse_fill_mode_t mode

Significance : Specifies the triangular matrix part for symmetric, Hermitian, triangular, and block-triangular matrices

                         SPARSE_FILL_MODE_UPPER to be used for upper triangular data.

 

For more details regarding the other parameters and functionality of mkl_sparse_?_ev, Kindly refer to below link.

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/extended-eigensolver-routines/extended-eigensolver-interfaces/ext-eigensolve-ifaces-find-large-small-eigenvalues/mkl-sparse-ev.html

 

Best Regards,

Shanmukh.SS

 

0 Kudos
ShanmukhS_Intel
Moderator
973 Views

Hi,


Reminder:

Has the information provided helped? Is your issue resolved? Kindly let us know if we could close this thread at our end.


Best Regards,

Shanmukh.SS


0 Kudos
NEROKAI
Beginner
949 Views

I didn't solve the problem, he calculated it was still inaccurate, I couldn't find out where the problem was.

0 Kudos
ShanmukhS_Intel
Moderator
921 Views

Hi,

 

We have tried compiling and executing the shared project file and attached the console output with this thread.

 

Could you please let know the expected output in this case as it would help us in investigating the issue further.

 

Best Regards,

Shanmukh.SS

 

0 Kudos
ShanmukhS_Intel
Moderator
877 Views

Hi,

 

A gentle reminder:

Has the information provided helped? Is your issue resolved?

Kindly let us know if we could close this thread at our end.

 

Best Regards,

Shanmukh.SS

 

0 Kudos
ShanmukhS_Intel
Moderator
850 Views

Hi,


We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Best Regards,

Shanmukh.SS


0 Kudos
Reply