On Jan 28, 2012, at 1:15 PM, Jed Brown wrote:

> On Sat, Jan 28, 2012 at 13:11, Barry Smith <bsmith at mcs.anl.gov> wrote:
> MatPreallocated() or MatSetUpPreallocation()
> 
> Why are these functions different? The body of MatSetUpPreallocation() checks 
> the same conditional, so I don't think we need both.

  Jed,

   Since MatSetUpPreallocated() was called inside MatSetValues() the macro 
MatPreallocated() was added to prevent unneeded functions calls in the inner 
kernel MatSetValues().

   With modern PETSc we can get rid of MatPreallocated() everywhere and use 
MatSetUpPreallocation() directly everywhere then 

1)  say we don't think that function call overhead matters where it is called 
now or
2) turn it into a static inline function.

   You decide,

   Barry




Reply via email to