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

mkl_zcsrcoo faster computation on subsequent calls?

Petros
Novice
377 Views

Hi,

I have a sparse matrix in coordinate format (row, col, A) and I transform it to CSR to be used for PARDISO. The sparsity pattern never changes (that is, row and col are always the same). Vector A changes from time to time. As I understand, I can run with job(6)=1 to get only ia. Is this any faster? What does job(6)=2 do?

I put here the documentation for job(6). Thanks!

For conversion to the CSR format:

If job(6)=0, all arrays acsrjaia are filled in for the output storage.

If job(6)=1, only array ia is filled in for the output storage.

If job(6)=2, then it is assumed that the routine already has been called with the job(6)=1, and the user allocated the required space for storing the output arrays acsr and ja.

0 Kudos
2 Replies
mecej4
Honored Contributor III
377 Views

See the example dconverters.f in the ...\Composer XE\mkl\examples>cd spblasf\source directory. This example shows details of a large number of conversion tasks. If you still have questions after examining the example code, please come back and ask.

0 Kudos
Petros
Novice
377 Views

mecej4 wrote:

See the example dconverters.f in the ...\Composer XE\mkl\examples>cd spblasf\source directory. This example shows details of a large number of conversion tasks. If you still have questions after examining the example code, please come back and ask.

Thanks for pointing me to that file. Nevertheless, it is even more confusing. The code is:

! TASK 4    Obtain compressed compressed sparse row matrix from sparse coordinate matrix
      job(1)=1
      job(6)=2
      call mkl_zcsrcoo (job,n, Acsr, AJ,AI,nnz,Acoo, ir,jc,info)

So, it calls mkl_zcsrcoo with job(6)=2, without prior calling with job(6)=1 (as mentioned in the documentation). My question boils down to:

  1. What exactly is job(6)=2 doing? It fills only ia (as job(6)=1) or it fills all three vectors? Is it faster because it doesn't check the size of acsr and ja?
  2. Which one of these calls (job(6)=1,2,3) is faster for subsequent calls, where the sparsity pattern remains unchanged and only the values change?
  3. (Optional) Is there any method to reuse the data from the first call to speed up subsequent calls? For example, a similar converter of Harwell (HSL MC69) keeps a mapping of where the elements of the coordinate matrix go in the compressed one. After the first call, the subsequent ones can reuse this mapping to be faster (if the sparsity pattern is the same).

Thanks in advance,

Petros

 

0 Kudos
Reply