Pierre Jolivet <pie...@joliv.et> writes: >> On 10 Dec 2023, at 8:40 AM, Stephan Köhler >> <stephan.koeh...@math.tu-freiberg.de> wrote: >> >> Dear PETSc/Tao team, >> >> there is a bug in the voector interface: In the function >> VecNorm, see, eg. >> https://petsc.org/release/src/vec/vec/interface/rvector.c.html#VecNorm line >> 197 the check for consistency in line 214 is done on the wrong communicator. >> The communicator should be PETSC_COMM_SELF. >> Otherwise the program may hang when PetscCheck is executed. > > I think the communicator should not be changed, but instead, the > check/conditional should be changed, à la PetscValidLogicalCollectiveBool().
I agree -- it's no extra cost to discover collectively whether all, none, or some have the norm. In this case, it could be a MPI_SUM, in which case the error message could report how many processes took each path.