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

Barry Smith bsmith at mcs.anl.gov
Mon Sep 22 18:00:02 CDT 2008


  Likely it would be better; it should not be worse.

   Barry


On Sep 22, 2008, at 4:44 PM, Aron Ahmadia wrote:

> Wouldn't it be better in this case to use an MPIScatterV?
>
> ~A
>
> On Mon, Sep 22, 2008 at 4:03 PM, Barry Smith <bsmith at mcs.anl.gov>  
> wrote:
>
>  I would only expect good performance if you used MPI calls to send  
> the blocks of rows of the matrix to the process
> they belong to and use MatGetArray() to pass into the MPI_Recv to  
> receive the data into.
>
>  Barry
>
>
> On Sep 22, 2008, at 1:34 PM, Yujie wrote:
>
> 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.
>
> Yujie
>
>
> On Mon, Sep 22, 2008 at 11:09 AM, Matthew Knepley  
> <knepley at gmail.com> 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 gmail.com> 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
>
>
>
>




More information about the petsc-users mailing list