PointSource in parallel

Issue #537 open
Ben Crestel created an issue

PointSource returns the wrong values when ran in parallel (with mpirun wrapper).

The attached file plots the maximum entry of a discretized delta source term. This maximum entry increases with the number of processes. This example can be run with up to 4 processes (after that some processes get no mesh and the on-screen printing fails).

Comments (9)

  1. Marco Morandini

    I think that PointSource is a crude hack (although I'm currently heavily relying on it), and should be replaced by a working dirac. The bug comes from the fact that if the point in on the boundary between different processes the source term is added by all of them. It's not clear to me if point integral can be used instead of PointSource. Nor how point integrals are defined for discontinuous functions (PointSource chooses the first available element, so its behavior is not well defined in this case). Should be possible to use point integrals instead of PointSource, I would suggest to remove PointSource without looking back.

  2. Marco Morandini

    I still see the bug, i.e. (updated testcase attached)

    mpirun -np 4 python3 PointSourceinparallel.py 
    Process 0: Computed global bounding box tree with 7 boxes.
    Process 1: Computed global bounding box tree with 7 boxes.
    Process 2: Computed global bounding box tree with 7 boxes.
    Process 3: Computed global bounding box tree with 7 boxes.
    p0: max(|b|)=5.551115123125783e-17
    p1: max(|b|)=4.0
    p2: max(|b|)=2.7755575615628914e-17
    p3: max(|b|)=2.7755575615628914e-17
    
    marco@pao:~> mpirun -np 2 python3 PointSourceinparallel.py 
    Process 0: Computed global bounding box tree with 3 boxes.
    Process 1: Computed global bounding box tree with 3 boxes.
    p0: max(|b|)=5.551115123125783e-17
    p1: max(|b|)=2.0
    
    marco@pao:~> mpirun -np 1 python3 PointSourceinparallel.py 
    p0: max(|b|)=1.0
    
  3. Log in to comment