Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.
6680 Discussions

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

NEROKAI
Beginner
553 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
500 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

 

NEROKAI
Beginner
482 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

ShanmukhS_Intel
Moderator
444 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/exten...

 

Best Regards,

Shanmukh.SS

 

ShanmukhS_Intel
Moderator
421 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


NEROKAI
Beginner
397 Views

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

ShanmukhS_Intel
Moderator
369 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

 

ShanmukhS_Intel
Moderator
325 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

 

ShanmukhS_Intel
Moderator
298 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


Reply