<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">That helped.<br><br>I am also wondering about SEQ and MPI matrices, do they differ more than just in way of allocating data? When I run a small problem on 2 processes on single machine, it slows down greatly if I use <br><br><span style="font-style: italic;">MatCreateMPIAIJ(PETSC_COMM_WORLD,PETSC_DECIDE,PETSC_DECIDE,n,n,5,PETSC_NULL,5,PETSC_NULL,&amp;L);</span><br style="font-style: italic;"><br>As I get mallocs during mat assembly while o_nz and d_nz are set to 5 where 5 is max nonzeros per whole row. I also get stash:0 assuring that values are set by correct process.<br><br>Any hints on this one?<br><br>Thank you<br><br>Regards<br>Bartek Wach<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div class="plainMail">The order or the way the values are inserted shouldn't matter. As long<br>as the correct nozero
 structure is provided [with nnz] - there should<br>be no additional mallocs.<br><br>you can check with MatView() to see if the matrix is anyway different<br>in the 2 cases.<br><br>Satish<br><br></div></blockquote></td></tr></table>