# MatStashSetInitialSize
sets the sizes of the matrix stash, that is used during the assembly process to store values that belong to other processors. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatStashSetInitialSize(Mat mat, PetscInt size, PetscInt bsize)
```
Not Collective


## Input Parameters

- ***mat   -*** the matrix
- ***size  -*** the initial size of the stash.
- ***bsize -*** the initial size of the block-stash(if used).



## Options Database Keys

- ***-matstash_initial_size <size> or <size0,size1,...sizep-*** 1>
- ***-matstash_block_initial_size <bsize>  or <bsize0,bsize1,...bsizep-*** 1>





## Notes
The block-stash is used for values set with `MatSetValuesBlocked()` while
the stash is used for values set with `MatSetValues()`

Run with the option -info and look for output of the form
MatAssemblyBegin_MPIXXX:Stash has MM entries, uses nn mallocs.
to determine the appropriate value, MM, to use for size and
MatAssemblyBegin_MPIXXX:Block-Stash has BMM entries, uses nn mallocs.
to determine the value, BMM to use for bsize


## See Also
 `MatAssemblyBegin()`, `MatAssemblyEnd()`, `Mat`, `MatStashGetInfo()`

## Level
intermediate

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


---
[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)  
