m_dist_reduced Module

Exact solve of the reduced system of the distributed tridiagonal solver.

The first phase of the distributed solve (der_univ_dist) reduces each rank's block of a line so that its interior depends only on the block's own first and last unknowns, x_s and x_e. What couples the ranks is then a reduced system in the x_s and x_e of every rank along the line, in the order x_s(0), x_e(0), x_s(1), x_e(1), ...:

sa_1(p)x_e(p-1) + x_s(p) + sc_1(p)x_e(p) = d_s(p) sa_n(p)x_s(p) + x_e(p) + sc_n(p)x_s(p+1) = d_e(p)

where sa_1, sc_1, sa_n and sc_n are rank p's dist_sa(1), dist_sc(1), dist_sa(n) and dist_sc(n), and d_s and d_e its first and last values after the first phase. The system is cyclic: its corners couple the last rank to the first. On a non-periodic line they vanish, because the boundary rows have no outside neighbour.

The default second phase (der_univ_subs) solves this system only approximately: it drops sc_1 and sa_n and pairs each block boundary with its neighbour alone. The dropped entries decay geometrically with the points per rank, at a rate set by how diagonally dominant the system is. That is invisible for the derivative operators, but not for the low-pass filter near its sharp limit filter_alpha -> 0.5, whose gain it then gets wrong by about sa_n even at zero wavenumber, every time it is applied.

Here every rank gathers the reduced rows of its lines and solves the 2*nproc system exactly, keeping its own x_s and x_e. The system is small, so solving it on every rank costs less than more rounds of messages.


Uses

  • module~~m_dist_reduced~~UsesGraph module~m_dist_reduced m_dist_reduced m_mpi m_mpi module~m_dist_reduced->m_mpi module~m_common m_common module~m_dist_reduced->module~m_common module~m_logger m_logger module~m_dist_reduced->module~m_logger module~m_mesh_content m_mesh_content module~m_dist_reduced->module~m_mesh_content module~m_common->m_mpi module~m_common->module~m_logger module~m_logger->m_mpi iso_fortran_env iso_fortran_env module~m_logger->iso_fortran_env module~m_mesh_content->module~m_common module~m_mesh_content->module~m_logger

Used by

  • module~~m_dist_reduced~~UsedByGraph module~m_dist_reduced m_dist_reduced module~m_cuda_exec_dist m_cuda_exec_dist module~m_cuda_exec_dist->module~m_dist_reduced module~m_omp_exec_dist m_omp_exec_dist module~m_omp_exec_dist->module~m_dist_reduced module~m_omptgt_exec_dist m_omptgt_exec_dist module~m_omptgt_exec_dist->module~m_dist_reduced module~m_cuda_backend m_cuda_backend module~m_cuda_backend->module~m_cuda_exec_dist module~m_omp_backend m_omp_backend module~m_omp_backend->module~m_omp_exec_dist module~m_omptgt_backend m_omptgt_backend module~m_omptgt_backend->module~m_omptgt_exec_dist module~m_backend_setup m_backend_setup module~m_backend_setup->module~m_cuda_backend module~m_backend_setup->module~m_omp_backend module~m_backend_setup->module~m_omptgt_backend module~m_memcheck_build m_memcheck_build module~m_memcheck_build->module~m_backend_setup program~x3d2_poisson_solver x3d2_poisson_solver program~x3d2_poisson_solver->module~m_backend_setup program~xcompact xcompact program~xcompact->module~m_backend_setup program~x3d2_memcheck x3d2_memcheck program~x3d2_memcheck->module~m_memcheck_build

Subroutines

public subroutine solve_reduced_exact(x_s, x_e, d_s, d_e, sa_1, sc_1, sa_n, sc_n, par, dir)

Solve the reduced system of every line exactly. Line l of d_s and d_e must be the same physical line on every rank along dir, as it is for the neighbour exchange of the default second phase.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out) :: x_s(:)
real(kind=dp), intent(out) :: x_e(:)
real(kind=dp), intent(in) :: d_s(:)
real(kind=dp), intent(in) :: d_e(:)
real(kind=dp), intent(in) :: sa_1

This rank's dist_sa(1), dist_sc(1), dist_sa(n) and dist_sc(n)

real(kind=dp), intent(in) :: sc_1

This rank's dist_sa(1), dist_sc(1), dist_sa(n) and dist_sc(n)

real(kind=dp), intent(in) :: sa_n

This rank's dist_sa(1), dist_sc(1), dist_sa(n) and dist_sc(n)

real(kind=dp), intent(in) :: sc_n

This rank's dist_sa(1), dist_sc(1), dist_sa(n) and dist_sc(n)

type(par_t), intent(in) :: par
integer, intent(in) :: dir