dtfft_backend_mpi Module

MPI Based Backends backend_mpi


Uses

  • module~~dtfft_backend_mpi~~UsesGraph module~dtfft_backend_mpi dtfft_backend_mpi iso_c_binding iso_c_binding module~dtfft_backend_mpi->iso_c_binding iso_fortran_env iso_fortran_env module~dtfft_backend_mpi->iso_fortran_env module~dtfft_abstract_backend dtfft_abstract_backend module~dtfft_backend_mpi->module~dtfft_abstract_backend module~dtfft_errors dtfft_errors module~dtfft_backend_mpi->module~dtfft_errors module~dtfft_interface_cuda_runtime dtfft_interface_cuda_runtime module~dtfft_backend_mpi->module~dtfft_interface_cuda_runtime module~dtfft_interface_nvtx dtfft_interface_nvtx module~dtfft_backend_mpi->module~dtfft_interface_nvtx module~dtfft_parameters dtfft_parameters module~dtfft_backend_mpi->module~dtfft_parameters module~dtfft_utils dtfft_utils module~dtfft_backend_mpi->module~dtfft_utils mpi_f08 mpi_f08 module~dtfft_backend_mpi->mpi_f08 module~dtfft_abstract_backend->iso_c_binding module~dtfft_abstract_backend->iso_fortran_env module~dtfft_abstract_backend->module~dtfft_errors module~dtfft_abstract_backend->module~dtfft_interface_cuda_runtime module~dtfft_abstract_backend->module~dtfft_parameters module~dtfft_abstract_backend->module~dtfft_utils module~dtfft_abstract_backend->mpi_f08 module~dtfft_abstract_kernel dtfft_abstract_kernel module~dtfft_abstract_backend->module~dtfft_abstract_kernel module~dtfft_config dtfft_config module~dtfft_abstract_backend->module~dtfft_config module~dtfft_interface_nccl dtfft_interface_nccl module~dtfft_abstract_backend->module~dtfft_interface_nccl module~dtfft_pencil dtfft_pencil module~dtfft_abstract_backend->module~dtfft_pencil module~dtfft_errors->iso_fortran_env module~dtfft_interface_cuda_runtime->iso_c_binding module~dtfft_interface_cuda_runtime->module~dtfft_parameters module~dtfft_interface_cuda_runtime->module~dtfft_utils module~dtfft_interface_nvtx->iso_c_binding module~dtfft_interface_nvtx->module~dtfft_utils module~dtfft_parameters->iso_c_binding module~dtfft_parameters->iso_fortran_env module~dtfft_parameters->mpi_f08 module~dtfft_utils->iso_c_binding module~dtfft_utils->iso_fortran_env module~dtfft_utils->module~dtfft_errors module~dtfft_utils->module~dtfft_parameters module~dtfft_utils->mpi_f08 module~dtfft_abstract_kernel->iso_fortran_env module~dtfft_abstract_kernel->module~dtfft_interface_nvtx module~dtfft_abstract_kernel->module~dtfft_parameters module~dtfft_abstract_kernel->module~dtfft_utils module~dtfft_abstract_kernel->mpi_f08 module~dtfft_config->iso_c_binding module~dtfft_config->iso_fortran_env module~dtfft_config->module~dtfft_errors module~dtfft_config->module~dtfft_interface_cuda_runtime module~dtfft_config->module~dtfft_parameters module~dtfft_config->module~dtfft_utils module~dtfft_config->mpi_f08 module~dtfft_interface_nccl->iso_c_binding module~dtfft_interface_nccl->module~dtfft_parameters module~dtfft_interface_nccl->module~dtfft_utils module~dtfft_pencil->iso_c_binding module~dtfft_pencil->iso_fortran_env module~dtfft_pencil->module~dtfft_errors module~dtfft_pencil->module~dtfft_interface_cuda_runtime module~dtfft_pencil->module~dtfft_parameters module~dtfft_pencil->module~dtfft_utils module~dtfft_pencil->mpi_f08

Used by

  • module~~dtfft_backend_mpi~~UsedByGraph module~dtfft_backend_mpi dtfft_backend_mpi module~dtfft_transpose_handle_generic dtfft_transpose_handle_generic module~dtfft_transpose_handle_generic->module~dtfft_backend_mpi module~dtfft_transpose_plan dtfft_transpose_plan module~dtfft_transpose_plan->module~dtfft_transpose_handle_generic module~dtfft_plan dtfft_plan module~dtfft_plan->module~dtfft_transpose_plan module~dtfft dtfft module~dtfft->module~dtfft_plan module~dtfft_api dtfft_api module~dtfft_api->module~dtfft_plan

Derived Types

type, public, extends(abstract_backend) ::  backend_mpi

MPI Backend

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

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

Executes Backend

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

Destroys Abstract Backend

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

Returns number of bytes required by aux buffer

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

Sets unpack kernel for pipelined backend

procedure, public, pass(self) :: execute_self_copy
procedure, public :: create_private => create_mpi ../../

Creates MPI backend

procedure, public :: execute_private => execute_mpi ../../

Executes MPI backend

procedure, public :: destroy_private => destroy_mpi ../../

Destroys MPI backend

procedure, public :: execute_end => execute_end_mpi ../../

Finalizes async transpose

procedure, public :: get_async_active ../../

Overrides abstract method and returns if async transpose is active

procedure, public :: execute_p2p
procedure, public :: execute_a2a
procedure, public :: execute_p2p_scheduled
procedure, public :: compute_alltoall_schedule

type, private ::  mpi_backend_helper

MPI Helper

Components

Type Visibility Attributes Name Initial
integer(kind=CNT_KIND), public, allocatable :: counts(:)

Counts of data to send or recv

integer(kind=ADDR_KIND), public, allocatable :: displs(:)

Displacements of data to send or recv

type(MPI_Request), public, allocatable :: requests(:)

MPI Requests

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

Process map for pipelined communication

integer(kind=int32), public :: n_requests

Number of requests

Type-Bound Procedures

procedure, public, pass(self) :: create => create_helper ../../

Creates MPI helper

procedure, public, pass(self) :: destroy => destroy_helper ../../

Destroys MPI helper


Functions

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


Subroutines

private subroutine create_helper(self, counts, displs, max_requests)

Creates MPI helper

Arguments

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

MPI Helper

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

Counts of data to send or recv

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

Displacements of data to send or recv

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

Maximum number of requests required

private subroutine destroy_helper(self, is_request_created)

Destroys MPI helper

Arguments

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

MPI Helper

logical, intent(in) :: is_request_created

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)

private subroutine destroy_mpi(self)

Destroys MPI backend

Arguments

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

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

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

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

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

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

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