Skip to content

Devansh1106/PoissonSolver.jl

Repository files navigation

PoissonSolver.jl

Poisson Solver for different types of boundary conditions for 2D cartesian domain. Parallelization is added through MUMPS.jl package.

Important Information

  • domain::Vector{Float64}: domain[nx, ny, xmin, xmax, ymin, ymax]

  • bc::Vector{Float64}: bc[bottom('N'/'D'), right('N'/'D'), top('N'/'D'), left('N'/'D')]; start from bottom and move counter-clockwise
    For example: DNDN means:

    Side BC type
    Bottom Dirichlet (D)
    Right Neumann (N)
    Top Dirichlet (D)
    Left Neumann (N)
  • Corner values: If the Dirichlet value is available for any of the sides that constitute the corner then that value will taken as corner boundary value. Any other case means that only Neumann boundary condition is available on both the sides constituting the corner.

  • @inbounds: If program crashed with a memory/indexing error or without any meaningful error message, there is a high possibility that @inbounds caused the issue (since it removes bound checking from for loops during compilation.)

TEST SUITE FILES

  • test_suite_poisson_periodic.pdf: Contains test cases for the code when there is periodic boundary condition (along with Neumann/Dirichlet)
  • test_suite_poisson.pdf: Contains test cases for the code when there is no periodic boudnary condition (only Neumann/Dirichlet/mixed of them).

Comparison

  • The comparison has been performed for the all_D case when all the boundary conditions are Dirichlet.
  • blk_thomas.jl is a serial code and the other code which is using MUMPS used $4$ cores for this comparison test.
  • In a sense, this is not a true comparison because one is serial code and other is parallel code. But it shows that blk_thomas.jl has memory issue, it consumes a lot of memory $(N = 512 \text{ case} \sim 2.2 \text{ GB})$ since we need to store the in-between dense matrices for performing back substitution later.
  • If size of matrices of small $N < 128$, blk_thomas.jl is preferred.

$$\text{Speedup Factor} = \frac{\text{Time}_{\text{MUMPS}}}{\text{Time}_{\text{Block Thomas}}}$$

Grid Size ($N \times N$) Block Thomas (sec) MUMPS (sec) Speedup Factor
8 0.00011 0.1868 1674x
16 0.00017 0.1961 1162x
32 0.00076 0.2043 267x
64 0.0071 0.6097 86x
128 0.0843 1.0962 13x
256 0.5276 2.5214 4.8x
512 4.3267 5.6815 1.3x

Trobleshooting cheat sheet

Symptom Diagnosis Solution
PCRE compilation error Julia loaded gnu8's old libpcre. Check LD_LIBRARY_PATH. Ensure Julia's lib folder is first.
MPI.Init() warning / Infinipath error System cannot find Infiniband driver. Add /usr/lib64/psm2-compat to LD_LIBRARY_PATH.
Error: 1e7 or NaN ParMETIS created a bad ordering. Set icntl[28] = 1 (Sequential) OR set cntl[1] = 0.1 (increase pivot threshold).
Analysis takes >10s Running sequentially on large grid. Set icntl[28] = 2 to enable Parallel Analysis.

Contact

Email: devansh22@iisertvm.ac.in

About

Solver for Poisson-type linear and non-linear equations with different types of boundary conditions (Dirichlet/Neumann/Periodic/Mixed) for 2D cartesian domain. Parallelization is added through MUMPS.jl package.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors