At this time I would hide the hints and just set reasonable ones and then have the MatAssemblyEnd for the new class provide the default hints and then call the optimize, but keep all of that stuff hidden from the PETSc API.
Barry > On Feb 13, 2017, at 6:03 PM, Richard Mills <[email protected]> wrote: > > Hi All, > > I've finally gotten around to putting together a matrix class (called AIJMKL > for now) that inherits from AIJ but uses some methods provided by Intel MKL. > One thing I'd like to support is the "SpMV 2" sparse inspector-executor > routines, detailed in the MKL reference manual starting at > > https://software.intel.com/en-us/node/590105 > > The basic usage model is this: You set some hints (see the functions at > https://software.intel.com/en-us/node/590120) about how a matrix you have is > going to be used, e.g., you call 'mkl_sparse_mv_hint' to set a guess about > the number of upcoming matrix-vector multiplications that will be performed > with this matrix. When you've set various hints, then you call > 'mkl_sparse_optimize' to start an analysis operation in which MKL examines > the sparsity structure and maybe does some internal things for optimizations. > Then you can then apply mkl_sparse_d_mv to perform mat-vec operations. > > I am wondering what a proper way to provide a PETSc interface to these is. I > can think of a few ways to do this. The most straightforward way is probably. > > * Add MatAIJMKLSetMVHint(), MatAIJMKLSetMMHint(), etc. > * Add MatAIJMKLOptimize() call. > > I also will be adding a BAIJMKL class for BAIJ matrices, so I'd duplicate > these. Does this option sound OK? Or do others think I should do something > more general? > > --Richard
