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

Gong Ding gdiso at ustc.edu
Fri Feb 18 06:04:51 CST 2011

----- 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.

More information about the petsc-users mailing list