We partition a matrix by rows into several sub-matrix. If the start row and the end row indices of a sub-matrix B is m and n, then the a diagonal matrix  can be defined as
B_{i,j},  m<i<n-m  and  m<j<n-m. 
Also see this link:
http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMPIAIJSetPreallocation.html