petsc-3.7.1 2016-05-15
Report Typos and Errors

# MatCreateMPIAIJPERM

Creates a sparse parallel matrix whose local portions are stored as SEQAIJPERM matrices (a matrix class that inherits from SEQAIJ but includes some optimizations to allow more effective vectorization). The same guidelines that apply to MPIAIJ matrices for preallocating the matrix storage apply here as well.

### Synopsis

    PetscErrorCode  MatCreateMPIAIJPERM(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt M,PetscInt N,PetscInt d_nz,const PetscInt d_nnz[],PetscInt o_nz,const PetscInt o_nnz[],Mat *A)

Collective on MPI_Comm Many br

### Input Parameters

| comm | - MPI communicator Many br
| m | - number of local rows (or PETSC_DECIDE to have calculated if M is given) Many brThis value should be the same as the local size used in creating the Many bry vector for the matrix-vector product y = Ax. Many br
| n | - This value should be the same as the local size used in creating the Many brx vector for the matrix-vector product y = Ax. (or PETSC_DECIDE to have Many brcalculated if N is given) For square matrices n is almost always m. Many br
| M | - number of global rows (or PETSC_DETERMINE to have calculated if m is given) Many br
| N | - number of global columns (or PETSC_DETERMINE to have calculated if n is given) Many br
| d_nz | - number of nonzeros per row in DIAGONAL portion of local submatrix Many br(same value is used for all local rows) Many br
| d_nnz | - array containing the number of nonzeros in the various rows of the Many brDIAGONAL portion of the local submatrix (possibly different for each row) Many bror NULL, if d_nz is used to specify the nonzero structure. Many brThe size of this array is equal to the number of local rows, i.e 'm'. Many brFor matrices you plan to factor you must leave room for the diagonal entry and Many brput in the entry even if it is zero. Many br
| o_nz | - number of nonzeros per row in the OFF-DIAGONAL portion of local Many brsubmatrix (same value is used for all local rows). Many br
| o_nnz | - array containing the number of nonzeros in the various rows of the Many brOFF-DIAGONAL portion of the local submatrix (possibly different for Many breach row) or NULL, if o_nz is used to specify the nonzero Many brstructure. The size of this array is equal to the number Many brof local rows, i.e 'm'. Many br

### Output Parameter

A -the matrix Many br

### Notes

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

m,n,M,N parameters specify the size of the matrix, and its partitioning across Many brprocessors, while d_nz,d_nnz,o_nz,o_nnz parameters specify the approximate Many brstorage requirements for this matrix. Many br

If PETSC_DECIDE or PETSC_DETERMINE is used for a particular argument on one Many brprocessor than it must be used on all processors that share the object for Many brthat argument. Many br

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

The parallel matrix is partitioned such that the first m0 rows belong to Many brprocess 0, the next m1 rows belong to process 1, the next m2 rows belong Many brto process 2 etc.. where m0,m1,m2... are the input parameter 'm'. Many br

The DIAGONAL portion of the local submatrix of a processor can be defined Many bras the submatrix which is obtained by extraction the part corresponding Many brto the rows r1-r2 and columns r1-r2 of the global matrix, where r1 is the Many brfirst row that belongs to the processor, and r2 is the last row belonging Many brto the this processor. This is a square mxm matrix. The remaining portion Many brof the local submatrix (mxN) constitute the OFF-DIAGONAL portion. Many br

If o_nnz, d_nnz are specified, then o_nz, and d_nz are ignored. Many br

When calling this routine with a single process communicator, a matrix of Many brtype SEQAIJPERM is returned. If a matrix of type MPIAIJPERM is desired Many br

### for this type of communicator, use the construction mechanism

MatCreate(...,&A); MatSetType(A,MPIAIJ); MatMPIAIJSetPreallocation(A,...); Many br

By default, this format uses inodes (identical nodes) when possible. Many brWe search for consecutive rows with the same nonzero structure, thereby Many brreusing matrix information to achieve increased efficiency. Many br

### Options Database Keys

| -mat_no_inode | - Do not use inodes Many br
| -mat_inode_limit <limit> | - Sets inode limit (max limit=5) Many br
| -mat_aij_oneindex | - Internally use indexing starting at 1 Many brrather than 0. Note that when calling MatSetValues(), Many brthe user still MUST index entries starting at 0! Many br

Many br

### Keywords

matrix, cray, sparse, parallel

### See Also

MatCreate(), MatCreateSeqAIJPERM(), MatSetValues()

Level:intermediate
Location:src/mat/impls/aij/mpi/csrperm/mpicsrperm.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages