m_cuda_spectral Module


Uses

  • module~~m_cuda_spectral~~UsesGraph module~m_cuda_spectral m_cuda_spectral cudafor cudafor module~m_cuda_spectral->cudafor module~m_common m_common module~m_cuda_spectral->module~m_common m_mpi m_mpi module~m_common->m_mpi module~m_logger m_logger module~m_common->module~m_logger module~m_logger->m_mpi iso_fortran_env iso_fortran_env module~m_logger->iso_fortran_env

Used by

  • module~~m_cuda_spectral~~UsedByGraph module~m_cuda_spectral m_cuda_spectral module~m_cuda_poisson_fft m_cuda_poisson_fft module~m_cuda_poisson_fft->module~m_cuda_spectral module~m_cuda_backend m_cuda_backend module~m_cuda_backend->module~m_cuda_poisson_fft module~m_cuda_memcheck_device m_cuda_memcheck_device module~m_cuda_memcheck_device->module~m_cuda_poisson_fft module~m_memcheck_estimate m_memcheck_estimate module~m_memcheck_estimate->module~m_cuda_poisson_fft module~m_memcheck_context m_memcheck_context module~m_memcheck_estimate->module~m_memcheck_context module~m_backend_setup m_backend_setup module~m_backend_setup->module~m_cuda_backend module~m_memcheck_build m_memcheck_build module~m_memcheck_build->module~m_memcheck_estimate module~m_memcheck_build->module~m_backend_setup module~m_memcheck_build->module~m_memcheck_context module~m_memcheck_report m_memcheck_report module~m_memcheck_build->module~m_memcheck_report module~m_memcheck_context->module~m_cuda_memcheck_device module~m_memcheck_report->module~m_cuda_memcheck_device module~m_memcheck_report->module~m_memcheck_estimate module~m_memcheck_report->module~m_memcheck_context program~x3d2_memcheck x3d2_memcheck program~x3d2_memcheck->module~m_memcheck_estimate program~x3d2_memcheck->module~m_memcheck_build program~x3d2_memcheck->module~m_memcheck_context program~x3d2_memcheck->module~m_memcheck_report program~x3d2_poisson_solver x3d2_poisson_solver program~x3d2_poisson_solver->module~m_backend_setup program~xcompact xcompact program~xcompact->module~m_backend_setup

Variables

Type Visibility Attributes Name Initial
real(kind=dp), public, parameter :: eps_wave = epsilon(1._dp)

Functions

public function pair_fw(own, partner, i2, a2, b2) result(res)

Forward paired split of one dim2 mode against its mirror. The rule is symmetric, so the partner entry is pair_fw(partner, own, i2_rev).

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: own
complex(kind=dp), intent(in) :: partner
integer, intent(in) :: i2
real(kind=dp), intent(in) :: a2(*)
real(kind=dp), intent(in) :: b2(*)

Return Value complex(kind=dp)

public function pair_bw(own, partner, i2, a2, b2) result(res)

Backward counterpart of pair_fw, symmetric in the same way.

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(in) :: own
complex(kind=dp), intent(in) :: partner
integer, intent(in) :: i2
real(kind=dp), intent(in) :: a2(*)
real(kind=dp), intent(in) :: b2(*)

Return Value complex(kind=dp)

public function fold_index(i, n) result(src)

Source index of entry i of a non-periodic line of n points gathered into a periodic one: the odd entries ascending, then the even entries descending, so that a plain FFT can stand in for the cosine transform. For an odd n the last entry lands at the centre, n/2 + 1. The single definition of the fold for the periodicity kernels: the enforce kernels gather through it and the undo kernels scatter through it, which keeps their reads contiguous. The OpenMP backend has the same function.

Arguments

Type IntentOptional Attributes Name
integer, intent(in), value :: i
integer, intent(in), value :: n

Return Value real


Subroutines

public subroutine postprocess_dim13_fw(div_r, div_c, i1, i3, n1, n3, a1, b1, a3, b3)

Forward postprocess of one spectral entry in dim3 then dim1.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: div_r
real(kind=dp), intent(inout) :: div_c
integer, intent(in) :: i1
integer, intent(in) :: i3
integer, intent(in) :: n1
integer, intent(in) :: n3
real(kind=dp), intent(in) :: a1(*)
real(kind=dp), intent(in) :: b1(*)
real(kind=dp), intent(in) :: a3(*)
real(kind=dp), intent(in) :: b3(*)

public subroutine postprocess_dim13_bw(div_r, div_c, i1, i3, n1, n3, a1, b1, a3, b3)

Backward counterpart of postprocess_dim13_fw.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: div_r
real(kind=dp), intent(inout) :: div_c
integer, intent(in) :: i1
integer, intent(in) :: i3
integer, intent(in) :: n1
integer, intent(in) :: n3
real(kind=dp), intent(in) :: a1(*)
real(kind=dp), intent(in) :: b1(*)
real(kind=dp), intent(in) :: a3(*)
real(kind=dp), intent(in) :: b3(*)

public subroutine poisson_divide(div_r, div_c, wave)

Divide one entry by its spectral equivalence constant, with the eps_wave guard that keeps roundoff noise out of the pressure field.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: div_r
real(kind=dp), intent(inout) :: div_c
complex(kind=dp), intent(in) :: wave

public subroutine memcpy3D(dst, src, nx, ny, nz)

Copy data between x3d2 padded arrays and cuFFTMp descriptors

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: dst
real(kind=dp), intent(in), device, dimension(:, :, :) :: src
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine memcpy3D_with_transpose(dst, src, nx, ny, nz)

Copy with transpose: src(nx, ny, nz) -> dst(ny, nx, nz) Used for 100 case forward FFT

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: dst
real(kind=dp), intent(in), device, dimension(:, :, :) :: src
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine memcpy3D_with_transpose_back(dst, src, nx, ny, nz)

Copy with transpose back: src(ny, nx, nz) -> dst(nx, ny, nz) Used for 100 case backward FFT

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: dst
real(kind=dp), intent(in), device, dimension(:, :, :) :: src
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine transpose_xyz_to_zxy(dst, src, nx, ny, nz)

Used before R2C FFT for 110 case to put Z (periodic) in fast dim.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: dst
real(kind=dp), intent(in), device, dimension(:, :, :) :: src
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine transpose_zxy_to_xyz(dst, src, nx, ny, nz)

Transpose back: src(nz, nx, ny) -> dst(nx, ny, nz) Used after C2R FFT for 110 case.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: dst
real(kind=dp), intent(in), device, dimension(:, :, :) :: src
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz

public subroutine process_spectral_000(div_u, waves, nx_spec, ny_spec, y_sp_st, nx, ny, nz, ax, bx, ay, by, az, bz)

Post-processes the divergence of velocity in spectral space, including scaling w.r.t. grid size.

Read more…

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u

Divergence of velocity in spectral space

complex(kind=dp), intent(in), device, dimension(:, :, :) :: waves

Spectral equivalence constants

integer, intent(in), value :: nx_spec

Grid size in spectral space

integer, intent(in), value :: ny_spec

Grid size in spectral space

integer, intent(in), value :: y_sp_st

Offset in y direction in the permuted slabs in spectral space

integer, intent(in), value :: nx

Grid size

integer, intent(in), value :: ny

Grid size

integer, intent(in), value :: nz

Grid size

real(kind=dp), intent(in), device, dimension(:) :: ax
real(kind=dp), intent(in), device, dimension(:) :: bx
real(kind=dp), intent(in), device, dimension(:) :: ay
real(kind=dp), intent(in), device, dimension(:) :: by
real(kind=dp), intent(in), device, dimension(:) :: az
real(kind=dp), intent(in), device, dimension(:) :: bz

public subroutine process_spectral_010(div_u, waves, nx_spec, ny_spec, y_sp_st, nx, ny, nz, ax, bx, ay, by, az, bz)

Post-processes the divergence of velocity in spectral space, including scaling w.r.t. grid size.

Read more…

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u

Divergence of velocity in spectral space

complex(kind=dp), intent(in), device, dimension(:, :, :) :: waves

Spectral equivalence constants

integer, intent(in), value :: nx_spec

Grid size in spectral space

integer, intent(in), value :: ny_spec

Grid size in spectral space

integer, intent(in), value :: y_sp_st

Offset in y direction in the permuted slabs in spectral space

integer, intent(in), value :: nx

Grid size

integer, intent(in), value :: ny

Grid size

integer, intent(in), value :: nz

Grid size

real(kind=dp), intent(in), device, dimension(:) :: ax
real(kind=dp), intent(in), device, dimension(:) :: bx
real(kind=dp), intent(in), device, dimension(:) :: ay
real(kind=dp), intent(in), device, dimension(:) :: by
real(kind=dp), intent(in), device, dimension(:) :: az
real(kind=dp), intent(in), device, dimension(:) :: bz

public subroutine process_spectral_010_fw(div_u, nx_spec, ny_spec, y_sp_st, nx, ny, nz, ax, bx, ay, by, az, bz)

Post-processes the divergence of velocity in spectral space, including scaling w.r.t. grid size.

Read more…

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u

Divergence of velocity in spectral space

integer, intent(in), value :: nx_spec

Grid size in spectral space

integer, intent(in), value :: ny_spec

Grid size in spectral space

integer, intent(in), value :: y_sp_st

Offset in y direction in the permuted slabs in spectral space

integer, intent(in), value :: nx

Grid size

integer, intent(in), value :: ny

Grid size

integer, intent(in), value :: nz

Grid size

real(kind=dp), intent(in), device, dimension(:) :: ax

Spectral equivalence constants

real(kind=dp), intent(in), device, dimension(:) :: bx

Spectral equivalence constants

real(kind=dp), intent(in), device, dimension(:) :: ay

Spectral equivalence constants

real(kind=dp), intent(in), device, dimension(:) :: by

Spectral equivalence constants

real(kind=dp), intent(in), device, dimension(:) :: az

Spectral equivalence constants

real(kind=dp), intent(in), device, dimension(:) :: bz

Spectral equivalence constants

public subroutine process_spectral_010_poisson(div_u, a_re, a_im, off, inc, nx_spec, n, nx, ny, nz)

Solve the Poisson equation at cell centres with non-periodic BC along y

Read more…

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u

Divergence of velocity in spectral space

real(kind=dp), intent(inout), device, dimension(:, :, :, :) :: a_re

Spectral equivalence constants

real(kind=dp), intent(inout), device, dimension(:, :, :, :) :: a_im

Spectral equivalence constants

integer, intent(in), value :: off

offset and increment. increment is 2 when considering only odd or even

integer, intent(in), value :: inc

offset and increment. increment is 2 when considering only odd or even

integer, intent(in), value :: nx_spec

Grid size in spectral space

integer, intent(in), value :: n

Grid size in spectral space

integer, intent(in), value :: nx

Grid size in spectral space

integer, intent(in), value :: ny

Grid size in spectral space

integer, intent(in), value :: nz

Grid size in spectral space

public subroutine process_spectral_010_bw(div_u, nx_spec, ny_spec, y_sp_st, nx, ny, nz, ax, bx, ay, by, az, bz)

Post-processes the divergence of velocity in spectral space, including scaling w.r.t. grid size.

Read more…

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u

Divergence of velocity in spectral space

integer, intent(in), value :: nx_spec

Grid size in spectral space

integer, intent(in), value :: ny_spec

Grid size in spectral space

integer, intent(in), value :: y_sp_st

Offset in y direction in the permuted slabs in spectral space

integer, intent(in), value :: nx

Grid size

integer, intent(in), value :: ny

Grid size

integer, intent(in), value :: nz

Grid size

real(kind=dp), intent(in), device, dimension(:) :: ax

Spectral equivalence constants

real(kind=dp), intent(in), device, dimension(:) :: bx

Spectral equivalence constants

real(kind=dp), intent(in), device, dimension(:) :: ay

Spectral equivalence constants

real(kind=dp), intent(in), device, dimension(:) :: by

Spectral equivalence constants

real(kind=dp), intent(in), device, dimension(:) :: az

Spectral equivalence constants

real(kind=dp), intent(in), device, dimension(:) :: bz

Spectral equivalence constants

public subroutine process_spectral_fw(div_u, nx_spec, ny_spec, nx, ny, nz, ax, bx, az, bz)

Stage 1 (forward): normalisation followed by the dim3 and dim1 postprocess. Every mode is handled on its own here.

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u

Divergence of velocity in spectral space

integer, intent(in), value :: nx_spec

Grid size in spectral space

integer, intent(in), value :: ny_spec

Grid size in spectral space

integer, intent(in), value :: nx

Grid size

integer, intent(in), value :: ny

Grid size

integer, intent(in), value :: nz

Grid size

real(kind=dp), intent(in), device, dimension(:) :: ax
real(kind=dp), intent(in), device, dimension(:) :: bx
real(kind=dp), intent(in), device, dimension(:) :: az
real(kind=dp), intent(in), device, dimension(:) :: bz

public subroutine process_spectral_pair_fw(div_u, mirror, mirror_plane, waves, nx_spec, ny_spec, y_sp_st, nx, nz, ay, by)

Stage 2 (forward): the dim2 paired split, then the Poisson solve.

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u

Divergence of velocity in spectral space

complex(kind=dp), intent(in), device, dimension(:, :, :) :: mirror

dim2 mirror of the local slab, and the single plane below it

complex(kind=dp), intent(in), device, dimension(:, :) :: mirror_plane
complex(kind=dp), intent(in), device, dimension(:, :, :) :: waves

Spectral equivalence constants

integer, intent(in), value :: nx_spec

Grid size in spectral space

integer, intent(in), value :: ny_spec

Grid size in spectral space

integer, intent(in), value :: y_sp_st

Offset in the paired direction in the permuted slabs in spectral space

integer, intent(in), value :: nx

Grid size

integer, intent(in), value :: nz

Grid size

real(kind=dp), intent(in), device, dimension(:) :: ay
real(kind=dp), intent(in), device, dimension(:) :: by

public subroutine process_spectral_pair_bw(div_u, mirror, mirror_plane, nx_spec, ny_spec, y_sp_st, nx, nz, ax, bx, ay, by, az, bz)

Stage 3 (backward): the dim2 paired recombination, then the dim3 and dim1 postprocess.

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u

Divergence of velocity in spectral space

complex(kind=dp), intent(in), device, dimension(:, :, :) :: mirror

dim2 mirror of the local slab, and the single plane below it

complex(kind=dp), intent(in), device, dimension(:, :) :: mirror_plane
integer, intent(in), value :: nx_spec

Grid size in spectral space

integer, intent(in), value :: ny_spec

Grid size in spectral space

integer, intent(in), value :: y_sp_st

Offset in the paired direction in the permuted slabs in spectral space

integer, intent(in), value :: nx

Grid size

integer, intent(in), value :: nz

Grid size

real(kind=dp), intent(in), device, dimension(:) :: ax
real(kind=dp), intent(in), device, dimension(:) :: bx
real(kind=dp), intent(in), device, dimension(:) :: ay
real(kind=dp), intent(in), device, dimension(:) :: by
real(kind=dp), intent(in), device, dimension(:) :: az
real(kind=dp), intent(in), device, dimension(:) :: bz

public subroutine pack_spectral_plane(plane, div_u, nx_spec, nz_spec)

Copies the first dim2 plane of the local spectral slab into a contiguous buffer so it can be handed to MPI.

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(out), device, dimension(:, :) :: plane
complex(kind=dp), intent(in), device, dimension(:, :, :) :: div_u
integer, intent(in), value :: nx_spec

Grid size in spectral space

integer, intent(in), value :: nz_spec

Grid size in spectral space

public subroutine process_spectral_110_norm_z(div_u, nz_h, nx, ny, nz, nx_glob, ny_glob, az, bz)

Step 1 (forward): normalise + Z periodic post-process Z is dim1 (serial j loop), periodic R2C — no sign flip needed since j only goes to nz/2+1. nx, ny are the local loop bounds (equal to nx_glob, ny_glob on a single rank); the normalisation divisor always needs the globals.

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u
integer, intent(in), value :: nz_h
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: nz
integer, intent(in), value :: nx_glob
integer, intent(in), value :: ny_glob
real(kind=dp), intent(in), device, dimension(:) :: az
real(kind=dp), intent(in), device, dimension(:) :: bz

public subroutine process_spectral_110_x_pair_fw(div_u, nz_h, nx, ny, x_sp_st, ax, bx)

Step 2 (forward): X paired even/odd split X is dim2 (thread i). Only i in [2, nx/2+1] executes. Writes to i and nx-i+2. Race-free (pair doesn't enter).

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u
integer, intent(in), value :: nz_h
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: x_sp_st
real(kind=dp), intent(in), device, dimension(:) :: ax
real(kind=dp), intent(in), device, dimension(:) :: bx

public subroutine process_spectral_110_y_pair_fw(div_u, nz_h, nx, ny, y_sp_st, ay, by)

Step 3 (forward): Y paired even/odd split Y is dim3 (blockIdx%y = k). Only k in [2, ny/2+1] executes. Writes to k and ny-k+2. Race-free (pair block doesn't enter).

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u
integer, intent(in), value :: nz_h
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: y_sp_st
real(kind=dp), intent(in), device, dimension(:) :: ay
real(kind=dp), intent(in), device, dimension(:) :: by

public subroutine process_spectral_110_poisson(div_u, waves, nz_h, nx, ny)

Step 4: Poisson solve — divide by waves x and y are cosine transformed, so neither has a Nyquist mode and the only singular entry is the mean, which the eps_wave test handles. The x Nyquist zeroing of the 010 case must not be copied here: in this layout x index nx/2 + 1 is the regular cosine mode N/2 (#465).

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u
complex(kind=dp), intent(in), device, dimension(:, :, :) :: waves
integer, intent(in), value :: nz_h
integer, intent(in), value :: nx
integer, intent(in), value :: ny

public subroutine process_spectral_110_y_pair_bw(div_u, nz_h, nx, ny, y_sp_st, ay, by)

Step 5 (backward): Y paired even/odd recombine

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u
integer, intent(in), value :: nz_h
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: y_sp_st
real(kind=dp), intent(in), device, dimension(:) :: ay
real(kind=dp), intent(in), device, dimension(:) :: by

public subroutine process_spectral_110_x_pair_bw(div_u, nz_h, nx, ny, x_sp_st, ax, bx)

Step 6 (backward): X paired even/odd recombine

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u
integer, intent(in), value :: nz_h
integer, intent(in), value :: nx
integer, intent(in), value :: ny
integer, intent(in), value :: x_sp_st
real(kind=dp), intent(in), device, dimension(:) :: ax
real(kind=dp), intent(in), device, dimension(:) :: bx

public subroutine process_spectral_110_x_pair_fw_mirror(div_u, mirror, plane, nz_h, nx_l, ny, x_sp_st, ax, bx)

Multi-rank counterpart of process_spectral_110_x_pair_fw: the X paired split, but the partner mode lives on another rank, reached through the dim2 mirror exchange (see exchange_dim2_mirror). Unlike the single-rank kernel this only updates this rank's own modes; the partner rank updates its own copy the same way. At the global Nyquist mode (even grid size) the mirror partner is this rank's own pre-update value, so the formula below self-pairs it exactly as the single-rank kernel does.

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u
complex(kind=dp), intent(in), device, dimension(:, :, :) :: mirror
complex(kind=dp), intent(in), device, dimension(:, :) :: plane
integer, intent(in), value :: nz_h
integer, intent(in), value :: nx_l
integer, intent(in), value :: ny
integer, intent(in), value :: x_sp_st
real(kind=dp), intent(in), device, dimension(:) :: ax
real(kind=dp), intent(in), device, dimension(:) :: bx

public subroutine process_spectral_110_x_pair_bw_mirror(div_u, mirror, plane, nz_h, nx_l, ny, x_sp_st, ax, bx)

Multi-rank counterpart of process_spectral_110_x_pair_bw, see process_spectral_110_x_pair_fw_mirror.

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u
complex(kind=dp), intent(in), device, dimension(:, :, :) :: mirror
complex(kind=dp), intent(in), device, dimension(:, :) :: plane
integer, intent(in), value :: nz_h
integer, intent(in), value :: nx_l
integer, intent(in), value :: ny
integer, intent(in), value :: x_sp_st
real(kind=dp), intent(in), device, dimension(:) :: ax
real(kind=dp), intent(in), device, dimension(:) :: bx

public subroutine process_spectral_110_z_bw(div_u, nz_h, nx, ny, az, bz)

Step 7 (backward): Z periodic undo

Arguments

Type IntentOptional Attributes Name
complex(kind=dp), intent(inout), device, dimension(:, :, :) :: div_u
integer, intent(in), value :: nz_h
integer, intent(in), value :: nx
integer, intent(in), value :: ny
real(kind=dp), intent(in), device, dimension(:) :: az
real(kind=dp), intent(in), device, dimension(:) :: bz

public subroutine pack_110_xyz_to_yslab(sendbuf, src, nx, ny_l, nz_l, nproc)

Packs the physical Z-slab field block (nx, ny, nz_l) into the MPI_Alltoall send buffer, selecting for each destination rank s the Y range [sny_l+1, (s+1)ny_l] it owns in the Y-slab layout.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :, :) :: sendbuf
real(kind=dp), intent(in), device, dimension(:, :, :) :: src
integer, intent(in), value :: nx
integer, intent(in), value :: ny_l
integer, intent(in), value :: nz_l
integer, intent(in), value :: nproc

public subroutine unpack_110_yslab(dst, recvbuf, nx, ny_l, nz_l, nproc)

Unpacks the MPI_Alltoall receive buffer into the padded real view (2(nz/2+1), nx, ny_l) of the cuFFTMp Y-slab descriptor: data received from source rank s reconstructs the global Z range [snz_l+1, (s+1)*nz_l].

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: dst
real(kind=dp), intent(in), device, dimension(:, :, :, :) :: recvbuf
integer, intent(in), value :: nx
integer, intent(in), value :: ny_l
integer, intent(in), value :: nz_l
integer, intent(in), value :: nproc

public subroutine pack_110_yslab(sendbuf, src, nx, ny_l, nz_l, nproc)

Inverse of unpack_110_yslab: packs the Y-slab real view into the MPI_Alltoall send buffer, selecting for each destination rank s the Z range it originally owned in the physical Z-slab layout.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :, :) :: sendbuf
real(kind=dp), intent(in), device, dimension(:, :, :) :: src
integer, intent(in), value :: nx
integer, intent(in), value :: ny_l
integer, intent(in), value :: nz_l
integer, intent(in), value :: nproc

public subroutine unpack_110_yslab_to_xyz(dst, recvbuf, nx, ny_l, nz_l, nproc)

Inverse of pack_110_xyz_to_yslab: unpacks into the physical Z-slab field block (nx, ny, nz_l). dst must be zeroed by the caller first, as fft_backward_110_cuda already does for the single rank path.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout), device, dimension(:, :, :) :: dst
real(kind=dp), intent(in), device, dimension(:, :, :, :) :: recvbuf
integer, intent(in), value :: nx
integer, intent(in), value :: ny_l
integer, intent(in), value :: nz_l
integer, intent(in), value :: nproc

public subroutine enforce_periodicity_x(f_out, f_in, nx)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: f_out
real(kind=dp), intent(in), device, dimension(:, :, :) :: f_in
integer, intent(in), value :: nx

public subroutine undo_periodicity_x(f_out, f_in, nx)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: f_out
real(kind=dp), intent(in), device, dimension(:, :, :) :: f_in
integer, intent(in), value :: nx

public subroutine enforce_periodicity_y(f_out, f_in, ny)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: f_out
real(kind=dp), intent(in), device, dimension(:, :, :) :: f_in
integer, intent(in), value :: ny

public subroutine undo_periodicity_y(f_out, f_in, ny)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: f_out
real(kind=dp), intent(in), device, dimension(:, :, :) :: f_in
integer, intent(in), value :: ny

public subroutine enforce_periodicity_xy(f_out, f_in, nx, ny)

Combined X and Y periodicity enforcement (interleave shuffle).

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: f_out
real(kind=dp), intent(in), device, dimension(:, :, :) :: f_in
integer, intent(in), value :: nx
integer, intent(in), value :: ny

public subroutine undo_periodicity_xy(f_out, f_in, nx, ny)

Combined X and Y periodicity undo (reverse interleave shuffle).

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(out), device, dimension(:, :, :) :: f_out
real(kind=dp), intent(in), device, dimension(:, :, :) :: f_in
integer, intent(in), value :: nx
integer, intent(in), value :: ny