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

Intel MKL ERROR: Parameter 4 was incorrect on entry to MKL_DCSRSV.

klimova__ekaterina
816 Views

 

Help me please. I want to solve a system of linear equations using the mkl_dcsrsv function. However, an error is issued.

matrix a 

1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0
0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0
0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0
0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0
0  0  -0.4  0  0  0  -0.4  0  1.85  0  -0.4  0  0  0  -0.4  0  0  0
0  0  0  4  0  0  0  4  1  16  0  4  0  0  0  4  0  0
0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0
0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0
0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0
0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0
0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0
0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0
0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0
0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1
const char transa = 'n';    

int b = 2 * nx*ny;

const double alpha = 1.;

char matdescra[6];
        matdescra[0] = 'g';
        matdescra[1] = ' ';
        matdescra[2] = ' ';
        matdescra[3] = 'c';
mkl_dcsrsv(&transa, &b, &alpha, matdescra, Acsr,JA,pntrb,pntre,F,x);

 

What are the problems with matdescra?

0 Kudos
1 Reply
Kirill_V_Intel
Employee
816 Views

Hello Ekaterina,

I think the reason is that you specify the first value of matdescra as 'g' which is for general matrix but the routine mkl_dcsrsv solves only systems with triangular matrices. Since your matrix is indeed not triangular, you cannot use mkl_dcsrsv in your case.

Actually, your matrix is very tiny, Do you really want to solve it using a sparse linear solver or is it just an example?
For large matrices you can use direct solver PARDISO from Intel MKL. For small matrices, however, it's easier and more efficient to use functionality for dense matrices.

Best,
Kirill

0 Kudos
Reply