backend_nccl Derived Type

type, public, extends(abstract_backend) :: backend_nccl

NCCL backend


Inherits

type~~backend_nccl~~InheritsGraph type~backend_nccl backend_nccl type~abstract_backend abstract_backend type~backend_nccl->type~abstract_backend type~ncclcomm ncclComm type~backend_nccl->type~ncclcomm nccl_comm MPI_Comm MPI_Comm type~abstract_backend->MPI_Comm comm 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_stream_t dtfft_stream_t type~abstract_backend->type~dtfft_stream_t copy_stream type~nvrtc_kernel nvrtc_kernel type~abstract_backend->type~nvrtc_kernel unpack_kernel, unpack_kernel2 c_ptr c_ptr type~ncclcomm->c_ptr member type~cudaevent->c_ptr event type~dtfft_stream_t->c_ptr stream type~cufunction CUfunction type~nvrtc_kernel->type~cufunction cuda_kernel type~dim3 dim3 type~nvrtc_kernel->type~dim3 num_blocks, block_size type~kernelargs kernelArgs type~nvrtc_kernel->type~kernelargs args type~cufunction->c_ptr ptr type~kernelargs->c_ptr ptrs

Components

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

Backend type

logical, public :: is_selfcopy

If backend is self-copying

logical, public :: is_pipelined

If backend is pipelined

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

type(nvrtc_kernel), public, pointer :: unpack_kernel

Kernel for unpacking data

type(nvrtc_kernel), public, pointer :: unpack_kernel2

Kernel for unpacking data

type(ncclComm), private :: nccl_comm

NCCL Communicator


Type-Bound Procedures

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

Creates Abstract GPU Backend

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

    Creates Abstract GPU Backend

    Arguments

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

    Abstract GPU Backend

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

    GPU Backend type

    type(dtfft_transpose_t), intent(in) :: tranpose_type

    Type of transpose to create

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

    Backend helper

    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 GPU Backend

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

    Executes GPU 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

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

Destroys Abstract GPU Backend

  • private subroutine destroy(self)

    Destroys Abstract GPU Backend

    Arguments

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

    Abstract GPU backend

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

Returns number of bytes required by aux buffer

  • private 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 GPU 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, unpack_kernel2)

    Sets unpack kernel for pipelined backend

    Arguments

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

    Pipelined backend

    type(nvrtc_kernel), intent(in), target :: unpack_kernel

    Kernel for unpacking data

    type(nvrtc_kernel), intent(in), optional, target :: unpack_kernel2

    Kernel for unpacking data

procedure, public :: create_private => create_nccl

Creates NCCL backend

  • private subroutine create_nccl(self, helper, tranpose_type, base_storage)

    Creates NCCL backend

    Arguments

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

    NCCL backend

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

    Backend helper

    type(dtfft_transpose_t), intent(in) :: tranpose_type

    Type of transpose to create (unused)

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

    Number of bytes to store single element (unused)

procedure, public :: execute_private => execute_nccl

Executes NCCL backend

  • private subroutine execute_nccl(self, in, out, stream, aux)

    Executes NCCL backend

    Arguments

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

    NCCL 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(:)

    Auxiliary pointer

procedure, public :: destroy_private => destroy_nccl

Destroys NCCL backend

  • private subroutine destroy_nccl(self)

    Destroys NCCL backend

    Arguments

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

    NCCL backend