[petsc-dev] preallocation

Barry Smith bsmith at mcs.anl.gov
Tue Sep 20 11:12:13 CDT 2011


On Sep 20, 2011, at 11:06 AM, Matthew Knepley wrote:

> On Tue, Sep 20, 2011 at 2:44 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> I'm so tired of calling a different preallocation variant for each matrix format.
> 
> MatMPIBAIJSetPreallocation() has enough information to preallocate {Seq,MPI}{AIJ,BAIJ}. Should we make this one call enough?

   We should move all the additional functionality that AIJ provides (inodes, whatever else) into BAIJ and then remove all of AIJ.   It is a big extra source code duplication maintenance nightmare it would be nice to get rid of.

   Barry

> 
> I disagree with this. I think the correct reduction in complexity is for the DM to call all relevant versions.
> 
>    Matt
>  
> Downsides:
> 
> If the user wants to allocate some special pattern within blocks, this would fill it all in, so they would have to check the types and call only the version that they really want.
> 
> Old code calls all these functions which could mean a lot of reallocation, they can change the code to only call this one function.
> 
> 
> 
> -- 
> 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




More information about the petsc-dev mailing list