#include "petscmat.h" PetscErrorCode MatSeqSELLSetPreallocation(Mat B,PetscInt rlenmax,const PetscInt rlen[])Collective on MPI_Comm
Specify the preallocated storage with either nz or nnz (not both). Set nz=PETSC_DEFAULT and nnz=NULL for PETSc to control dynamic memory allocation. For large problems you MUST preallocate memory or you will get TERRIBLE performance, see the users' manual chapter on matrices.
You can call MatGetInfo() to get information on how effective the preallocation was; for example the fields mallocs,nz_allocated,nz_used,nz_unneeded; You can also run with the option -info and look for messages with the string malloc in them to see if additional memory allocation was needed.
Developers: Use nz of MAT_SKIP_ALLOCATION to not allocate any space for the matrix entries or columns indices.
The maximum number of nonzeos in any row should be as accurate as possible. If it is underestimated, you will get bad performance due to reallocation (MatSeqXSELLReallocateSELL).
.seealso: MatCreate(), MatCreateSELL(), MatSetValues(), MatGetInfo()