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)?
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.