cuda_tdsops_t Derived Type

type, public, extends(tdsops_t) :: cuda_tdsops_t

CUDA extension of the Tridiagonal Solver Operators class.

Regular tdsops_t class is initiated and the coefficient arrays are copied into device arrays so that cuda kernels can use them.


Inherits

type~~cuda_tdsops_t~~InheritsGraph type~cuda_tdsops_t cuda_tdsops_t type~tdsops_t tdsops_t type~cuda_tdsops_t->type~tdsops_t

Components

Type Visibility Attributes Name Initial
real(kind=dp), public, allocatable, dimension(:) :: dist_fw

fw/bw phase back subs. the auxiliary factors

real(kind=dp), public, allocatable, dimension(:) :: dist_bw

fw/bw phase back subs. the auxiliary factors

real(kind=dp), public, allocatable, dimension(:) :: dist_sa

fw/bw phase back subs. the auxiliary factors

real(kind=dp), public, allocatable, dimension(:) :: dist_sc

fw/bw phase back subs. the auxiliary factors

real(kind=dp), public, allocatable, dimension(:) :: dist_af

fw/bw phase back subs. the auxiliary factors

real(kind=dp), public, allocatable, dimension(:) :: thom_f
real(kind=dp), public, allocatable, dimension(:) :: thom_s
real(kind=dp), public, allocatable, dimension(:) :: thom_w
real(kind=dp), public, allocatable, dimension(:) :: thom_p
real(kind=dp), public, allocatable :: stretch(:)
real(kind=dp), public, allocatable :: stretch_correct(:)
real(kind=dp), public, allocatable :: coeffs(:)
real(kind=dp), public, allocatable :: coeffs_s(:,:)
real(kind=dp), public, allocatable :: coeffs_e(:,:)
real(kind=dp), public :: alpha

Compact scheme coeffs

real(kind=dp), public :: a

Compact scheme coeffs

real(kind=dp), public :: b

Compact scheme coeffs

real(kind=dp), public :: c = 0._dp

Compact scheme coeffs

real(kind=dp), public :: d = 0._dp

Compact scheme coeffs

real(kind=dp), public :: beta = 0._dp

LHS 2nd off-diagonal (pentadiag LHS only)

real(kind=dp), public :: beta_lhs_s = 0._dp

j=1 backward-sub beta (0/2β Neumann, β otherwise)

logical, public :: periodic
logical, public :: pentadiag = .false.

.true. for pentadiagonal LHS schemes Solve with the serial Thomas algorithm instead of the distributed one. The distributed solver truncates a neighbour's influence at the subdomain edge, which is invisible for the well-conditioned derivative operators but not for the low-pass filter, whose system is only marginally diagonally dominant as alpha approaches 0.5. Thomas is serial along the line, so this is only valid when the direction is not decomposed.

logical, public :: prefer_thomas = .false.
integer, public :: n_tds

Tridiagonal system size

integer, public :: n_rhs

Right-hand-side builder size

integer, public :: move = 0

move between vertices and cell centres

integer, public :: n_halo

number of halo points

real(kind=dp), public, device, allocatable :: dist_fw_dev(:)
real(kind=dp), public, device, allocatable :: dist_bw_dev(:)
real(kind=dp), public, device, allocatable :: dist_sa_dev(:)
real(kind=dp), public, device, allocatable :: dist_sc_dev(:)
real(kind=dp), public, device, allocatable :: dist_af_dev(:)
real(kind=dp), public, device, allocatable :: thom_f_dev(:)
real(kind=dp), public, device, allocatable :: thom_s_dev(:)
real(kind=dp), public, device, allocatable :: thom_w_dev(:)
real(kind=dp), public, device, allocatable :: thom_p_dev(:)
real(kind=dp), public, device, allocatable :: stretch_dev(:)
real(kind=dp), public, device, allocatable :: stretch_correct_dev(:)
real(kind=dp), public, device, allocatable :: coeffs_dev(:)
real(kind=dp), public, device, allocatable :: coeffs_s_dev(:,:)
real(kind=dp), public, device, allocatable :: coeffs_e_dev(:,:)

Constructor

public interface cuda_tdsops_t

  • public function cuda_tdsops_init(n_tds, delta, operation, scheme, bc_start, bc_end, stretch, stretch_correct, n_halo, from_to, sym, c_nu, nu0_nu, filter_alpha) result(tdsops)

    Constructor function for the cuda_tdsops_t class. See tdsops_t for details.

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: n_tds
    real(kind=dp), intent(in) :: delta
    character(len=*), intent(in) :: operation
    character(len=*), intent(in) :: scheme
    integer, intent(in) :: bc_start
    integer, intent(in) :: bc_end
    real(kind=dp), intent(in), optional :: stretch(:)
    real(kind=dp), intent(in), optional :: stretch_correct(:)
    integer, intent(in), optional :: n_halo
    character(len=*), intent(in), optional :: from_to
    logical, intent(in), optional :: sym
    real(kind=dp), intent(in), optional :: c_nu
    real(kind=dp), intent(in), optional :: nu0_nu
    real(kind=dp), intent(in), optional :: filter_alpha

    Return Value type(cuda_tdsops_t)

    return value of the function


Type-Bound Procedures

procedure, public :: lowpass

  • public subroutine lowpass(self, af, bc_start, bc_end, sym)

    Tridiagonal low-pass filter, matching Incompact3d's filter.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(tdsops_t), intent(inout) :: self
    real(kind=dp), intent(in) :: af

    filter parameter, -0.5 < af < 0.5

    integer, intent(in) :: bc_start
    integer, intent(in) :: bc_end
    logical, intent(in), optional :: sym

procedure, public :: stagder_1st

  • public subroutine stagder_1st(self, delta, scheme, from_to, bc_start, bc_end, sym)

    Arguments

    Type IntentOptional Attributes Name
    class(tdsops_t), intent(inout) :: self
    real(kind=dp), intent(in) :: delta
    character(len=*), intent(in) :: scheme
    character(len=*), intent(in) :: from_to
    integer, intent(in) :: bc_start
    integer, intent(in) :: bc_end
    logical, intent(in), optional :: sym

procedure, public :: interpl_mid

  • public subroutine interpl_mid(self, scheme, from_to, bc_start, bc_end, sym)

    Arguments

    Type IntentOptional Attributes Name
    class(tdsops_t), intent(inout) :: self
    character(len=*), intent(in) :: scheme
    character(len=*), intent(in) :: from_to
    integer, intent(in) :: bc_start
    integer, intent(in) :: bc_end
    logical, intent(in), optional :: sym

procedure, public :: deriv_2nd

  • public subroutine deriv_2nd(self, delta, scheme, bc_start, bc_end, sym, c_nu, nu0_nu)

    Arguments

    Type IntentOptional Attributes Name
    class(tdsops_t), intent(inout) :: self
    real(kind=dp), intent(in) :: delta
    character(len=*), intent(in) :: scheme
    integer, intent(in) :: bc_start
    integer, intent(in) :: bc_end
    logical, intent(in), optional :: sym
    real(kind=dp), intent(in), optional :: c_nu
    real(kind=dp), intent(in), optional :: nu0_nu

procedure, public :: deriv_1st

  • public subroutine deriv_1st(self, delta, scheme, bc_start, bc_end, sym)

    Arguments

    Type IntentOptional Attributes Name
    class(tdsops_t), intent(inout) :: self
    real(kind=dp), intent(in) :: delta
    character(len=*), intent(in) :: scheme
    integer, intent(in) :: bc_start
    integer, intent(in) :: bc_end
    logical, intent(in), optional :: sym

procedure, public :: preprocess_thom

  • public subroutine preprocess_thom(self, b)

    Arguments

    Type IntentOptional Attributes Name
    class(tdsops_t), intent(inout) :: self
    real(kind=dp), intent(in), dimension(:) :: b

procedure, public :: preprocess_penta_dist

  • public subroutine preprocess_penta_dist(self, bc_start, bc_end, symmetry)

    LU preprocessing for non-periodic pentadiagonal Thomas algorithm.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(tdsops_t), intent(inout) :: self
    integer, intent(in) :: bc_start
    integer, intent(in) :: bc_end
    logical, intent(in) :: symmetry

procedure, public :: preprocess_dist

  • public subroutine preprocess_dist(self, dist_b)

    Arguments

    Type IntentOptional Attributes Name
    class(tdsops_t), intent(inout) :: self
    real(kind=dp), intent(in), dimension(:) :: dist_b