[petsc-users] Is it possible to free extra memory after matassemble?

Matthew Knepley knepley at gmail.com
Fri Feb 18 06:27:22 CST 2011


On Fri, Feb 18, 2011 at 6:04 AM, Gong Ding <gdiso at ustc.edu> wrote:

>
> ----- Original Message -----
> From: "Matthew Knepley" <knepley at gmail.com>
> To: "PETSc users list" <petsc-users at mcs.anl.gov>
> Sent: Friday, February 18, 2011 7:44 PM
> Subject: Re: [petsc-users] Is it possible to free extra memory after
> matassemble?
>
>
> > 2011/2/18 Gong Ding <gdiso at ustc.edu>
> >
> >> Hi,
> >> After update my FVM code to support higher order, I have to preallocate
> >> more memory when creating the matrix. However, only a few cells
> (determined
> >> at run time) needed to be high order, thus preallocated memory is
> overkill
> >> too much.
> >>
> >> Is it possible to add a function to reassemble the AIJ matrix to free
> the
> >> extra memory?
> >> Or it has already done when MatAssembly is called?
> >>
> >
> > This is done during MatAssemblyEnd(). However, there is no guarantee that
> > the operating system
> > actually returns that memory to general use.
> >
> >   Matt
>
> Could you please point out where can I find the MatAssemblyEnd routine for
> sequence AIJ matrix?
> I'd like to take a look at it.
>


http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/src/mat/impls/aij/seq/aij.c.html#MatAssemblyEnd_SeqAIJ

   Matt

-- 
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110218/0e98d074/attachment.htm>


More information about the petsc-users mailing list