<div class="gmail_quote">On Tue, Nov 23, 2010 at 15:10, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
You misunderstand. VecNorm() would still be calling the update cache business,. the only difference is it would get the cached values before the (*v->scale)(...) call and set them back into the Vec after the (*v->scale)(...)</blockquote>
</div><br><div>VecNorm just reads the cache, you must mean that VecScale pulls out the cached values as</div><div><br></div><div><div>    /*</div><div>     * Update cached data</div><div>     */</div><div>    for (i=0; i<4; i++) {</div>
<div>      ierr = PetscObjectComposedDataGetReal((PetscObject)x,NormIds[i],norms[i],flgs[i]);CHKERRQ(ierr);</div><div>    }</div><div><br></div><div>    ierr = (*x->ops->scale)(x,alpha);CHKERRQ(ierr); /* state is increased here */</div>
<div><br></div><div>    for (i=0; i<4; i++) {</div><div>      if (flgs[i]) {</div><div>        ierr = PetscObjectComposedDataSetReal((PetscObject)x,NormIds[i],PetscAbsScalar(alpha)*norms[i]);CHKERRQ(ierr);</div><div>      }</div>
<div>    }</div></div><div><br></div>