dtfft_transpose_handle_datatype Module

This module describes transpose_handle_datatype class This class implements transposition using MPI_Ialltoall(w) with custom MPI datatypes For the end user this is DTFFT_BACKEND_MPI_DATATYPE - backend. But since it does not perform sequence: transpose -> exchange -> unpack, it is internally treated as tranpose_handle.


Uses

  • module~~dtfft_transpose_handle_datatype~~UsesGraph module~dtfft_transpose_handle_datatype dtfft_transpose_handle_datatype iso_fortran_env iso_fortran_env module~dtfft_transpose_handle_datatype->iso_fortran_env module~dtfft_abstract_transpose_handle dtfft_abstract_transpose_handle module~dtfft_transpose_handle_datatype->module~dtfft_abstract_transpose_handle module~dtfft_errors dtfft_errors module~dtfft_transpose_handle_datatype->module~dtfft_errors module~dtfft_interface_nvtx dtfft_interface_nvtx module~dtfft_transpose_handle_datatype->module~dtfft_interface_nvtx module~dtfft_parameters dtfft_parameters module~dtfft_transpose_handle_datatype->module~dtfft_parameters module~dtfft_pencil dtfft_pencil module~dtfft_transpose_handle_datatype->module~dtfft_pencil module~dtfft_utils dtfft_utils module~dtfft_transpose_handle_datatype->module~dtfft_utils mpi_f08 mpi_f08 module~dtfft_transpose_handle_datatype->mpi_f08 module~dtfft_abstract_transpose_handle->iso_fortran_env module~dtfft_abstract_transpose_handle->module~dtfft_parameters module~dtfft_abstract_transpose_handle->module~dtfft_pencil module~dtfft_abstract_transpose_handle->mpi_f08 module~dtfft_abstract_backend dtfft_abstract_backend module~dtfft_abstract_transpose_handle->module~dtfft_abstract_backend module~dtfft_errors->iso_fortran_env module~dtfft_interface_nvtx->module~dtfft_utils iso_c_binding iso_c_binding module~dtfft_interface_nvtx->iso_c_binding module~dtfft_parameters->iso_fortran_env module~dtfft_parameters->mpi_f08 module~dtfft_parameters->iso_c_binding module~dtfft_pencil->iso_fortran_env module~dtfft_pencil->module~dtfft_errors module~dtfft_pencil->module~dtfft_parameters module~dtfft_pencil->module~dtfft_utils module~dtfft_pencil->mpi_f08 module~dtfft_pencil->iso_c_binding module~dtfft_interface_cuda_runtime dtfft_interface_cuda_runtime module~dtfft_pencil->module~dtfft_interface_cuda_runtime 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_utils->iso_c_binding module~dtfft_abstract_backend->iso_fortran_env module~dtfft_abstract_backend->module~dtfft_errors module~dtfft_abstract_backend->module~dtfft_parameters module~dtfft_abstract_backend->module~dtfft_pencil module~dtfft_abstract_backend->module~dtfft_utils module~dtfft_abstract_backend->mpi_f08 module~dtfft_abstract_backend->iso_c_binding module~dtfft_abstract_backend->module~dtfft_interface_cuda_runtime 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_interface_cuda_runtime->module~dtfft_parameters module~dtfft_interface_cuda_runtime->module~dtfft_utils module~dtfft_interface_cuda_runtime->iso_c_binding 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_fortran_env module~dtfft_config->module~dtfft_errors module~dtfft_config->module~dtfft_parameters module~dtfft_config->module~dtfft_utils module~dtfft_config->mpi_f08 module~dtfft_config->iso_c_binding module~dtfft_config->module~dtfft_interface_cuda_runtime module~dtfft_interface_nccl->module~dtfft_parameters module~dtfft_interface_nccl->module~dtfft_utils module~dtfft_interface_nccl->iso_c_binding

Used by

  • module~~dtfft_transpose_handle_datatype~~UsedByGraph module~dtfft_transpose_handle_datatype dtfft_transpose_handle_datatype module~dtfft_transpose_plan dtfft_transpose_plan module~dtfft_transpose_plan->module~dtfft_transpose_handle_datatype 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

Variables

Type Visibility Attributes Name Initial
integer(kind=MPI_ADDRESS_KIND), private, parameter :: LB = 0

Lower bound for all derived datatypes

logical, private, parameter :: IS_P2P_ENABLED = .false.

Is point-to-point communication enabled


Derived Types

Tranpose backend that uses MPI_Ialltoall(w) with custom MPI datatypes

Components

Type Visibility Attributes Name Initial
type(MPI_Comm), private :: comm

1d communicator

logical, private :: is_even = .false.

Is decomposition even

logical, private :: is_active = .false.

Is async transposition active

type(handle_t), private :: send

Handle to send data

type(handle_t), private :: recv

Handle to recieve data

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

Requests for communication

integer(kind=int32), private :: n_requests

Actual number of requests, can be less than size(requests)

logical, private :: is_request_created = .false.

Is request created

Type-Bound Procedures

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

Creates transpose handle

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

Returns number of bytes required by aux buffer

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

Initializes class

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

Performs MPI_Ialltoall(w)

procedure, public, pass(self) :: execute_end ../../

Waits for MPI_Ialltoall(w) to complete

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

Destroys class

procedure, public, pass(self) :: get_async_active ../../

Returns .true. if async transposition is active

type, private ::  handle_t

Transposition handle class

Components

Type Visibility Attributes Name Initial
type(MPI_Datatype), public, allocatable :: dtypes(:)

Datatypes buffer

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

Number of datatypes (always equals 1)

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

Displacements is bytes

Type-Bound Procedures

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

Creates transposition handle

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

Destroys transposition handle


Functions

private elemental function get_async_active(self)

Returns if async transpose is active

Arguments

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

Transpose handle

Return Value logical


Subroutines

private subroutine create_handle(self, n)

Creates transposition handle

Arguments

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

Transposition handle

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

Number of datatypes to be created

private subroutine destroy_handle(self)

Destroys transposition handle

Arguments

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

Transposition handle

private subroutine create(self, comm, send, recv, transpose_type, base_storage, kwargs)

Creates transpose_handle_datatype class

Arguments

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

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(dtfft_transpose_t), intent(in) :: transpose_type

Type of transpose to create

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

Base storage

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

Additional arguments

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

Executes transposition

Arguments

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

Transpose handle

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

Send pointer

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

Recv pointer

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

Additional arguments

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

Result of execution

private subroutine execute_end(self, kwargs, error_code)

Ends execution of transposition

Arguments

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

Transpose handle

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

Additional arguments

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

Error code

private subroutine destroy(self)

Destroys transpose_handle_datatype class

Arguments

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

Transpose handle

private subroutine create_transpose_2d(send, send_counts, recv, recv_counts, datatype_id, base_type, base_storage, send_dtype, send_displ, recv_dtype, recv_displ)

Creates two-dimensional transposition datatypes

Arguments

Type IntentOptional Attributes Name
class(pencil), intent(in) :: send

Information about send buffer

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

Rank i is sending this counts

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

Information about send buffer

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

Rank i is recieving this counts

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

Id of transpose plan to use

type(MPI_Datatype), intent(in) :: base_type

Base MPI_Datatype

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

Number of bytes needed to store single element

type(MPI_Datatype), intent(out) :: send_dtype

Datatype used to send data

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

Send displacement in bytes

type(MPI_Datatype), intent(out) :: recv_dtype

Datatype used to recv data

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

Recv displacement in bytes

private subroutine create_forw_permutation(send, send_counts, recv, recv_counts, datatype_id, base_type, base_storage, send_dtype, send_displ, recv_dtype, recv_displ)

Creates three-dimensional X –> Y and Y -> Z transposition datatypes

Arguments

Type IntentOptional Attributes Name
class(pencil), intent(in) :: send

Information about send buffer

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

Rank i is sending this counts

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

Information about send buffer

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

Rank i is recieving this counts

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

Id of transpose plan to use

type(MPI_Datatype), intent(in) :: base_type

Base MPI_Datatype

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

Number of bytes needed to store single element

type(MPI_Datatype), intent(out) :: send_dtype

Datatype used to send data

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

Send displacement in bytes

type(MPI_Datatype), intent(out) :: recv_dtype

Datatype used to recv data

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

Recv displacement in bytes

private subroutine create_back_permutation(send, send_counts, recv, recv_counts, datatype_id, base_type, base_storage, send_dtype, send_displ, recv_dtype, recv_displ)

Creates three-dimensional Y –> X and Z –> Y transposition datatypes

Arguments

Type IntentOptional Attributes Name
class(pencil), intent(in) :: send

Information about send buffer

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

Rank i is sending this counts

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

Information about send buffer

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

Rank i is recieving this counts

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

Id of transpose plan to use

type(MPI_Datatype), intent(in) :: base_type

Base MPI_Datatype

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

Number of bytes needed to store single element

type(MPI_Datatype), intent(out) :: send_dtype

Datatype used to send data

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

Send displacement in bytes

type(MPI_Datatype), intent(out) :: recv_dtype

Datatype used to recv data

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

Recv displacement in bytes

private subroutine create_transpose_XZ(send, send_counts, recv, recv_counts, datatype_id, base_type, base_storage, send_dtype, send_displ, recv_dtype, recv_displ)

Creates three-dimensional X –> Z transposition datatypes Can only be used with 3D slab decomposition when slabs are distributed in Z direction

Arguments

Type IntentOptional Attributes Name
class(pencil), intent(in) :: send

Information about send buffer

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

Rank i is sending this counts

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

Information about send buffer

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

Rank i is recieving this counts

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

Id of transpose plan to use

type(MPI_Datatype), intent(in) :: base_type

Base MPI_Datatype

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

Number of bytes needed to store single element

type(MPI_Datatype), intent(out) :: send_dtype

Datatype used to send data

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

Send displacement in bytes

type(MPI_Datatype), intent(out) :: recv_dtype

Datatype used to recv data

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

Recv displacement in bytes

private subroutine create_transpose_ZX(send, send_counts, recv, recv_counts, datatype_id, base_type, base_storage, send_dtype, send_displ, recv_dtype, recv_displ)

Creates three-dimensional Z –> X transposition datatypes Can only be used with 3D slab decomposition when slabs are distributed in Z direction

Arguments

Type IntentOptional Attributes Name
class(pencil), intent(in) :: send

Information about send buffer

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

Rank i is sending this counts

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

Information about send buffer

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

Rank i is recieving this counts

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

Id of transpose plan to use

type(MPI_Datatype), intent(in) :: base_type

Base MPI_Datatype

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

Number of bytes needed to store single element

type(MPI_Datatype), intent(out) :: send_dtype

Datatype used to send data

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

Send displacement in bytes

type(MPI_Datatype), intent(out) :: recv_dtype

Datatype used to recv data

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

Recv displacement in bytes

private subroutine free_datatypes(t1, t2, t3, t4)

Frees temporary datatypes

Arguments

Type IntentOptional Attributes Name
type(MPI_Datatype), intent(inout), optional :: t1

Temporary datatype

type(MPI_Datatype), intent(inout), optional :: t2

Temporary datatype

type(MPI_Datatype), intent(inout), optional :: t3

Temporary datatype

type(MPI_Datatype), intent(inout), optional :: t4

Temporary datatype