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

calls to pardiso from a DLL crash

Brian_Murphy
새로운 기여자 II
1,532 조회수

I am a new user of MKL, and I'm using pardiso to factor a real nonsymmetric matrix.  I've successfully run the sample program for this case, and I'm trying to do exactly the same thing, except my calls to pardiso are from a DLL instead of from an EXE.  The first call with phase=11 seems to go without trouble and error=0.  Then I call pardiso with phase=22 and I get a crash with an "unhandled exception. . . access violation" message.

Does calling pardiso from a DLL require doing anything differently than from an EXE?

0 포인트
4 응답
Brian_Murphy
새로운 기여자 II
1,532 조회수

I modified the pardiso example to read my matrix from a file, and even the EXE crashes at the same place.  The call with phase=11 finishes with no trouble, but the call with phase=22 crashes.

The attached zip file is the entire visual studio project.  The matrix is being read from uni9.txt.Matrix size is only n=152.  I get a feeling it must be something really simple I'm doing wrong, but I just can't find it.

Thanks

Brian

 

0 포인트
mecej4
명예로운 기여자 III
1,532 조회수

Before you call Pardiso, please check the matrix data in CSR format. Items in the first row should be given in increasing column order, then the second row, etc.

Row-3 is supposed to contains items 9 to 13. The column indices in ja(9:13) are, however, 78, 79, 82, 83, 4. The last item is out of order. 

There are similar errors in Rows 4, 7, etc.

0 포인트
Gennady_F_Intel
중재자
1,532 조회수

two my cents - you may use sparse_matrix_checker() routine to check correctness of your input

 

0 포인트
Brian_Murphy
새로운 기여자 II
1,532 조회수

You were both right.  The elements were certainly not in the mandatory increasing order.  I thought they were because I was making the CSR matrix from a COO matrix using dcsrcoo.  But I see now that I had to tell dcsrcoo to put the elements in increasing order with ijob(1)=2, whereas I had ijob(1)=1.  This fix cured the crashing problem, so I can continue with implementing pardiso in my application.  I am hoping pardiso will be faster than umfpack at factoring a sparse matrix.

At least I was right about it being something simple. :)

Thanks very much for the help.

Cheers,

Brian

0 포인트
응답