On Tue, Jan 17, 2012 at 2:29 PM, Tabrez Ali <span dir="ltr"><<a href="mailto:stali@geology.wisc.edu">stali@geology.wisc.edu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello<br>
<br>
If we are not doing exact pre-allocation (I know this is despised by PETSc developers) then it seems that we need to specify an nz (per row) value of at least "max nonzeros in any row".<br>
<br>
<br>
For example with nz=18 I do get 0 mallocs<br>
<br>
[0] MatAssemblyEnd_SeqAIJ(): Matrix size: 5236 X 5236; storage space: 22728 unneeded,71520 used<br>
[0] MatAssemblyEnd_SeqAIJ(): Number of mallocs during MatSetValues() is 0<br>
[0] MatAssemblyEnd_SeqAIJ(): Maximum nonzeros in any row is 18<br>
<br>
<br>
But with nz=16 I get 10 mallocs<br>
<br>
[0] MatAssemblyEnd_SeqAIJ(): Matrix size: 5236 X 5236; storage space: 12406 unneeded,71520 used<br>
[0] MatAssemblyEnd_SeqAIJ(): Number of mallocs during MatSetValues() is 10<br>
[0] MatAssemblyEnd_SeqAIJ(): Maximum nonzeros in any row is 18<br>
<br>
So the question is that why is the number of mallocs 10 (with nz=16) when the total storage space has been overestimated (because it says "12406 unneeded")?<br>
<br>
Or does "unneeded" mean something else?<br></blockquote><div><br></div><div>We are doing things row-by-row here, so each row gets more space, but we do not continually</div><div>move the rest of the matrix around.</div>
<div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks in advance<span class="HOEnZb"><font color="#888888"><br>
<br>
Tabrez<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>