← Back to team overview

dolfin team mailing list archive

Re: [Bug 706909] [NEW] [python] matrix multiplication fails in parallel

 

On Tue, Jan 25, 2011 at 03:40:37PM +0000, Garth N. Wells wrote:
>
>
> On 25/01/11 15:26, Joachim Berdal Haga wrote:
> >
> >
> > On 25 January 2011 16:15, Garth N. Wells <gnw20@xxxxxxxxx
> > <mailto:gnw20@xxxxxxxxx>> wrote:
> >
> >     On 25/01/11 15:06, Joachim Berdal Haga wrote:
> >     >     > It seems that this is only implemented for rows, not for
> >     columns.
> >     >
> >     >     Do you mean GenericMatrix::local_range? It takes a dim argument,
> >     >
> >     >      std::pair<uint, uint> GenericMatrix::local_range(uint dim);
> >     >
> >     >
> >     > Yes, but:
> >     >
> >     >    if (dim == 1)
> >     >     error("Cannot compute columns range for Epetra matrices.");
> >     >
> >     > ...
> >     >
> >     >       if (dim == 1)
> >     >         error("Cannot compute columns range for PETSc matrices.");
> >     >
> >
> >     OK.
> >
> >     We need to look at this more carefully. PETSc provides the function
> >
> >      MatGetVecs(Mat mat,Vec *right,Vec *left)
> >
> >     for getting vectors with a compatible layout, which might be helpful.
> >
> >
> >  Very helpful, yes. And epetra matrices has a RowMatrixColMap methods
> > which can be used. Do you think it's worth it to add
> > create_{left,right}_vector to the GenericMatrix interface as I suggested
> > initially?
> >
>
> I'd prefer to take a closer look before committing.
>
> It's good to have another parallel tester!
>
> Garth

To follow the current design, we should rather have a method that
returns whatever data is needed to create a vector, then use the
existing factory method to actually create the vector:

1. get layout data from matrix
2. get factory from matrix
3. use factory to create vector

--
Anders



Follow ups

References