# MatCreateMPIMatConcatenateSeqMat
Creates a single large PETSc matrix by concatenating sequential matrices from each processor 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatCreateMPIMatConcatenateSeqMat(MPI_Comm comm, Mat seqmat, PetscInt n, MatReuse reuse, Mat *mpimat)
```
Collective


## Input Parameters

- ***comm -*** the communicators the parallel matrix will live on
- ***seqmat -*** the input sequential matrices
- ***n -*** number of local columns (or `PETSC_DECIDE`)
- ***reuse -*** either `MAT_INITIAL_MATRIX` or `MAT_REUSE_MATRIX`



## Output Parameter

- ***mpimat -*** the parallel matrix generated





## Note
The number of columns of the matrix in EACH processor MUST be the same.


## See Also
 `Mat`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/interface/matrix.c.html#MatCreateMPIMatConcatenateSeqMat">src/mat/interface/matrix.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/mpi/mpiaij.c.html#MatCreateMPIMatConcatenateSeqMat_MPIAIJ">MatCreateMPIMatConcatenateSeqMat_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/seq/aij.c.html#MatCreateMPIMatConcatenateSeqMat_SeqAIJ">MatCreateMPIMatConcatenateSeqMat_SeqAIJ in src/mat/impls/aij/seq/aij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/baij/mpi/mpibaij.c.html#MatCreateMPIMatConcatenateSeqMat_MPIBAIJ">MatCreateMPIMatConcatenateSeqMat_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/baij/seq/baij.c.html#MatCreateMPIMatConcatenateSeqMat_SeqBAIJ">MatCreateMPIMatConcatenateSeqMat_SeqBAIJ in src/mat/impls/baij/seq/baij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/mpi/mpidense.c.html#MatCreateMPIMatConcatenateSeqMat_MPIDense">MatCreateMPIMatConcatenateSeqMat_MPIDense in src/mat/impls/dense/mpi/mpidense.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/dense/seq/dense.c.html#MatCreateMPIMatConcatenateSeqMat_SeqDense">MatCreateMPIMatConcatenateSeqMat_SeqDense in src/mat/impls/dense/seq/dense.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sbaij/mpi/mpisbaij.c.html#MatCreateMPIMatConcatenateSeqMat_MPISBAIJ">MatCreateMPIMatConcatenateSeqMat_MPISBAIJ in src/mat/impls/sbaij/mpi/mpisbaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sbaij/seq/sbaij.c.html#MatCreateMPIMatConcatenateSeqMat_SeqSBAIJ">MatCreateMPIMatConcatenateSeqMat_SeqSBAIJ in src/mat/impls/sbaij/seq/sbaij.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/interface/matrix.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)  
