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
New Contributor II
354 Views

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 Kudos
4 Replies
Brian_Murphy
New Contributor II
354 Views

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 Kudos
mecej4
Honored Contributor III
354 Views

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 Kudos
Gennady_F_Intel
Moderator
354 Views

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

 

0 Kudos
Brian_Murphy
New Contributor II
354 Views

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 Kudos
Reply