reshape_handle_generic Derived Type

type, public, extends(abstract_reshape_handle) :: reshape_handle_generic

Generic Transpose Handle Executes transposition in 3 steps:

For DTFFT_TRANSPOSE_MODE_PACK: - Single transpose kernel execution - Data exchange between processes - P unpack kernels execution

For DTFFT_TRANSPOSE_MODE_UNPACK - P pack kernels execution - Data exchange between processes - P transpose-unpack kernels execution

For fused backends: - For i in P: * find process according to schedule = k * pack with optional transpose to rank k. Compress data (optional) * send to rank k

  • Do while true:
  • Check if data arrived from anybody
  • For i in P_1: Decompress data (optional), then unpack with optional transpose
  • If done for P ranks exit

Inherits

type~~reshape_handle_generic~~InheritsGraph type~reshape_handle_generic reshape_handle_generic type~abstract_backend abstract_backend type~reshape_handle_generic->type~abstract_backend comm_handle type~abstract_compressor abstract_compressor type~reshape_handle_generic->type~abstract_compressor compressor type~abstract_kernel abstract_kernel type~reshape_handle_generic->type~abstract_kernel pack_kernel, unpack_kernel type~abstract_reshape_handle abstract_reshape_handle type~reshape_handle_generic->type~abstract_reshape_handle type~abstract_backend->type~abstract_kernel pack_kernel, unpack_kernel MPI_Comm MPI_Comm type~abstract_backend->MPI_Comm comm type~cudaevent cudaEvent type~abstract_backend->type~cudaevent execution_event, copy_event type~dtfft_backend_t dtfft_backend_t type~abstract_backend->type~dtfft_backend_t backend type~dtfft_platform_t dtfft_platform_t type~abstract_backend->type~dtfft_platform_t platform type~dtfft_stream_t dtfft_stream_t type~abstract_backend->type~dtfft_stream_t copy_stream type~abstract_kernel->type~abstract_compressor compressor type~kernel_type_t kernel_type_t type~abstract_kernel->type~kernel_type_t kernel_type type~string string type~abstract_kernel->type~string kernel_string c_ptr c_ptr type~cudaevent->c_ptr event type~dtfft_stream_t->c_ptr stream

Components

Type Visibility Attributes Name Initial
logical, public :: is_transpose

Is this a transpose operation

logical, private :: is_created = .false.
logical, private :: has_exchange = .false.

If current handle has exchanges

logical, private :: is_pipelined = .false.

If underlying exchanges are pipelined

logical, private :: is_fused = .false.

If underlying exchanges are fused

logical, private :: is_async_supported = .false.

If underlying backend support async execution(execute/execute_end)

logical, private :: is_pack_free = .false.

Are we using pack free reshape or not

logical, private :: is_unpack_free = .false.

Are we using unpack free reshape or not

integer(kind=int64), private :: aux_bytes = 0

Number of workspace bytes required

class(abstract_kernel), private, allocatable :: pack_kernel

Kernel for data transposition

class(abstract_kernel), private, allocatable :: unpack_kernel

Kernel for unpacking data

class(abstract_backend), private, allocatable :: comm_handle

Communication handle

class(abstract_compressor), private, allocatable :: compressor

Compressor


Type-Bound Procedures

procedure, public, non_overridable, pass(self) :: create

Creates reshape handle

  • private subroutine create(self, send, recv, kwargs)

    Creates reshape handle

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_reshape_handle), intent(inout) :: self

    Abstract reshape handle

    type(pencil), intent(in) :: send

    Send pencil

    type(pencil), intent(in) :: recv

    Recv pencil

    type(create_args), intent(inout) :: kwargs

    Additional arguments

procedure, public, pass(self) :: create_private => create

Creates Generic Transpose Handle

  • private subroutine create(self, comm, send, recv, kwargs)

    Creates Generic Transpose Handle

    Arguments

    Type IntentOptional Attributes Name
    class(reshape_handle_generic), intent(inout) :: self

    Generic Transpose Handle

    type(MPI_Comm), intent(in) :: comm

    MPI Communicator

    type(pencil), intent(in) :: send

    Send pencil

    type(pencil), intent(in) :: recv

    Recv pencil

    type(create_args), intent(in) :: kwargs

    Additional arguments

procedure, public, pass(self) :: execute

Executes transpose - exchange - unpack

  • private subroutine execute(self, in, out, kwargs, error_code)

    Executes transpose - exchange - unpack

    Arguments

    Type IntentOptional Attributes Name
    class(reshape_handle_generic), intent(inout) :: self

    Generic Transpose Handle

    type(c_ptr), intent(in) :: in

    Send pointer

    type(c_ptr), intent(in) :: out

    Recv pointer

    type(execute_args), intent(inout) :: kwargs

    Additional arguments

    integer(kind=int32), intent(out) :: error_code

    Error code

procedure, public, pass(self) :: execute_end

Finalizes async transpose

  • private subroutine execute_end(self, kwargs, error_code)

    Ends execution of transposition

    Arguments

    Type IntentOptional Attributes Name
    class(reshape_handle_generic), intent(inout) :: self

    Generic Transpose Handle

    type(execute_args), intent(inout) :: kwargs

    Additional arguments

    integer(kind=int32), intent(out) :: error_code

    Error code

procedure, public, pass(self) :: get_async_active

Returns if async transpose is active

  • private elemental function get_async_active(self)

    Arguments

    Type IntentOptional Attributes Name
    class(reshape_handle_generic), intent(in) :: self

    Generic Transpose Handle

    Return Value logical

procedure, public, pass(self) :: destroy

Destroys Generic Transpose Handle

  • private subroutine destroy(self)

    Destroys Generic Transpose Handle

    Arguments

    Type IntentOptional Attributes Name
    class(reshape_handle_generic), intent(inout) :: self

    Generic Transpose Handle

procedure, public, pass(self) :: get_aux_bytes

Returns number of bytes required by aux buffer

  • private pure function get_aux_bytes(self)

    Returns number of bytes required by aux buffer

    Arguments

    Type IntentOptional Attributes Name
    class(reshape_handle_generic), intent(in) :: self

    Generic Transpose Handle

    Return Value integer(kind=int64)

procedure, public, pass(self) :: get_backend

procedure, public, pass(self) :: report_compression

  • private subroutine report_compression(self, name)

    Arguments

    Type IntentOptional Attributes Name
    class(reshape_handle_generic), intent(in) :: self

    Abstract reshape Handle

    character(len=*), intent(in) :: name