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

Sparse Hermitian matrix and vector multiplication

flygaoonly
Beginner
945 Views
In MKL, are there functions or subroutines that can performcomplex sparse Hermitian matrix and vector multiplication? I only saw the one for sparse symmetrical matrix.
0 Kudos
12 Replies
Sergey_K_Intel1
Employee
945 Views

MKL has got sparse matrix-vector multiply several routines for Hermitian matrices and one of them is

call mkl_zcsrmv(transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)

In the case of Hermitian matrix, the first element of the parameter

matdescra

CHARACTER. Array of six elements, specifies properties of the matrix used for operation.

must be H or h.

All the best
Sergey

0 Kudos
flygaoonly
Beginner
945 Views
I got it. Thank you very much.
0 Kudos
flygaoonly
Beginner
945 Views
Another thing. If I want to compile my program (bdg.f90 which uses mkl_ccoomv) on a Linux system, can I use the following command:

ifort bdg.f90 -L /opt/intel/mkl/10.0.1.014/lib/em64t -I /opt/intel/mkl/10.0.1.014/include -lmkl_intel -lmkl_intel_thread -lmkl_core -liomp5 -lpthread

If not, what command should I use? Thank you.
0 Kudos
flygaoonly
Beginner
945 Views
After reading the User's Guide, I use the following command to compile my program bdg.f90, in which I called mkl_ccoomv.

ifort bdg.f90 -L/opt/intel/mkl/10.0.1.014/lib/em64t -I/opt/intel/mkl/10.0.1.014/include -Wl,--start-group /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_em64t.a /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_blas95.a /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_lp64.a /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.a /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_core.a -Wl,--end-group -lmkl -lguide -lpthread

But I still got the following error:

undefined reference to 'mkl_ccoomv'

What's wrong with it, can you give me some advice? Thanks.
0 Kudos
barragan_villanueva_
Valued Contributor I
945 Views
Hi,

Please use Intel MKL Link Line Advisor
E.g., for MKL 10.0 it should be:

-lmkl_blas95_lp64 $(MKLROOT)/lib/em64t/libmkl_solver_lp64.a -Wl,--start-group $(MKLROOT)/lib/em64t/libmkl_intel_lp64.a $(MKLROOT)/lib/em64t/libmkl_intel_thread.a $(MKLROOT)/lib/em64t/libmkl_core.a -Wl,--end-group -openmp -lpthread
0 Kudos
flygaoonly
Beginner
945 Views
Thank you for your advice. However, as you suggested, I use the following command:

ifort bdg.f90 -lmkl_blas95_lp64 /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_solver_lp64.a -Wl,--start-group /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_lp64.a /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.a /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_core.a -Wl,--end-group -openmp -lpthread

There is an error:

ld: cannot find -lmkl_blas95_lp64

The same thing happans if I use

ifort bdg.f90 -I/opt/intel/include/em64t/lp64 -lmkl_blas95_lp64 /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_solver_lp64.a -Wl,--start-group /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_lp64.a /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.a /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_core.a -Wl,--end-group -openmp -lpthread

So what's the problem?
0 Kudos
barragan_villanueva_
Valued Contributor I
945 Views
Sorry,

libmkl_blas95_lp64.a was introduced in MKL 10.2 only but you use MKL 10.0. MKL Link Advisor is to be fixed.
So please try to link your program without it.
0 Kudos
flygaoonly
Beginner
945 Views
Without it, I then use

ifort bdg.f90 /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_solver_lp64.a -Wl,--start-group /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_lp64.a /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_intel_thread.a /opt/intel/mkl/10.0.1.014/lib/em64t/libmkl_core.a -Wl,--end-group -openmp -lpthread

but still got "undefined reference to mkl_ccoomv".
0 Kudos
barragan_villanueva_
Valued Contributor I
945 Views
Hi,
This function was introduced in MKL 10.1 and therefore is missing in MKL 10.0
0 Kudos
flygaoonly
Beginner
945 Views
So in this case, is there any other sparse matrix vector multiplication subroutine I can use?
0 Kudos
Customer__Intel4
Beginner
945 Views
Hi
In case of using this function with hermitian or symmetric matrix, do we store only the upper / lower triangle or the whole matrix ?
Thanks
0 Kudos
Konstantin_A_Intel
945 Views
Quoting tarek.e
Hi
In case of using this function with hermitian or symmetric matrix, do we store only the upper / lower triangle or the whole matrix ?
Thanks


Yes, sure.

0 Kudos
Reply