reshape_handle_datatype Derived Type

type, public, extends(abstract_reshape_handle) :: reshape_handle_datatype

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


Inherits

type~~reshape_handle_datatype~~InheritsGraph type~reshape_handle_datatype reshape_handle_datatype MPI_Comm MPI_Comm type~reshape_handle_datatype->MPI_Comm comm MPI_Request MPI_Request type~reshape_handle_datatype->MPI_Request requests type~abstract_reshape_handle abstract_reshape_handle type~reshape_handle_datatype->type~abstract_reshape_handle type~handle_t handle_t type~reshape_handle_datatype->type~handle_t send, recv MPI_Datatype MPI_Datatype type~handle_t->MPI_Datatype dtypes

Components

Type Visibility Attributes Name Initial
logical, public :: is_transpose

Is this a transpose operation

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 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) :: 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(abstract_reshape_handle), intent(in) :: self

    Abstract reshape Handle

    Return Value integer(kind=int64)

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

Initializes class

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

    Creates reshape_handle_datatype class

    Arguments

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

    Reshape 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

Performs MPI_Ialltoall(w)

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

    Executes transposition/reshaping

    Arguments

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

    Datatype 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

procedure, public, pass(self) :: execute_end

Waits for MPI_Ialltoall(w) to complete

  • private subroutine execute_end(self, kwargs, error_code)

    Ends execution of transposition/reshaping

    Arguments

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

    Datatype handle

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

    Additional arguments

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

    Error code

procedure, public, pass(self) :: destroy

Destroys class

  • private subroutine destroy(self)

    Destroys reshape_handle_datatype class

    Arguments

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

    Datatype handle

procedure, public, pass(self) :: get_async_active

Returns .true. if async transposition is active

  • private elemental function get_async_active(self)

    Returns if async transpose/reshape is active

    Arguments

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

    Datatype handle

    Return Value logical