[petsc-users] parallel Mat Mult a serial Vec or a serial Mat

Matthew Knepley knepley at gmail.com
Sun Jan 20 12:38:46 CST 2013


On Sun, Jan 20, 2013 at 12:26 PM, Hui Zhang <mike.hui.zhang at hotmail.com>wrote:

>
> On Jan 20, 2013, at 5:28 PM, Jed Brown wrote:
>
> > On Sun, Jan 20, 2013 at 10:22 AM, Hui Zhang <mike.hui.zhang at hotmail.com>
> wrote:
> >
> > On Jan 20, 2013, at 5:13 PM, Jed Brown wrote:
> >
> > > No, MatMult and MatMatMult require all objects to be on the same
> communicator.
> >
> > Thanks for the quick answer!  It seems a general rule that all operands
> and results must be
> > on the same communicator.  Can I lift an object from a sub-communicator
> to the sup-communicator
> > without changing the parallel layout of the object?
> >
> > You can with a Vec (e.g., using VecPlaceArray), but you're responsible
> for the sharing so it's fragile.
> >
> > In general, I recommend creating the object on the largest communicator
> involved and then getting access more locally. In the first pass, just make
> a copy to a local subcomm unless a routine exists to do it automatically.
> If you profile and see that the copy is significant (remarkably rare in
> practice) you can sometimes optimize what is copied versus shared, or
> change the parent parallel data structure to make the local access faster.
>
> I think about the method and find it is not as convenient as allowing
> inter-communicator operations.
> For example, VecScatter actually allows the two Vec in different
> communicators (or one must include
> the other?).
>

This is about the design of MPI.


> I have more questions.
> (1) Does MatScatter supports MatMatMult?
>

No


> (2) Does MatConvert works on MATNEST?
>

Yes, for AIJ


> (3) Does MatGetLocalSubMat support localization to a sub-communicator
> instead of a process?
>

No, use MatGetSubMatrix.

   Matt


> Thanks!
>
> >
> > >
> > >
> > > On Sun, Jan 20, 2013 at 10:12 AM, Hui Zhang <
> mike.hui.zhang at hotmail.com> wrote:
> > > parallel Mat, multiplies a serial Vec or a serial Mat
> > >
> > > Is it supported directly? If yes, can the resulting Vec/Mat be serial
> or parallel?
> > >
> > >
> >
> >
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130120/97b83618/attachment.html>


More information about the petsc-users mailing list