Skip to main content
`Ctrl`+`K`

# MatCreateSubMatricesMPI

Extracts MPI submatrices across a sub communicator of `mat` (by pairs of `IS` that may live on subcomms).

## Synopsis

    #include "petscmat.h"
    PetscErrorCode MatCreateSubMatricesMPI(Mat mat, PetscInt n, const IS irow[], const IS icol[], MatReuse scall, Mat *submat[])

Collective

## Input Parameters

- mat - the matrix

- n - the number of submatrixes to be extracted

- irow - index set of rows to extract

- icol - index set of columns to extract

- scall - either `MAT_INITIAL_MATRIX` or `MAT_REUSE_MATRIX`

## Output Parameter

- submat - the array of submatrices

## Note

This is used by `PCGASM`

## See Also

Matrices, `Mat`, `PCGASM`, `MatCreateSubMatrices()`, `MatCreateSubMatrix()`, `MatGetRow()`, `MatGetDiagonal()`, `MatReuse`

## Level

advanced

## Location

src/mat/interface/matrix.c

## Implementations

MatCreateSubMatricesMPI_MPIAdj() in src/mat/impls/adj/mpi/mpiadj.c
MatCreateSubMatricesMPI_MPIXAIJ(Mat C, PetscInt ismax, const IS isrow[], const IS iscol[], MatReuse scall, Mat *submat[], PetscErrorCode (*getsubmats_seq)(Mat, PetscInt, const IS[], const IS[], MatReuse, Mat **), PetscErrorCode (*getlocalmats)(Mat, Mat *, Mat *), PetscErrorCode (*setseqmat)(Mat, IS, IS, MatStructure, Mat), PetscErrorCode (*setseqmats)() in src/mat/impls/aij/mpi/mpiov.c
MatCreateSubMatricesMPI_MPIAIJ() in src/mat/impls/aij/mpi/mpiov.c

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages