[petsc-users] Assembly of local Mat's to a parallel Mat
Matthew Knepley
knepley at gmail.com
Fri Apr 12 12:09:55 CDT 2013
On Fri, Apr 12, 2013 at 11:49 AM, Hui Zhang <mike.hui.zhang at hotmail.com>wrote:
>
> On Apr 12, 2013, at 5:22 PM, Jed Brown wrote:
>
> > Hui Zhang <mike.hui.zhang at hotmail.com> writes:
> >
> >> Assembly it directly. I just found MatGetSubMatricesParallel.
> >
> > This is not a private implementation function so it's not a good place
> > to learn. It also doesn't do what you want.
> >
> > For your purpose, you can either loop over the entries of A_i inserting
> > them according to the R_i
>
> I can understand this method. A further question: since Ai itself is
> shared
> by many processors, MatSetValues to A should be called by only one of the
> processor sharing Ai. Is it right?
>
MatSetValues() is not collective.
> > or you can create a block diagonal parallel
> > matrix A_i constructed by joining together all the diagonal blocks.
>
> Which function can do this? I only found diagonal block Mat with each
> block
> of the same size and dense. Thanks!
>
This is just a simple shift in index with normal MatSetValues().
Matt
> > Presumably R is already parallel, so then you can use MatPtAP to
> > assemble the product.
> >
> > Note that you might be able to assemble the block diagonal A directly.
> >
> >> Maybe I can learn from the source codes of this function but I can not
> >> find where they are.
> >
> > For navigating source code, see the manual section about setting up GNU
> > Global tags or etags. PETSc functions are named to tab complete well
> > with tags.
> >
>
>
--
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/20130412/c84997f1/attachment.html>
More information about the petsc-users
mailing list