I did indeed bypass them. Ok, thanks.<br><br><br><div class="gmail_quote">On Fri, Jun 15, 2012 at 11:06 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Sat, Jun 16, 2012 at 12:03 AM, Daniel Lowell <span dir="ltr"><<a href="mailto:redratio1@gmail.com" target="_blank">redratio1@gmail.com</a>></span> wrote:<br>
</div></div><div class="gmail_quote"><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey Satish,<br><br>So I'm having an issue with this function: <br><br><pre width="80"><a name="137f0e5638772878_137f0e25fab4bd47_137f0dc3f84a4269_137f0d945cee9910_line559"></a><b><font color="#228B22">#define <a href="http://www.mcs.anl.gov/petsc/petsc-current/include/petsc-private/docs/manualpages/Sys/PetscObjectComposedDataGetReal.html#PetscObjectComposedDataGetReal" target="_blank">PetscObjectComposedDataGetReal</a>(obj,id,data,flag) \</font></b>
<a name="137f0e5638772878_137f0e25fab4bd47_137f0dc3f84a4269_137f0d945cee9910_line560"></a><b><font color="#228B22">((((obj)->realcomposedstate && ((obj)->realcomposedstate[id] == (obj)->state))? \</font></b>
<a name="137f0e5638772878_137f0e25fab4bd47_137f0dc3f84a4269_137f0d945cee9910_line561"></a><b><font color="#228B22">(data = (obj)->realcomposeddata[id],flag = <a href="http://www.mcs.anl.gov/petsc/petsc-current/include/petsc-private/docs/manualpages/Sys/PETSC_TRUE.html#PETSC_TRUE" target="_blank">PETSC_TRUE</a>) : (flag = <a href="http://www.mcs.anl.gov/petsc/petsc-current/include/petsc-private/docs/manualpages/Sys/PETSC_FALSE.html#PETSC_FALSE" target="_blank">PETSC_FALSE</a>)),0)</font></b></pre>
<br>Called from VecNorm which is called from SNESLineSearchApply_BT<br><br>I
have two examples running one is the vanilla ex14 using my GPU vector
and matrix type. The other example is a variant of ex14test where I am
implementing GPU formfunction and formjacobian.<br>
ex14 vanilla runs through correctly, however ex14test diverges in the logic within VecNorm, specifically line 164:<br> /*<br> * Cached data?<br> */<br> if (type!=NORM_1_AND_2) {<br> ierr = PetscObjectComposedDataGetReal<div>
((PetscObject)x,NormIds[type],*val,flg);CHKERRQ(ierr);<br>
if (flg) PetscFunctionReturn(0);<br> }<br><br>The ex14 detects there is a "real" part, however the ex14test does not and VecNorm returns. <br><br>"val" in VecNorm is PetscReal gnorm = fnorm defined in SNESLineSearchApply_BT. <br>
For ex14: val[0]=3.44e-317, val[1]: 0.580<br>For ex14test: val[0]=3.44e-317, val[1]: 0.029<br><br><br>This difference makes SNESLineSearchApply_BT branch into different execution paths.<br><br>I'm not sure where the issue could have come from. Any ideas?</div>
</blockquote><div><br></div></div></div><div>If you change values in a Vec, you must increment the internal state, since we cache norms.</div><div>The internal functions for array getting do this automatically, so I am not sure why this is</div>
<div>messing up. Did you bypass them?</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><font color="#888888"><br>
<span class="HOEnZb"><font color="#888888">
-- <br>Daniel Lowell<br><br>
</font></span></font></span></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Daniel Lowell<br><br>