backend_mpi Derived Type

type, public, extends(abstract_backend) :: backend_mpi

MPI Backend


Inherits

type~~backend_mpi~~InheritsGraph type~backend_mpi backend_mpi MPI_Win MPI_Win type~backend_mpi->MPI_Win win type~abstract_backend abstract_backend type~backend_mpi->type~abstract_backend type~mpi_backend_helper mpi_backend_helper type~backend_mpi->type~mpi_backend_helper send, recv MPI_Comm MPI_Comm type~abstract_backend->MPI_Comm comm type~abstract_kernel abstract_kernel type~abstract_backend->type~abstract_kernel unpack_kernel 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 MPI_Request MPI_Request type~mpi_backend_helper->MPI_Request requests type~kernel_type_t kernel_type_t type~abstract_kernel->type~kernel_type_t kernel_type c_ptr c_ptr type~cudaevent->c_ptr event type~dtfft_stream_t->c_ptr stream

Components

Type Visibility Attributes Name Initial
type(dtfft_backend_t), public :: backend

Backend type

type(dtfft_platform_t), public :: platform

Platform to use

logical, public :: is_selfcopy

If backend is self-copying

logical, public :: is_pipelined

If backend is pipelined

logical, public :: is_even

If all processes send/recv same amount of memory

integer(kind=int64), public :: aux_size

Number of bytes required by aux buffer

integer(kind=int64), public :: send_recv_buffer_size

Number of float elements used in c_f_pointer

type(MPI_Comm), public :: comm

MPI Communicator

integer(kind=int32), public, allocatable :: comm_mapping(:)

Mapping of 1d comm ranks to global comm

integer(kind=int32), public :: comm_size

Size of MPI Comm

integer(kind=int32), public :: comm_rank

Rank in MPI Comm

integer(kind=int64), public, allocatable :: send_displs(:)

Send data displacements, in float elements

integer(kind=int64), public, allocatable :: send_floats(:)

Send data elements, in float elements

integer(kind=int64), public, allocatable :: recv_displs(:)

Recv data displacements, in float elements

integer(kind=int64), public, allocatable :: recv_floats(:)

Recv data elements, in float elements

type(cudaEvent), public :: execution_event

Event for main execution stream

type(cudaEvent), public :: copy_event

Event for copy stream

type(dtfft_stream_t), public :: copy_stream

Stream for copy operations

integer(kind=int64), public :: self_copy_bytes

Number of bytes to copy it itself

integer(kind=int64), public :: self_send_displ

Displacement for send buffer

integer(kind=int64), public :: self_recv_displ

Displacement for recv buffer

class(abstract_kernel), public, pointer :: unpack_kernel

Kernel for unpacking data

logical, private :: is_active

If async transpose is active

type(mpi_backend_helper), private :: send

MPI Helper for send data

type(mpi_backend_helper), private :: recv

MPI Helper for recv data

logical, private :: is_rma

Using RMA backend

type(MPI_Win), private :: win

MPI Window for RMA backend

logical, private :: is_request_created

Request created flag. Used for persistent functions

integer(kind=int32), private, allocatable :: schedule(:)

Communication schedule for all-to-all


Type-Bound Procedures

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

Creates Abstract Backend

  • private subroutine create(self, backend, helper, platform, comm_id, send_displs, send_counts, recv_displs, recv_counts, base_storage)

    Creates Abstract Backend

    Arguments

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

    Abstract Backend

    type(dtfft_backend_t), intent(in) :: backend

    Backend type

    type(backend_helper), intent(in) :: helper

    Backend helper

    type(dtfft_platform_t), intent(in) :: platform

    Platform to use

    integer(kind=int8), intent(in) :: comm_id

    Id of communicator to use

    integer(kind=int32), intent(in) :: send_displs(:)

    Send data displacements, in original elements

    integer(kind=int32), intent(in) :: send_counts(:)

    Send data elements, in float elements

    integer(kind=int32), intent(in) :: recv_displs(:)

    Recv data displacements, in float elements

    integer(kind=int32), intent(in) :: recv_counts(:)

    Recv data elements, in float elements

    integer(kind=int64), intent(in) :: base_storage

    Number of bytes to store single element

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

Executes Backend

  • private subroutine execute(self, in, out, stream, aux, exec_type, error_code)

    Executes Backend

    Arguments

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

    Self-copying backend

    real(kind=real32), intent(inout) :: in(:)

    Send pointer

    real(kind=real32), intent(inout) :: out(:)

    Recv pointer

    type(dtfft_stream_t), intent(in) :: stream

    CUDA stream

    real(kind=real32), intent(inout) :: aux(:)

    Aux pointer

    type(async_exec_t), intent(in) :: exec_type

    Type of async execution

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

    Error code

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

Destroys Abstract Backend

  • private subroutine destroy(self)

    Destroys Abstract Backend

    Arguments

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

    Abstract backend

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

Returns number of bytes required by aux buffer

  • private pure function get_aux_size(self)

    Returns number of bytes required by aux buffer

    Arguments

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

    Abstract backend

    Return Value integer(kind=int64)

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

Sets unpack kernel for pipelined backend

  • private subroutine set_unpack_kernel(self, unpack_kernel)

    Sets unpack kernel for pipelined backend

    Arguments

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

    Pipelined backend

    class(abstract_kernel), intent(in), target :: unpack_kernel

    Kernel for unpacking data

procedure, public, pass(self) :: execute_self_copy

  • private subroutine execute_self_copy(self, in, out, stream)

    Arguments

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

    Abstract backend

    real(kind=real32), intent(in) :: in(*)

    Send pointer

    real(kind=real32), intent(inout) :: out(*)

    Recv pointer

    type(dtfft_stream_t), intent(in) :: stream

    CUDA stream

procedure, public :: create_private => create_mpi

Creates MPI backend

  • private subroutine create_mpi(self, helper, base_storage)

    Creates MPI backend

    Arguments

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

    MPI Backend

    type(backend_helper), intent(in) :: helper

    Backend helper (unused)

    integer(kind=int64), intent(in) :: base_storage

    Number of bytes to store single element (unused)

procedure, public :: execute_private => execute_mpi

Executes MPI backend

  • private subroutine execute_mpi(self, in, out, stream, aux, error_code)

    Executes MPI backend

    Arguments

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

    MPI Backend

    real(kind=real32), intent(inout), target :: in(:)

    Send pointer

    real(kind=real32), intent(inout), target :: out(:)

    Recv pointer

    type(dtfft_stream_t), intent(in) :: stream

    Main execution CUDA stream

    real(kind=real32), intent(inout), target :: aux(:)

    Aux pointer

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

    Error code

procedure, public :: destroy_private => destroy_mpi

Destroys MPI backend

  • private subroutine destroy_mpi(self)

    Destroys MPI backend

    Arguments

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

    MPI Backend

procedure, public :: execute_end => execute_end_mpi

Finalizes async transpose

  • private subroutine execute_end_mpi(self, error_code)

    Arguments

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

    MPI Backend

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

    Error code

procedure, public :: get_async_active

Overrides abstract method and returns if async transpose is active

  • private elemental function get_async_active(self)

    Returns if async transpose is active

    Arguments

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

    MPI Backend

    Return Value logical

procedure, public :: execute_p2p

  • private subroutine execute_p2p(self, in, out)

    Arguments

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

    MPI Backend

    real(kind=real32), intent(in) :: in(:)

    Data to be sent

    real(kind=real32), intent(inout) :: out(:)

    Data to be received

procedure, public :: execute_a2a

  • private subroutine execute_a2a(self, in, out)

    Arguments

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

    MPI Backend

    real(kind=real32), intent(in) :: in(:)

    Data to be sent

    real(kind=real32), intent(inout) :: out(:)

    Data to be received

procedure, public :: execute_p2p_scheduled

  • private subroutine execute_p2p_scheduled(self, in, out)

    Arguments

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

    MPI Backend

    real(kind=real32), intent(in) :: in(:)

    Data to be sent

    real(kind=real32), intent(inout) :: out(:)

    Data to be received

procedure, public :: compute_alltoall_schedule

  • private subroutine compute_alltoall_schedule(self)

    Generate optimal round-robin communication schedule for all-to-all pattern

    Arguments

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

    MPI Backend