# MatCreateSeqAIJMKL
Creates a sparse matrix of type `MATSEQAIJMKL`. This type inherits from `MATSEQAIJ` and is largely identical, but uses sparse BLAS routines from Intel MKL whenever possible. If the installed version of MKL supports the "SpMV2" sparse inspector-executor routines, then those are used by default. `MatMult()`, `MatMultAdd()`, `MatMultTranspose()`, `MatMultTransposeAdd()`, `MatMatMult()`, `MatTransposeMatMult()`, and `MatPtAP()` (for symmetric A) operations are currently supported. Note that MKL version 18, update 2 or later is required for `MatPtAP()`, `MatPtAPNumeric()` and `MatMatMultNumeric()`. 
## Synopsis
```
PetscErrorCode MatCreateSeqAIJMKL(MPI_Comm comm, PetscInt m, PetscInt n, PetscInt nz, const PetscInt nnz[], Mat *A)
```
Collective


## Input Parameters

- ***comm -*** MPI communicator, set to `PETSC_COMM_SELF`
- ***m -*** number of rows
- ***n -*** number of columns
- ***nz -*** number of nonzeros per row (same for all rows)
- ***nnz -*** array containing the number of nonzeros in the various rows
(possibly different for each row) or NULL



## Output Parameter

- ***A -*** the matrix



## Options Database Keys

- ***-mat_aijmkl_no_spmv2 -*** disable use of the SpMV2 inspector-executor routines
- ***-mat_aijmkl_eager_inspection -*** perform MKL "inspection" phase upon matrix assembly; default is to do "lazy" inspection, performing this step the first time the matrix is applied



## Note
If nnz is given then nz is ignored




## See Also
 `MatCreate()`, `MatCreateMPIAIJMKL()`, `MatSetValues()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/seq/aijmkl/aijmkl.c.html#MatCreateSeqAIJMKL">src/mat/impls/aij/seq/aijmkl/aijmkl.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/aij/seq/aijmkl/aijmkl.c)


[Index of all Mat routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
