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

Fortran MKL matrix operations in pure CSR format


Hi folks, I'm an enthusiastic Intel-MKL user employing parallel Fortran and C code. I need to perform specific

CSR matrix-dot-matrix operations like MKL_SPARSE_SYRK without resorting

to dense matrices at all. Where I can found some examples showing practical use of these routines in

Fortran?  Why there is no example even in the most recent version of the manual?

Pleaase, consider that this topic is fundamental for solving large sparse algebraic parallel problems

in CFD and electromagnetics (e.g. Tykhonov Regolarization of ill-posed problems) so all suggestions are welcome.

Thanks, Ciro


ANCILLARY ROUTINES: mkl_sparse_d_create_csr, mkl_sparse_convert_csr, etc.


0 Kudos
1 Reply

Hi Ciro,

The example spblasf/sparse_z_export_csr.f90 does give a decent small example of using FORTRAN interfaces with CSR matrices to do the sparse spmm operation (It performs B = A*A).  It is a fairly simple change to enable sparse syrk or sp2m or sypr instead of spmm.  You may also need to change the data type as it is complex See, for example, for the exact arguments of syrk.  This example also has the added benefit of showing how to use mkl_sparse_?_export_csr() to retrieve the sparse solution from the sparse matrix object after your computation is completed.  



0 Kudos