Poisson Solver for different types of boundary conditions for 2D cartesian domain. Parallelization is added through MUMPS.jl package.
-
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:DNDNmeans: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@inboundscaused the issue (since it removes bound checking fromforloops during compilation.)
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).
- The comparison has been performed for the
all_Dcase when all the boundary conditions are Dirichlet. -
blk_thomas.jlis a serial code and the other code which is usingMUMPSused$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.jlhas 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.jlis preferred.
| Grid Size ( |
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 |
| 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. |
Email: devansh22@iisertvm.ac.in