On Mon, May 3, 2010 at 8:40 AM, Jed Brown <span dir="ltr"><<a href="mailto:jed@59a2.org">jed@59a2.org</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;">
On Mon, 3 May 2010 08:20:44 -0500, Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br>
> MatAssemblyBegin/End() frees the unused memory, so you must be<br>
> calculating the amount of memory needed incorrectly.<br>
<br>
It compacts the values but does not free the extra memory. It would be<br>
easy to add a matrix option to allocate new space for the entries and<br>
column indices, then copy the entries over, but requires too much memory<br>
to do it by default.<br></blockquote><div><br></div><div>Yep, does not free by default, which would mean making a copy.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
MatDuplicate on the other hand only allocates for the used values, but<br>
copies the "maxnz" field so it will incorrectly report more allocation<br>
than there really is.</blockquote><div><br></div><div>I can fix this.</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;">
<font color="#888888"><br>
Jed<br>
</font></blockquote></div><br><br clear="all"><br>-- <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>