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

paradiso directly from sparse matrix handler

marcsolal
Beginner
607 Views

I would like to solve a system with a matrix which is in a sparse matrix handler. I would like to know if there is a direct way to export the matrix into paradiso, ie to get the 3 require arrays or if the best way is to use export csr, to copy the rows_start array + the last element of rows_end array into a new ia array?

Is there an export_csr function which exports in the 3 array format, or a way to read a sparse matrix handler directly in paradiso.

Thanks.

0 Kudos
7 Replies
ShanmukhS_Intel
Moderator
570 Views

Hi Marc,


Thanks for posting on Intel Communities.


Could you please refer to the pardiso_export routine which places pointers dedicated for sparse representation of a requested matrix (values, rows, and columns) into MKL PARDISO, and let us know if this fulfills your requirement? More details regarding the routine were mentioned under the below link.


https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/sparse-solver-routines/onemkl-pardiso-parallel-direct-sparse-solver-iface/pardiso-export.html


Best Regards,

Shanmukh.SS


0 Kudos
marcsolal
Beginner
550 Views

I am sorry I do not think this is the right function. Maybe, I was not clear. I have a matrix which is coming from sparse blas inspector-executor and I would like to solve a system with this matrix using paradiso. 

0 Kudos
Spencer_P_Intel
Employee
533 Views

Hi @marcsolal 

 

This is a great question and undoubtedly we could make things better in the future with interoperability of functions.  So I am assuming you are talking about an IE sparse blas sparse_matrix_t handle that was created and filled by the oneMKL library like in mkl_sparse_sp2m  or  mkl_sparse_x_add(), etc  where you don't explicitly own or yet have access to the CSR arrays that were created as part of that process.

 

Right now, there are a couple of ways to move forward:

 

1. use mkl_sparse_?_export_csr()  to get access to the CSR-3 arrays in the handle.  Their lifetime is managed by the library and so feel free to use them directly but keep the sparse matrix handle alive until you are done with them.   You can immediately load those arrays into a pardiso handle and send it through.

2. If you don't want to keep the sparse matrix handle alive, then you will need to make copies of the exported data into your own arrays, then delete the matrix handle and submit your copies into the pardiso handle.

 

In a perfect world, you would be able to use the same handle for all the sparse operations in oneMKL but unfortunately there is not such a connection right now and they were developed separately.  

 

Hopefully that helps

Spencer

0 Kudos
marcsolal
Beginner
503 Views

Thanks. I was only checking if I missed something. Actually, I am converting from a matrix in coordonate format to csr. I used to do that using the deprecated sparse blas functions. It was doing what I need. I am switching to the sparse_matrix_t handle functions and it is a little bit more complicated.

0 Kudos
ShanmukhS_Intel
Moderator
474 Views

Hi Marc,


Has the information provided helped? Could you please let us know if we could help you with any other information?


Best Regards,

Shanmukh.SS


0 Kudos
marcsolal
Beginner
459 Views

At least, you confirmed I did not miss anything. Thanks for your help.

Marc

0 Kudos
ShanmukhS_Intel
Moderator
436 Views

Hi Marc,

 

Thanks for the confirmation. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.

 

Have a great day!

 

Best Regards,

Shanmukh.SS

 

0 Kudos
Reply