← Back to team overview

dolfin team mailing list archive

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

 

On 24 January 2011 23:09, Johan Hake <706909@xxxxxxxxxxxxxxxxxx> wrote:
> On Monday January 24 2011 13:59:33 Joachim Haga wrote:
>> Turns out the same problem is in C++; mult() does resize() on the vector
>> internally, using size(0) instead of local_range(0).
>>
>> So I guess the solution would be to not initialise the matrix in python,
>> just pass an empty one, and change the resize() call in C++.
>
> Ok, good to know!
>
> Then you might have a patch ready, as we do not need a typemap for that
> one?

Not ready, but will send one later this week, if nobody beats me to it.

> I will add that typemap anyhow ;)

Might come in handy some day :)

-j.

-- 
You received this bug notification because you are a member of DOLFIN
Team, which is subscribed to DOLFIN.
https://bugs.launchpad.net/bugs/706909

Title:
  [python] matrix multiplication fails in parallel

Status in DOLFIN:
  New

Bug description:
  The python code for __mul__() assumes an empty vector suitable for
  mult() can be created from just the dimensions of the matrix:

      if type(other) == Vector:
          ret = Vector(self.size(0))

  This is not true in parallel. And it won't help to copy the input
  vector, as that only works for square matrices.

  How to create a vector which is compatible with a given matrix at this
  point (only the matrix available, not the sparsity pattern)? Would it
  perhaps be acceptable to add methods create_right_vector(),
  create_left_vector() to GenericMatrix?





References