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

Issue with intel pardiso (oneapi mkl)

a_piquet
Novice
536 Views

Hello,

I'm trying to use the pardiso solver for my code so I tested some example and the results given by those test are wrong.

I have tested this file (which comes from the MKL example database) :

https://github.com/ww382/CS5220FinalProject/blob/master/pardiso_sym_c.c

This file solve the Ax=b equation with A a sparse matrix (8x8). So at the end I can check the answer given by Pardiso (x) by multiplying A*x and this does not give b ==> A*xpardiso /= b

I have also used Matlab to check the results (x=A\b) and the result is not the same than given by Pardiso.

The pardiso_sym_c.c file is compiled with OneAPI 2023 using :

icc pardiso_sym_c.c -lmkl_sequential -lmkl_core -lmkl_intel_lp64

Is there something I don't do correctly?

Thank you

 

A =

7. 0. 1. 0. 0. 2. 7. 0.
0. -4. 8. 0. 2. 0. 0. 0.
0. 0. 1. 0. 0. 0. 0. 5.
0. 0. 0. 7. 0. 0. 9. 0.
0. 0. 0. 0. 5. 1. 5. 0.
0. 0. 0. 0. 0. -1. 0. 5.
0. 0. 0. 0. 0. 0. 11. 0.
0. 0. 0. 0. 0. 0. 0. 5.

b =

1.
1.
1.
1.
1.
1.
1.
1.

A\b (from matlab) =  0.0519481
-0.1954545
0.
0.0259740
0.1090909
5.551D-17
0.0909091
0.2

 

while Pardiso give me :

xpardiso=

-0.041860

-0.003413

 0.117250

-0.112640

 0.024172

-0.107633

 0.198720

 0.190383

0 Kudos
1 Solution
a_piquet
Novice
507 Views

My bad, the matrix is symmetric so I miss the other part of the symmetry to compute my array... No problem in pardiso

You can close the thread. Sorry.

View solution in original post

0 Kudos
3 Replies
a_piquet
Novice
529 Views

Strange, 

When i change the matrix mtype from "Real symmetric matrix" to "real and nonsymmetric", it works. The matrix is symmetric though so...

 

//MKL_INT mtype = -2;
MKL_INT mtype = 11;

 

 

0 Kudos
a_piquet
Novice
508 Views

My bad, the matrix is symmetric so I miss the other part of the symmetry to compute my array... No problem in pardiso

You can close the thread. Sorry.

0 Kudos
ShanmukhS_Intel
Moderator
462 Views

Hi Arthur,


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