<div dir="ltr">We already merged the fix.<div><br></div><div> Thanks,</div><div><br></div><div> Matt</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 11, 2023 at 6:00 AM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div> I don't fully understand your code and what it is trying to demonstrate, but VecGetArrayWrite is Logically Collective. Having <div><br></div><div><div> if(rank == 0)</div><div> {</div><div> PetscCall(VecGetArrayWrite(vec, &xx));</div><div> PetscCall(VecRestoreArrayWrite(vec, &xx));</div><div> }</div><div><br></div><div>is not allowed. The reason is that VecRestoreArrayWrite() changes the PetscObjectState of the vector, and this state must be changed consistently across all MPI processes that share the vector. </div><div><br></div><div><br></div><div><br><blockquote type="cite"><div>On Dec 10, 2023, at 2:40 AM, Stephan Köhler <<a href="mailto:stephan.koehler@math.tu-freiberg.de" target="_blank">stephan.koehler@math.tu-freiberg.de</a>> wrote:</div><br><div>
<div>
Dear PETSc/Tao team,
<br>
<br>
there is a bug in the voector interface: In the function
<br>
VecNorm, see, eg.
<a href="https://petsc.org/release/src/vec/vec/interface/rvector.c.html#VecNorm" target="_blank">https://petsc.org/release/src/vec/vec/interface/rvector.c.html#VecNorm</a>
line 197 the check for consistency in line 214 is done on the wrong
communicator. The
communicator should be PETSC_COMM_SELF.<br>
<span>Otherwise the
program may hang when PetscCheck is executed.<br>
<br>
Please find a minimal example attached.<br>
</span><br>
<br>
Kind regards,
<br>
Stephan Köhler
<pre cols="72">--
Stephan Köhler
TU Bergakademie Freiberg
Institut für numerische Mathematik und Optimierung
Akademiestraße 6
09599 Freiberg
Gebäudeteil Mittelbau, Zimmer 2.07
Telefon: +49 (0)3731 39-3188 (Büro)</pre>
</div>
<span id="m_-3096820572730055337cid:4C263B6C-2FD3-431F-9AF3-2B6A53743543"><minimal_ex_vec_norm.cpp></span><span id="m_-3096820572730055337cid:544E075A-D2D1-461E-B245-E2D57B37CD3F"><OpenPGP_0xC9BF2C20DFE9F713.asc></span></div></blockquote></div><br></div></div></blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><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>