[dune-pdelab] Bug in l2norm for parallel execution

Gregor Corbin corbin at mathematik.uni-kl.de
Thu Aug 2 13:41:54 CEST 2018


Hello Carsten,

thanks for pointing this out to me. I should have figured that out myself...


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.
>>
>>
>>
>> _______________________________________________
>> dune-pdelab mailing list
>> dune-pdelab at lists.dune-project.org
>> https://lists.dune-project.org/mailman/listinfo/dune-pdelab
>>
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.dune-project.org/pipermail/dune-pdelab/attachments/20180802/8889ccd6/attachment.sig>


More information about the dune-pdelab mailing list