# MatCreateMPIAIJMKL#

Creates a sparse parallel matrix whose local portions are stored as `MATSEQAIJMKL`

matrices (a matrix class that inherits from `MATSEQAIJ`

but uses some operations provided by Intel MKL).

## Synopsis#

Collective

## Input Parameters#

MPI communicator**comm -**number of local rows (or**m -**`PETSC_DECIDE`

to have calculated if`M`

is given) This value should be the same as the local size used in creating the y vector for the matrix-vector product y = Ax.This value should be the same as the local size used in creating the x vector for the matrix-vector product y = Ax. (or**n -**`PETSC_DECIDE`

to have calculated if N is given) For square matrices n is almost always`m`

.number of global rows (or**M -**`PETSC_DETERMINE`

to have calculated if`m`

is given)number of global columns (or**N -**`PETSC_DETERMINE`

to have calculated if`n`

is given)number of nonzeros per row in DIAGONAL portion of local submatrix (same value is used for all local rows)**d_nz -**array containing the number of nonzeros in the various rows of the DIAGONAL portion of the local submatrix (possibly different for each row) or**d_nnz -**`NULL`

, if`d_nz`

is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e`m`

. For matrices you plan to factor you must leave room for the diagonal entry and put in the entry even if it is zero.number of nonzeros per row in the OFF-DIAGONAL portion of local submatrix (same value is used for all local rows).**o_nz -**array containing the number of nonzeros in the various rows of the OFF-DIAGONAL portion of the local submatrix (possibly different for each row) or**o_nnz -**`NULL`

, if`o_nz`

is used to specify the nonzero structure. The size of this array is equal to the number of local rows, i.e`m`

.

## Output Parameter#

the matrix**A -**

## Options Database Key#

disables use of the SpMV2 inspector-executor routines**-mat_aijmkl_no_spmv2 -**

## Notes#

If the *_nnz parameter is given then the *_nz parameter is ignored

`m`

,`n`

,`M`

,`N`

parameters specify the size of the matrix, and its partitioning across
processors, while `d_nz`

,`d_nnz`

,`o_nz`

,`o_nnz`

parameters specify the approximate
storage requirements for this matrix.

If `PETSC_DECIDE`

or `PETSC_DETERMINE`

is used for a particular argument on one
processor than it must be used on all processors that share the object for
that argument.

The user MUST specify either the local or global matrix dimensions (possibly both).

If `m`

and `n`

are not `PETSC_DECIDE`

, then the values determine the `PetscLayout`

of the matrix and the ranges returned by
`MatGetOwnershipRange()`

, `MatGetOwnershipRanges()`

, `MatGetOwnershipRangeColumn()`

, and `MatGetOwnershipRangesColumn()`

.

The parallel matrix is partitioned such that the first `m0`

rows belong to
process 0, the next `m1`

rows belong to process 1, the next `m2`

rows belong
to process 2, etc., where `m0`

, `m1`

, `m2`

… are the input parameter `m`

on each MPI process.

The DIAGONAL portion of the local submatrix of a processor can be defined
as the submatrix which is obtained by extraction the part corresponding
to the rows `r1`

- `r2`

and columns `r1`

- `r2`

of the global matrix, where `r1`

is the
first row that belongs to the processor, and `r2`

is the last row belonging
to the this processor. This is a square mxm matrix. The remaining portion
of the local submatrix (mxN) constitute the OFF-DIAGONAL portion.

If `o_nnz`

, `d_nnz`

are specified, then `o_nz`

, and `d_nz`

are ignored.

When calling this routine with a single process communicator, a matrix of
type `MATSEQAIJMKL`

is returned. If a matrix of type `MATMPIAIJMKL`

is desired
for this type of communicator, use the construction mechanism

```
MatCreate(...,&A);
MatSetType(A,MPIAIJMKL);
MatMPIAIJSetPreallocation(A,...);
```

## See Also#

Matrices, `Mat`

, Sparse Matrix Creation, `MATMPIAIJMKL`

, `MatCreate()`

, `MatCreateSeqAIJMKL()`

,
`MatSetValues()`

, `MatGetOwnershipRange()`

, `MatGetOwnershipRanges()`

, `MatGetOwnershipRangeColumn()`

,
`MatGetOwnershipRangesColumn()`

, `PetscLayout`

## Level#

intermediate

## Location#

src/mat/impls/aij/mpi/aijmkl/mpiaijmkl.c

Index of all Mat routines

Table of Contents for all manual pages

Index of all manual pages