[dune-pdelab] Bug in l2norm for parallel execution
Carsten Gräser
graeser at mi.fu-berlin.de
Thu Aug 2 13:43:31 CEST 2018
Sorry, I forgot to pass this to the list, too.
Am 02.08.2018 um 13:35 schrieb Carsten Gräser:
> Hallo Gregor,
>
> Am 02.08.2018 um 11:37 schrieb Gregor Corbin:
>> Dear all,
>>
>> while implementing a convergence test, I may have found an error in the
>> computation of the L2-norm for grid functions:
>>
>> Using the l2norm function from <dune/pdelab/test/l2norm.hh>, I compute
>> the L2 norm of a constant 1 function on a [0,1]x[0,1] grid.
>>
>> In serial mode, everything works fine and I get 1 as a result. In
>> parallel execution (mpirun ) with N threads, the L2 norm on each process
>> is 1/sqrt(N) and so the total L2 norm is computed as sqrt(N)! Any Idea
>> where this goes wrong?
> without knowing the pdelab implementation it looks like
> everything is computed correctly in your example. Assuming
> that the domain is split equally on the N processes, the
> value computed in your example should indeed be sqrt(N):
>
> The local domains area is 1/N and the square root in the
> local norm gives 1/sqrt(N). Now summing up results in sqrt(N).
> In contrast, the correct global L^2-norm is the square root
> of the sum of the _squared_ local L^2-norms.
>
> Best,
> Carsten
>
>
>>
>>
>> I compiled with g++-7.3 with -std=c++17. All dune modules are from the
>> releases/2.6 branch.
>>
>> Cheers and thanks in advance,
>> Gregor
>>
>> Ps.: A minimal test code that reproduces this behaviour is attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20180802/68b14500/attachment.sig>
More information about the dune-pdelab
mailing list