Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
Intel Customer Support will be observing the Martin Luther King holiday on Monday, Jan. 17, and will return on Tues. Jan. 18.
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646
6463 Discussions

Sparse Hermitian matrix and vector multiplication

flygaoonly
Beginner
274 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
274 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

flygaoonly
Beginner
274 Views
I got it. Thank you very much.
flygaoonly
Beginner
274 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.
flygaoonly
Beginner
274 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.
barragan_villanueva_
Valued Contributor I
274 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
flygaoonly
Beginner
274 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?
barragan_villanueva_
Valued Contributor I
274 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.
flygaoonly
Beginner
274 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".
barragan_villanueva_
Valued Contributor I
274 Views
Hi,
This function was introduced in MKL 10.1 and therefore is missing in MKL 10.0
flygaoonly
Beginner
274 Views
So in this case, is there any other sparse matrix vector multiplication subroutine I can use?
Customer__Intel4
Beginner
274 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
Konstantin_A_Intel
274 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.

Reply