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

Incomplete LU Factorization - how to extract L and U ?

Beginner
656 Views
Dear MKL-experts,

I'd like to use the ilu0 factorization as a preconditioner for a GPU based solver. In order to do so I have to explicitly get the L and the U matrix from the B matrix that is returned by dcsrilu0.

Can you think of a simple way to do this or is there even a tool in the MKL for this?

Cheers,

Stefan
3 Replies
Employee
656 Views
Hi,
In example nameddcsrilu0_exampl1.c you can find way how to use matrix obtained by ILU0 as preconditioner. There is no way to get the L and U matrix from matrix B but you can multiply them on vector using SparseBlas functionality.
With best regards,
Beginner
656 Views
Hi Alexander,

thank you very much for your very fast answer. I have to extract L and U as I'm using a GPU based backsolve method (not the MKL mkl_cspblas_dcsrtrsv).

There have to be a way to do this. Maybe I can perform a matrix-matrix multiplication with the identity matrix, but use only the lower or upper part in the multiplication? For that I need to routines:
1. Initilialize a sparse identitiy matrix. Is that possible with MKL?
2. Perform a matrix-matrix multiplication, but only use the L or U part (like mkl_cspblas_dcsrtrsv does it). Is there a suitable routine in the MKL?

Cheers,

Stefan
Employee
656 Views

Hi,

From my point of view you can malloc 2 set of 3 arrays (ia,ja, a) for matrices L and U correspondently and convert data from matrix B to these matrices using simple loop. Lower part of matrix B correspond to matrix L and upper correspond to matrix U.

With best regards,