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

Multiple calls to DGEEV

Cansey50
Beginner
1,302 Views

I have not used oneMKL before, and only recently begun experimenting with it. Ultimately I would like to create DLLs for some of the functions including the ones for the eigenvalue/eigenvector calculations. 

I took the dgeev.c example from \examples_core_c\c\lapack\source\ zipped folder in my oneAPI installation folder, and compiled it in a Visual Studio 2019 console project. It runs ok and gives the exact results mentioned at the top of the dgeev.c file.

However, if I call dgeev again the results are different! I have attached the source code in which dgeev is called 3 times and the output of the program. I was expecting to get exactly the same results every single time the dgeev is called as the matrix a has not changed.

Can you please help me understand why the results are different, and what I am doing wrong?

Thanks beforehand.

In case it is needed:

My Processor: Intel(R) Core(TM) i5-2500 CPU

My OS: 64-bit operating system, x64-based processor

0 Kudos
1 Solution
mecej4
Honored Contributor III
1,282 Views

Please read the conventions of the Lapack/BLAS routines that are called in your code. For DGEEV, the documentation says:

[in,out]A
          A is DOUBLE PRECISION array, dimension (LDA,N)
          On entry, the N-by-N matrix A.
          On exit, A has been overwritten.

If you wish to call DGEEV after the first call, you have to restore the original values in A before the second call (and subsequent ones, if any).

Most of the Lapack and BLAS routines were designed and written at a time when "main memory" was a precious and scarce resource. The computers of the time, such as the CDC6600, had memory measured in kilowords (132 kWords, 60 bits each).

View solution in original post

0 Kudos
3 Replies
mecej4
Honored Contributor III
1,283 Views

Please read the conventions of the Lapack/BLAS routines that are called in your code. For DGEEV, the documentation says:

[in,out]A
          A is DOUBLE PRECISION array, dimension (LDA,N)
          On entry, the N-by-N matrix A.
          On exit, A has been overwritten.

If you wish to call DGEEV after the first call, you have to restore the original values in A before the second call (and subsequent ones, if any).

Most of the Lapack and BLAS routines were designed and written at a time when "main memory" was a precious and scarce resource. The computers of the time, such as the CDC6600, had memory measured in kilowords (132 kWords, 60 bits each).

0 Kudos
Cansey50
Beginner
1,269 Views

Thank you mercej4! I admit I have to read the documentation carefully. 

0 Kudos
ShanmukhS_Intel
Moderator
1,214 Views

Hi Khosro,


Thanks for posting in Intel Communities.


It’s great to know that the issue has been resolved, in case you run into any other issues please feel free to create a new thread.


Best Regards,

Shanmukh.SS


0 Kudos
Reply