← 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 Thu, Mar 08, 2012 at 09:53:48PM +0000, Garth N. Wells wrote:
>
>
> On 8 Mar 2012, at 21:43, Johan Hake <hake.dev@xxxxxxxxx> wrote:
>
> > On Thu, Mar 8, 2012 at 9:40 PM, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
> >> This change is not safe. For a matrix and a vector to be compatible in
> >> parallel, it is not sufficient to check the global size.
> >
> > True. The logic is that a user need to provide a result vector with
> > correct size and parallell structure. If not just pass an empty
> > vector. The problem with always resizing the result is that one loose
> > performance for iterative solvers using A.mult(x, y).
>
>
> 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.

It should be possible to send in an empty vector and get automatic
resize.

--
Anders


> Garth
>
> >
> > Johan
> >
> >> Garth
> >>
> >>
> >>
> >>
> >> ---------- Forwarded message ----------
> >> From:  <noreply@xxxxxxxxxxxxx>
> >> Date: 8 March 2012 20:31
> >> Subject: [Branch ~dolfin-core/dolfin/trunk] Rev 6630: Avoid
> >> unnessesary resize of result vector for A.mult(x, y)
> >> To: Garth Wells <gnw20@xxxxxxxxx>
> >>
> >>
> >> ------------------------------------------------------------
> >> revno: 6630
> >> committer: Johan Hake <hake.dev@xxxxxxxxx>
> >> branch nick: work-trunk
> >> timestamp: Thu 2012-03-08 21:25:41 +0100
> >> message:
> >>  Avoid unnessesary resize of result vector for A.mult(x, y)
> >>    -- Apply patch from Joachim
> >> modified:
> >>  ChangeLog
> >>  dolfin/la/EpetraMatrix.cpp
> >>  dolfin/la/GenericMatrix.h
> >>  dolfin/la/PETScMatrix.cpp
> >>  dolfin/la/uBLASMatrix.h
> >>  dolfin/swig/la/post.i
> >>  test/unit/la/python/KrylovSolver.py
> >>
> >>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp


References