[petsc-users] MatSetValues and values cache
Alexander Grayver
agrayver at gfz-potsdam.de
Wed Jun 6 06:41:42 CDT 2012
On 06.06.2012 13:06, Jed Brown wrote:
> On Wed, Jun 6, 2012 at 5:22 AM, Alexander Grayver
> <agrayver at gfz-potsdam.de <mailto:agrayver at gfz-potsdam.de>> wrote:
>
> In my program I assemble huge matrix (~500 millions of double
> complex nnz) and all MatSetValues calls are done before
> MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY).
> I'm wondering if it makes sense to use MatAssemblyBegin(A,
> MAT_FLUSH_ASSEMBLY) in between? In docs it is said:
> >> MatSetValues
> <http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetValues.html#MatSetValues>()
> generally caches the values.
>
> How does the caching work actually? Is this additionally allocated
> memory (dynamic or not)?
>
>
> Only entries that are generated on a different process than they need
> to be stored will be cached. If you generate most entries on the
> correct process (the owned rows for MPI*AIJ matrices), there is no
> need to flush.
Jed,
Makes sense. I should have thought about that. I have off process
entries, although not many.
Thanks.
>
> You can also look at -log_summary to see if an inordinate amount of
> time is spent in assembly.
--
Regards,
Alexander
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120606/4f4ae627/attachment.html>
More information about the petsc-users
mailing list