[petsc-dev] MatTransposeMatMult

Hong hzhang at mcs.anl.gov
Thu Sep 21 20:35:22 CDT 2017


Jed:

> Hong <hzhang at mcs.anl.gov> writes:
>
> > Jed,
> > I reproduced what you observed.
> > 30x time is spent on numerical C = At*B.
> > We compute A^T*B using outer product C=(A^T)[:,i]*B[i,:].
> > For your large matrix A: rows=574902, cols=184446,
> > outer product takes long long time to insert values to C.
> >
> > We may use At=A^T and C=At*B instead.
>
> Right.  My point is that users call MatTransposeMatMult and conclude
> that PETSc is super slow compared to other software.  The could call
> MatTranspose then MatMatMult and get fast results, but that's a sucky
> and confusing interface.  Is there a compelling reason to keep the outer
> product implementation around?  Are there any matrices for which it is
> competitive?
>

It was implemented a decade ago for small to medium matrices.
Your matrix structure reveals the worst part of outer product.

After discussing it with Barry, we decided to replace the algorithm (not
API) using At=A^T and C=At*B  for sequential implementation.
In parallel, I'll do local MatTranspose (used for PtAP).
I'll give you this new implementation in few days.

Hong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170921/3910420e/attachment.html>


More information about the petsc-dev mailing list