[petsc-users] MatMPIAIJSetPreallocation question

Barry Smith bsmith at mcs.anl.gov
Mon Aug 7 07:49:58 CDT 2017


> On Aug 7, 2017, at 7:40 AM, Xiangdong <epscodes at gmail.com> wrote:
> 
> Hi Barry,
> 
> Thanks for your response. So these extra allocated memory is just a waste of memory, but no harm for other mat related computation. Is it correct?

   Yes, and given how virtual memory works with pages it isn't even much of a waste of memory.


> 
> Thank you.
> 
> Xiangdong
> 
> On Fri, Aug 4, 2017 at 4:52 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
> > On Aug 4, 2017, at 2:52 PM, Xiangdong <epscodes at gmail.com> wrote:
> >
> > Hello everyone,
> >
> > I have a quick questions on the MatMPIAIJSetPreallocation. If we do not pass the exact number of nonzeros for o_nnz and d_nnz, (for example, MAT_INFO_NZ_ALLOCATED is 50% more than MAT_INFO_NZ_USED), will the performance of MatMult be affected? What effect will these allocated but unused memory cause?
> 
>    It is not a big deal to have extra memory, it won't slow things down. If you under estimate it can slow things down a lot.
> 
> >
> > Thank you.
> >
> > Best,
> > Xiangdong
> 
> 



More information about the petsc-users mailing list