[petsc-users] MatPtAP

Barry Smith bsmith at mcs.anl.gov
Wed Feb 24 00:06:17 CST 2016


  Yes, could definitely be faster with a custom code but a bit of a pain to write.

> On Feb 23, 2016, at 10:08 PM, David Knezevic <david.knezevic at akselos.com> wrote:
> 
> On Tue, Feb 23, 2016 at 10:40 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
>   A custom MatPtAP would almost surely pay off, but it is only an optimization so you need to ask if this computation is your main "blocker" to getting more "science" done.  Can you send a picture of the exact structure of P?
> 
> I've attached a picture of the sparsity pattern of P. There are 0s and 1s on the diagonal, and some dense columns in the first few columns.
> 
> David
> 
> 
>  
> 
> 
> 
> 
> 
> > On Feb 23, 2016, at 9:35 PM, David Knezevic <david.knezevic at akselos.com> wrote:
> >
> > I'm using MatPtAP, which works well for me, but in some examples I've tested the PtAP calculation dominates the overall solve time (e.g. see attached -log_summary output).
> >
> > In my case, A is a stiffness matrix, and P is the identity matrix except for a small number of columns (e.g. about 10 or so) which are dense.
> >
> > In this situation, I was wondering if there is a more efficient way to proceed than using MatPtAP? For example, would it be noticeably faster to calculate P^T A P directly using MatMults for the dense columns, rather than using MatPtAP?
> >
> > Thanks!
> > David
> >
> >
> > <PtAP_log_summary.txt>
> 
> 
> <P_sparsity.png>



More information about the petsc-users mailing list