dbcsr_tensor_reshape Module

Routines to reshape / redistribute tensors



Contents


Variables

TypeVisibilityAttributesNameInitial
character(len=*), private, parameter:: moduleN ='dbcsr_tensor_reshape'

Interfaces

private interface block_buffer_add_block

  • private subroutine block_buffer_add_block_r_dp(buffer, ndata, index, block)

    add block to buffer.

    Arguments

    TypeIntentOptionalAttributesName
    type(block_buffer_type), intent(inout) :: buffer
    integer, intent(in) :: ndata
    integer, intent(in), DIMENSION(ndims_buffer(buffer)):: index
    real(kind=real_8), intent(in), DIMENSION(ndata):: block
  • private subroutine block_buffer_add_block_r_sp(buffer, ndata, index, block)

    add block to buffer.

    Arguments

    TypeIntentOptionalAttributesName
    type(block_buffer_type), intent(inout) :: buffer
    integer, intent(in) :: ndata
    integer, intent(in), DIMENSION(ndims_buffer(buffer)):: index
    real(kind=real_4), intent(in), DIMENSION(ndata):: block
  • private subroutine block_buffer_add_block_c_dp(buffer, ndata, index, block)

    add block to buffer.

    Arguments

    TypeIntentOptionalAttributesName
    type(block_buffer_type), intent(inout) :: buffer
    integer, intent(in) :: ndata
    integer, intent(in), DIMENSION(ndims_buffer(buffer)):: index
    complex(kind=real_8), intent(in), DIMENSION(ndata):: block
  • private subroutine block_buffer_add_block_c_sp(buffer, ndata, index, block)

    add block to buffer.

    Arguments

    TypeIntentOptionalAttributesName
    type(block_buffer_type), intent(inout) :: buffer
    integer, intent(in) :: ndata
    integer, intent(in), DIMENSION(ndims_buffer(buffer)):: index
    complex(kind=real_4), intent(in), DIMENSION(ndata):: block

Derived Types

type, private :: block_buffer_type

Components

TypeVisibilityAttributesNameInitial
integer, public :: ndim =-1
integer, public :: nblock =-1
integer, public, DIMENSION(:, :), ALLOCATABLE:: indx
real(kind=real_8), public, DIMENSION(:), ALLOCATABLE:: msg_r_dp
real(kind=real_4), public, DIMENSION(:), ALLOCATABLE:: msg_r_sp
complex(kind=real_8), public, DIMENSION(:), ALLOCATABLE:: msg_c_dp
complex(kind=real_4), public, DIMENSION(:), ALLOCATABLE:: msg_c_sp
integer, public :: data_type =-1
integer, public :: endpos =-1

Functions

private pure function ndims_buffer(buffer)

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(in) :: buffer

Return Value integer

private pure function block_buffer_blocks_left(buffer)

how many blocks left in iterator

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(in) :: buffer

Return Value logical


Subroutines

public subroutine dbcsr_t_reshape(tensor_in, tensor_out, summation, move_data)

copy data (involves reshape)

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_t_type), intent(inout) :: tensor_in
type(dbcsr_t_type), intent(inout) :: tensor_out
logical, intent(in), optional :: summation

tensor_out = tensor_out + tensor_in move_data memory optimization: transfer data from tensor_in to tensor_out s.t. tensor_in is empty on return

logical, intent(in), optional :: move_data

private subroutine block_buffer_create(buffer, nblock, ndata, data_type, ndim)

Create block buffer for MPI communication.

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(out) :: buffer

block buffer

integer, intent(in) :: nblock

number of blocks total number of block entries number of dimensions

integer, intent(in) :: ndata

number of blocks total number of block entries number of dimensions

integer, intent(in) :: data_type

number of blocks total number of block entries number of dimensions

integer, intent(in) :: ndim

number of blocks total number of block entries number of dimensions

private subroutine block_buffer_destroy(buffer)

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(inout) :: buffer

private subroutine block_buffer_add_anyd_block(buffer, index, block)

insert a block into block buffer (at current iterator position)

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(inout) :: buffer
integer, intent(in), DIMENSION(ndims_buffer(buffer)):: index

index of block

type(block_nd), intent(in) :: block

block

private subroutine block_buffer_get_next_anyd_block(buffer, ndata, index, block, advance_iter)

get next block from buffer. Iterator is advanced only if block is retrieved or advance_iter.

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(inout) :: buffer
integer, intent(out) :: ndata
integer, intent(out), DIMENSION(ndims_buffer(buffer)):: index
type(block_nd), intent(inout), optional :: block
logical, intent(in), optional :: advance_iter

private subroutine block_buffer_get_index(buffer, index)

Get all indices from buffer

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(in) :: buffer
integer, intent(out), DIMENSION(:, :), ALLOCATABLE:: index

private subroutine dbcsr_t_communicate_buffer(mp_comm, buffer_recv, buffer_send, req_array)

communicate buffer

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: mp_comm
type(block_buffer_type), intent(inout), DIMENSION(0:):: buffer_recv
type(block_buffer_type), intent(inout), DIMENSION(0:):: buffer_send
integer, intent(out), DIMENSION(:, :):: req_array

private subroutine block_buffer_add_block_r_dp(buffer, ndata, index, block)

add block to buffer.

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(inout) :: buffer
integer, intent(in) :: ndata
integer, intent(in), DIMENSION(ndims_buffer(buffer)):: index
real(kind=real_8), intent(in), DIMENSION(ndata):: block

private subroutine block_buffer_add_block_r_sp(buffer, ndata, index, block)

add block to buffer.

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(inout) :: buffer
integer, intent(in) :: ndata
integer, intent(in), DIMENSION(ndims_buffer(buffer)):: index
real(kind=real_4), intent(in), DIMENSION(ndata):: block

private subroutine block_buffer_add_block_c_dp(buffer, ndata, index, block)

add block to buffer.

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(inout) :: buffer
integer, intent(in) :: ndata
integer, intent(in), DIMENSION(ndims_buffer(buffer)):: index
complex(kind=real_8), intent(in), DIMENSION(ndata):: block

private subroutine block_buffer_add_block_c_sp(buffer, ndata, index, block)

add block to buffer.

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(inout) :: buffer
integer, intent(in) :: ndata
integer, intent(in), DIMENSION(ndims_buffer(buffer)):: index
complex(kind=real_4), intent(in), DIMENSION(ndata):: block

private subroutine block_buffer_get_next_block_r_dp(buffer, ndata, index, block, advance_iter)

get next block from buffer. Iterator is advanced only if block is retrieved or advance_iter.

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(inout) :: buffer
integer, intent(out) :: ndata
integer, intent(out), DIMENSION(ndims_buffer(buffer)):: index
real(kind=real_8), intent(out), optional DIMENSION(:), ALLOCATABLE:: block
logical, intent(in), optional :: advance_iter

private subroutine block_buffer_get_next_block_r_sp(buffer, ndata, index, block, advance_iter)

get next block from buffer. Iterator is advanced only if block is retrieved or advance_iter.

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(inout) :: buffer
integer, intent(out) :: ndata
integer, intent(out), DIMENSION(ndims_buffer(buffer)):: index
real(kind=real_4), intent(out), optional DIMENSION(:), ALLOCATABLE:: block
logical, intent(in), optional :: advance_iter

private subroutine block_buffer_get_next_block_c_dp(buffer, ndata, index, block, advance_iter)

get next block from buffer. Iterator is advanced only if block is retrieved or advance_iter.

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(inout) :: buffer
integer, intent(out) :: ndata
integer, intent(out), DIMENSION(ndims_buffer(buffer)):: index
complex(kind=real_8), intent(out), optional DIMENSION(:), ALLOCATABLE:: block
logical, intent(in), optional :: advance_iter

private subroutine block_buffer_get_next_block_c_sp(buffer, ndata, index, block, advance_iter)

get next block from buffer. Iterator is advanced only if block is retrieved or advance_iter.

Arguments

TypeIntentOptionalAttributesName
type(block_buffer_type), intent(inout) :: buffer
integer, intent(out) :: ndata
integer, intent(out), DIMENSION(ndims_buffer(buffer)):: index
complex(kind=real_4), intent(out), optional DIMENSION(:), ALLOCATABLE:: block
logical, intent(in), optional :: advance_iter