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

## How to use Sparse BLAS Inspector-executor hints

Beginner
1,019 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

4 Replies
Moderator
1,001 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.

Beginner
995 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.

Moderator
990 Views

Thanks

Employee
982 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