<div dir="ltr"><div dir="ltr">On Tue, Mar 17, 2020 at 1:34 PM Mark Adams <<a href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Our code broke in moving from v3.7 to current. The problem seems to be in MatCreateVecs<div><br></div><div>Our code has:</div><div><br></div><div> Vec::XVec<br> Vec::BVec<br></div><div><br></div><div> this%xVec2 = PETSC_NULL_VEC<br> this%bVec2 = PETSC_NULL_VEC</div></div></blockquote><div><br></div><div>Passing NULL to MatCreateVecs() means that you do not want a vector out:</div><div><br></div><div> <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateVecs.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateVecs.html</a></div><div><br></div><div>I am guessing that this was broken in 3.7 so that it ignored NULL input, but we fixed that.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>call MatCreateVecs(solver%KKTmat,solver%xVec2,solver%bVec2,ierr)<br></div><div><br></div><div>Petsc code:</div><div>PETSC_EXTERN void PETSC_STDCALL matcreatevecs_(Mat *mat,Vec *right,Vec *left, int *ierr)<br>{<br>PetscPrintf(PETSC_COMM_SELF,"ZZZ 1) matcreatevecs_ start right=%p left=%p\n",right,left);<br> CHKFORTRANNULLOBJECT(right);<br> CHKFORTRANNULLOBJECT(left);<br>PetscPrintf(PETSC_COMM_SELF,"ZZZ 2) matcreatevecs_ start right=%p left=%p\n",right,left);<br> *ierr = MatCreateVecs(*mat,right,left);<br>}<br></div><div><br></div><div>produces this:<br></div><div><br></div><div>ZZZ 1) matcreatevecs_ start right=0x7fffffff3758 left=0x7fffffff3760<br>ZZZ 2) matcreatevecs_ start right=(nil) left=(nil)<br></div><div><br></div><div>Shouldn't this be?</div><div><br></div><div>PETSC_EXTERN void PETSC_STDCALL matcreatevecs_(Mat *mat,Vec *right,Vec *left, int *ierr)<br>{<br> *ierr = MatCreateVecs(*mat,right,left);<br>}<br></div><div><br></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>