← Back to team overview

dolfin team mailing list archive

Re: Fwd: [Branch ~dolfin-core/dolfin/trunk] Rev 6630: Avoid unnessesary resize of result vector for A.mult(x, y)

 

On 8 March 2012 22:39, Joachim Berdal Haga <jobh@xxxxxxxxx> wrote:
> On 8 March 2012 22:53, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>> The only proper solution that I see is that a user is responsible for making sure that the size is right and that the function do no resizing. The change is a half-way house, so I think that it should be reverted. The old code was safe, and the proper, efficient alternative is that no resizing be done.
>
> Is it the resize-if-zero you object to, or the
> error-if-incorrect-size?

No objection. I mis-read the patch - if only zero-sized vectors are
being re-sized, it's fine.

Garth

> The former is just convenience, but I can't
> really see why it's unsafe. The latter is not generally sufficient in
> parallel, but it is consistent with all the other global-size checks
> (for b, and in vector::axpy, etc).
>
> -j.


References