<div dir="ltr">Hi,<div><br></div><div> I have a matnest defined by ISGeneral (will be ISStride in future, but not now).</div><div>When calling MatMultTranspose, it calls Vec[Get|Restore]SubVector.<br></div><div>In this call, the state of the vector is saved PetscObjectComposedDataSetInt </div>
<div>and then PetscObjectComposedDataGetInt.</div><div>As I understand this last macro, it doesn't gives back the saved data if ... the state has changed.</div><div>So the line</div><div> if (valid && savedstate < newstate) {<br>
</div><div>is never satisfied because valid means "the state didn't changed".</div><div>Maybe</div><div> if (valid) {<br></div><div>would to the right thing (but it gives compiler warning that savedstate is unused)</div>
<div>or</div><div> if(((PetscObject)*Y)->intcomposedstate[id] == ((PetscObject)*Y)->state))</div><div>but I feel like using private attributes.</div><div>How could it be done properly?<br></div><div><br></div><div>
Maybe the gcontinuous value could be saved instead of the state, so that it won't need to be communicated twice each time? (Or it can be an attribute of the IS so that it need to be communicated only once at all).</div>
<div><br></div><div>Also, instead of an assertion I tried to implement it for non-continuous IS (in the file attached), is it good?<br></div><div><br></div><div><div>+ if (!gcontiguous) {</div><div>+ VecScatter scatter; </div>
<div>+ ierr = VecScatterCreate(*Y,NULL,X,is,&scatter);CHKERRQ(ierr);</div><div>+ ierr = VecScatterBegin(scatter,*Y,X,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr);</div><div>+ ierr = VecScatterEnd(scatter,*Y,X,INSERT_VALUES,SCATTER_FORWARD);CHKERRQ(ierr);</div>
<div>+ ierr = VecScatterDestroy(&scatter);CHKERRQ(ierr);</div><div>+ } </div></div><div><br></div><div>thanks,</div><div><br></div><div>Patrick Lacasse</div><div><br></div><div><br></div></div>