Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7291 ディスカッション

Issue with intel pardiso (oneapi mkl)

a_piquet
初心者
2,815件の閲覧回数

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 件の賞賛
1 解決策
a_piquet
初心者
2,786件の閲覧回数

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.

元の投稿で解決策を見る

3 返答(返信)
a_piquet
初心者
2,808件の閲覧回数

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;

 

 

a_piquet
初心者
2,787件の閲覧回数

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.

ShanmukhS_Intel
モデレーター
2,741件の閲覧回数

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


返信