[petsc-users] Problem with Preallocating

Florian Lindner mailinglists at xgm.de
Fri Oct 31 10:05:08 CDT 2014



Am Donnerstag, 30. Oktober 2014, 09:19:38 schrieb Matthew Knepley:
> On Thu, Oct 30, 2014 at 7:25 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> >
> > > On Oct 30, 2014, at 3:36 AM, Florian Lindner <mailinglists at xgm.de>
> > wrote:
> > >
> > > Am Mittwoch, 29. Oktober 2014, 13:00:17 schrieb Barry Smith:
> > >>
> > >>   MatAssembly flushes out any preallocated space that was not used.
> > Hence when you try to put a diagonal entry in later it is as if you did not
> > preallocate. You should set zeros in the diagonal as part of your initial
> > setting values in the matrix before calling MatAssembly.
> > >
> > > Even with FLUSH_ASSEMBLY?
> >
> >    No, flush assembly does not clean out any unused preallocated space.
> > final assembly does
> >
> 
> Something else must be going on in your full code (as shown by the small
> example). Are you running it
> in serial or parallel?

Of course you were right. Something else was going on, that's why I couldn't produce an example. I was not doing a FLUSH_ASSEMBLY but FULL_ASSEMBLY instead because of some bug in my petsc helper functions. 

I'm so sorry for having bothered you with that!

Florian


More information about the petsc-users mailing list