How to generate a parallel matrix with a sequential dense matrix?

Yujie recrusader at
Mon Sep 22 13:34:21 CDT 2008

Thank you for your reply, Matt. I have checked the tutorials. They just use
specified values and MatSetValues() to make a parallel matrix. Now, the
matrix I use is in a single node of the cluster. I have 'M' nodes in this
cluster. I need to copy the sequential matrix to other 'M-1' nodes and then
use MatSetValues() or I just use MatSetvalues() in the node where the matrix
is? The latter should work, right? thanks.


On Mon, Sep 22, 2008 at 11:09 AM, Matthew Knepley <knepley at> wrote:

> The right way to do this is to input the matrix using MatSetValues()
> in a distribute fashion. You can consult any of the tutorials, for instance
> KSP ex2 for an example of this.
>  Matt
> On Mon, Sep 22, 2008 at 12:57 PM, Yujie <recrusader at> wrote:
> > Hi, Petsc developer
> >
> > Now, I have a sequential dense matrix. How to get a parallel matrix based
> on
> > it? thanks a lot.
> >
> > Regards,
> >
> > Yujie
> --
> 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: <>

More information about the petsc-users mailing list