[petsc-users] Bug report VecNorm

Jed Brown jed at jedbrown.org
Sun Dec 10 19:57:21 CST 2023


Pierre Jolivet <pierre at joliv.et> writes:

>> On 10 Dec 2023, at 8:40 AM, Stephan Köhler <stephan.koehler at 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.


More information about the petsc-users mailing list