Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
6434 Discussions

How to use Sparse BLAS Inspector-executor hints

ivanpribec
Beginner
349 Views

Hello,

I am interested in learning more about the purpose and usage of the Sparse BLAS hint routines such as mkl_sparse_set_mv_hint.

I am working on the numerical solution of a partial differential equation (PDE). Upon performing the spatial and temporal discretization I recover a system of ODE's which can be marched in time using a sparse matrix-vector product with `mkl_sparse_?_mv`. If I am using a Runge-Kutta method in the spatial discretizations, then I perform 4 multiplications in one time-step interlaced with some other algebraic operations. Are the hint routines useful in this case? Or are they only meant for situations where I plan to perform many iterations (N >> 1) on the same operands (e.g. in a sparse iterative solver between convergence checks)?

Best,

Ivan

 

0 Kudos
4 Replies
Gennady_F_Intel
Moderator
331 Views

Ivan, the mv hint will not help in this case but I am not 100% sure. Let me ask the Sparse BLAS developer to look at this case and give you the answer.

 

ivanpribec
Beginner
325 Views

Thanks. I kind of had the feeling RK4 is not the right usage case for hints. I look forward to a reply from one the developers.

Gennady_F_Intel
Moderator
320 Views

yes, I already asked them to look at the case. I hope someone will answer. 

Thanks

Spencer_P_Intel
Employee
312 Views

Hi Ivan,

This is a great question.  sparse mv hint and optimization can incur some significant cost of time to analyze and possibly change matrix formats depending on what the sparse matrix profile looks like.  And the type of optimizations applied may be different for different profiles.  The best way to answer this question for your case is to do a comparison yourself with your specific matrix.

Time 4 runs with no optimize  and then time optimize + 4 runs  and compare the two.  If there is significant optimization work happening inside (again based on sparsity profile) then likely 4 runs is not sufficient enough of work to amortize the cost of optimize.

Best,

Spencer

Reply