On Fri, Feb 18, 2011 at 6:04 AM, Gong Ding <span dir="ltr"><<a href="mailto:gdiso@ustc.edu">gdiso@ustc.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;">
<div class="im"><br>
----- Original Message -----<br>
From: "Matthew Knepley" <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>><br>
To: "PETSc users list" <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br>
Sent: Friday, February 18, 2011 7:44 PM<br>
Subject: Re: [petsc-users] Is it possible to free extra memory after matassemble?<br>
<br>
<br>
> 2011/2/18 Gong Ding <<a href="mailto:gdiso@ustc.edu">gdiso@ustc.edu</a>><br>
><br>
>> Hi,<br>
>> After update my FVM code to support higher order, I have to preallocate<br>
>> more memory when creating the matrix. However, only a few cells (determined<br>
>> at run time) needed to be high order, thus preallocated memory is overkill<br>
>> too much.<br>
>><br>
>> Is it possible to add a function to reassemble the AIJ matrix to free the<br>
>> extra memory?<br>
>> Or it has already done when MatAssembly is called?<br>
>><br>
><br>
> This is done during MatAssemblyEnd(). However, there is no guarantee that<br>
> the operating system<br>
> actually returns that memory to general use.<br>
><br>
> Matt<br>
<br>
</div>Could you please point out where can I find the MatAssemblyEnd routine for sequence AIJ matrix?<br>
I'd like to take a look at it.<br>
</blockquote></div><br><a href="http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/src/mat/impls/aij/seq/aij.c.html#MatAssemblyEnd_SeqAIJ">http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/src/mat/impls/aij/seq/aij.c.html#MatAssemblyEnd_SeqAIJ</a><div>
<br></div><div> Matt<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>
</div>