[petsc-dev] VecAXPY() in loops in TS

Barry Smith bsmith at mcs.anl.gov
Fri Feb 18 17:24:23 CST 2011

  Even adjusting the array passed in will be worth it.

  Should MAXPY have an optional constant scale factor, does it come up enough?


On Feb 18, 2011, at 5:03 PM, Jed Brown wrote:

> On Fri, Feb 18, 2011 at 19:48, Barry Smith <bsmith at mcs.anl.gov> wrote:
> Can some of the VecAXPY() calls in loops in TS be replaced with single VecMAXPY() calls? For example
>  for (j=0; j<r; j++) {
>          ierr = VecAXPY(gl->Z,-shift*u[i*r+j],X[j]);CHKERRQ(ierr);
>        }
> They can, but we would have to create a temporary array to hold the coefficients and run the loop to fill the coefficients into that array. I recall intending to do that when I first wrote this, but clearly it never happened.

More information about the petsc-dev mailing list