Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- incorrect results using MKL (getrf and getrs)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Danesh_Daroui

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-07-2011
08:40 AM

76 Views

incorrect results using MKL (getrf and getrs)

I am performing very simple tests to port our code to MKL. At the moment we are using GMM++ free library. I have created a small 6x6 complex and non-symmetric matrix which is attached to this post as MATLAB format. I have tested to solve "Mx=b" where "b" is just a 6x1 vector of ones. The results from GMM++ is correct as expected and matches with results from MATLAB but MKL results are far different and incorrect. In my test, I directly read data from GMM++ matrix and put in in column-major format and then call MKL as below:

[cpp]Msize=6;

for (int i=0; ifor (int j=0; j MKL_M[j*Msize+i]=M(i, j);

// MKL solution to solve "YV=I" matrix equation

int info;

int ipiv[Msize];

int nrhs=1;

char transa='N';

zgetrf(&Msize, &Msize, MKL_M, &Msize, ipiv, &info);

zgetrs(&transa, &Msize, &nrhs, MKL_M, &Msize, ipiv, &x[0], &Msize, &info);[/cpp]

I have checked my code and everything seems to be OK! Do you find any error in my code? By the way, I know that the coefficient matrix "M" is "Mx=b" is close to singular as I got warnings from MATLAB so the results can be in accurate but MKL's results are totally different from GMM++ and MATLAB that shows there is something wrong! I was also curious to know if it can be related to linking options that I use? Maybe I am linking my code to wrong libraries or what? Any help would be appreciated.

Thanks,

D.

Link Copied

1 Reply

mecej4

Black Belt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-07-2011
07:56 PM

76 Views

A. you have not shown:

(i) parts of the code that matter a lot: declarations of variables, initialization of data.

(ii) information on which versions of Intel C, OS, MKL used, how the compilation was done.

(iii) the results that you state are wrong and, if known, the correct results.

B. The more third party software that is necessary for looking into your problem, the fewer will be the number of responses elicited.

If the "OK" is expected to apply to the parts of the code that you did not show, what can one say beyond "..if you say so, maybe", regardless of whether or not the code as a whole is in error ?

RECOMMENDATIONS:

Unless you are familiar with calling Fortran routines from C, you should find it less error-prone to use the LapackE interface, which is available in MKL. See

http://netlib.org/lapack/#_standard_c_language_apis_for_lapack

If you want to try to get your correct code to work:

(i) You could try printing out (or otherwise checking) the values of the arguments passed to ZGETRF before that routine is called.

(ii) You could look at the examples provided with MKL to see if you can pattern your code after one of them.

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

For more complete information about compiler optimizations, see our Optimization Notice.