dbcsr_tensor_reshape Module

Routines to reshape / redistribute tensors



Variables

Type Visibility Attributes Name Initial
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

    Type IntentOptional Attributes Name
    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

    Type IntentOptional Attributes Name
    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

    Type IntentOptional Attributes Name
    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

    Type IntentOptional Attributes Name
    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

Type Visibility Attributes Name Initial
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
type(mp_comm_type), intent(in) :: mp_comm
type(block_buffer_type), intent(inout), DIMENSION(0:) :: buffer_recv
type(block_buffer_type), intent(inout), DIMENSION(0:) :: buffer_send
type(mp_request_type), intent(out), DIMENSION(:, :) :: req_array

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

add block to buffer.

Arguments

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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

Type IntentOptional Attributes Name
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