reshape_plan Derived Type

type, public, extends(reshape_plan_base) :: reshape_plan

Reshape Plan class This class is a container for transposition plans


Inherits

type~~reshape_plan~~InheritsGraph type~reshape_plan reshape_plan MPI_Comm MPI_Comm type~reshape_plan->MPI_Comm comms type~reshape_plan_base reshape_plan_base type~reshape_plan->type~reshape_plan_base type~backend_helper backend_helper type~reshape_plan_base->type~backend_helper helper type~dtfft_backend_t dtfft_backend_t type~reshape_plan_base->type~dtfft_backend_t backend type~dtfft_platform_t dtfft_platform_t type~reshape_plan_base->type~dtfft_platform_t platform type~dtfft_stream_t dtfft_stream_t type~reshape_plan_base->type~dtfft_stream_t stream type~reshape_container reshape_container type~reshape_plan_base->type~reshape_container plans type~string string type~reshape_plan_base->type~string names type~backend_helper->MPI_Comm comms c_ptr c_ptr type~backend_helper->c_ptr nccl_register type~dtfft_reshape_t dtfft_reshape_t type~backend_helper->type~dtfft_reshape_t reshape_type type~dtfft_transpose_t dtfft_transpose_t type~backend_helper->type~dtfft_transpose_t transpose_type type~ncclcomm ncclComm type~backend_helper->type~ncclcomm nccl_comm type~pencil pencil type~backend_helper->type~pencil pencils type~dtfft_stream_t->c_ptr stream type~abstract_reshape_handle abstract_reshape_handle type~reshape_container->type~abstract_reshape_handle p type~ncclcomm->c_ptr member

Inherited by

type~~reshape_plan~~InheritedByGraph type~reshape_plan reshape_plan type~dtfft_plan_t dtfft_plan_t type~dtfft_plan_t->type~reshape_plan rplan type~dtfft_core_c2c dtfft_core_c2c type~dtfft_core_c2c->type~dtfft_plan_t type~dtfft_plan_r2r_t dtfft_plan_r2r_t type~dtfft_plan_r2r_t->type~dtfft_plan_t type~plan_c plan_c type~plan_c->type~dtfft_plan_t p type~dtfft_plan_c2c_t dtfft_plan_c2c_t type~dtfft_plan_c2c_t->type~dtfft_core_c2c type~dtfft_plan_r2c_t dtfft_plan_r2c_t type~dtfft_plan_r2c_t->type~dtfft_core_c2c

Components

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

Backend

type(backend_helper), public :: helper

Backend helper

integer(kind=int64), public :: min_buffer_size

Minimal buffer size for transposition

type(dtfft_platform_t), public :: platform

Platform used for transposition

type(dtfft_stream_t), public :: stream

CUDA stream

type(reshape_container), public, allocatable :: plans(:)

Plans for each reshape operation

type(string), public, allocatable :: names(:)

Names of each reshape operation

integer(kind=int32), private, allocatable :: init_grid(:)
integer(kind=int32), private, allocatable :: final_grid(:)
type(MPI_Comm), private, allocatable :: comms(:)

Type-Bound Procedures

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

  • private function init(self, platform, effort) result(error_code)

    Arguments

    Type IntentOptional Attributes Name
    class(reshape_plan_base), intent(inout) :: self
    type(dtfft_platform_t), intent(in) :: platform
    type(dtfft_effort_t), intent(in) :: effort

    Return Value integer(kind=int32)

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

  • private function get_async_active(self)

    Returns .true. if any of the plans is running asynchronously

    Arguments

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

    Transposition class

    Return Value logical

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

Returns auxiliary buffer size

  • private pure function get_aux_bytes(self)

    Returns maximum auxiliary memory size needed by transpose plan

    Arguments

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

    Transposition class

    Return Value integer(kind=int64)

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

  • private pure function is_aux_needed(self)

    Returns true if aux is needed. false otherwise

    Arguments

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

    Transposition class

    Return Value logical

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

Returns backend id

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

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

    Executes transposition

    Arguments

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

    Transposition class

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

    Incoming buffer

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

    Resulting buffer

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

    Type of reshape to execute

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

    Type of execution (sync/async)

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

    Optional auxiliary buffer

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

    Error code

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

  • private subroutine execute_end(self, in, out, reshape_type, aux, error_code)

    Finishes asynchronous reshape

    Arguments

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

    Reshape class

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

    Incoming buffer

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

    Resulting buffer

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

    Type of reshape to execute

    type(c_ptr), intent(in) :: aux
    integer(kind=int32), intent(out) :: error_code

    Error code

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

  • private subroutine mem_alloc(self, comm, alloc_bytes, ptr, error_code)

    Allocates memory based on selected backend

    Arguments

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

    Transposition class

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

    MPI communicator

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

    Number of bytes to allocate

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

    Pointer to the allocated memory

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

    Error code

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

  • private subroutine mem_free(self, ptr, error_code)

    Frees memory allocated with mem_alloc

    Arguments

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

    Transposition class

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

    Pointer to the memory to free

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

    Error code

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

Creates transpose plan

  • private function create(self, platform, ipencil, pencils, comm, local_comms, base_dtype, base_storage, effort, backend, base_init_dtype, base_init_storage, bricks, is_final_enabled) result(error_code)

    Creates reshape plan

    Read more…

    Arguments

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

    Reshape plan to be initialized

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

    Platform to create plan for (HOST or CUDA)

    type(pencil_init), intent(in) :: ipencil

    Pencil decomposition passed by user

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

    Array of pencil decompositions for different layouts

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

    Global MPI communicator

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

    Local MPI communicators for each dimension

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

    Base MPI datatype for complex data

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

    Number of bytes needed to store single complex element

    type(dtfft_effort_t), intent(in) :: effort

    dtFFT planner effort level (ESTIMATE, MEASURE, PATIENT, EXHAUSTIVE)

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

    Communication backend to use

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

    Base MPI datatype for real data

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

    Number of bytes needed to store single real element

    type(pencil), intent(out) :: bricks(:)

    Pencils describing brick data distribution

    logical, intent(out) :: is_final_enabled

    Flag indicating if final reshape in Fourier space is enabled

    Return Value integer(kind=int32)

    Error code: DTFFT_SUCCESS on success

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

Returns grid for specified reshape

  • private subroutine get_grid(self, dim, grid)

    Returns grid decomposition for specified dimension

    Arguments

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

    Reshape plan

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

    Dimension: 1 for initial grid, other values for final grid

    integer(kind=int32), intent(out), pointer :: grid(:)

    Pointer to grid array

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

  • private subroutine destroy(self)

    Arguments

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