dbcsr_tas_reshape_ops Module

communication routines to reshape / replicate / merge tall-and-skinny matrices.



Variables

Type Visibility Attributes Name Initial
character(len=*), private, parameter :: moduleN = 'dbcsr_tas_reshape_ops'

Interfaces

private interface block_buffer_get_next_block

  • private subroutine block_buffer_get_next_area_block(buffer, ndata, index, block, advance_iter)

    Arguments

    Type IntentOptional Attributes Name
    type(block_buffer_type), intent(inout) :: buffer
    integer, intent(out) :: ndata
    integer(kind=int_8), intent(out), DIMENSION(2) :: index
    type(dbcsr_data_obj), intent(inout), optional :: block
    logical, intent(in), optional :: advance_iter

private interface block_buffer_add_block

  • private subroutine block_buffer_add_area_block(buffer, index, block, transposed)

    Arguments

    Type IntentOptional Attributes Name
    type(block_buffer_type), intent(inout) :: buffer
    integer(kind=int_8), intent(in), DIMENSION(2) :: index
    type(dbcsr_data_obj), intent(in) :: block
    logical, intent(in), optional :: transposed
  • private subroutine block_buffer_add_block_r_dp(buffer, index, block, transposed)

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

    Arguments

    Type IntentOptional Attributes Name
    type(block_buffer_type), intent(inout) :: buffer
    integer(kind=int_8), intent(in), DIMENSION(2) :: index

    index of block

    real(kind=real_8), intent(in), DIMENSION(:, :) :: block

    block

    logical, intent(in), optional :: transposed
  • private subroutine block_buffer_add_block_r_sp(buffer, index, block, transposed)

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

    Arguments

    Type IntentOptional Attributes Name
    type(block_buffer_type), intent(inout) :: buffer
    integer(kind=int_8), intent(in), DIMENSION(2) :: index

    index of block

    real(kind=real_4), intent(in), DIMENSION(:, :) :: block

    block

    logical, intent(in), optional :: transposed
  • private subroutine block_buffer_add_block_c_dp(buffer, index, block, transposed)

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

    Arguments

    Type IntentOptional Attributes Name
    type(block_buffer_type), intent(inout) :: buffer
    integer(kind=int_8), intent(in), DIMENSION(2) :: index

    index of block

    complex(kind=real_8), intent(in), DIMENSION(:, :) :: block

    block

    logical, intent(in), optional :: transposed
  • private subroutine block_buffer_add_block_c_sp(buffer, index, block, transposed)

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

    Arguments

    Type IntentOptional Attributes Name
    type(block_buffer_type), intent(inout) :: buffer
    integer(kind=int_8), intent(in), DIMENSION(2) :: index

    index of block

    complex(kind=real_4), intent(in), DIMENSION(:, :) :: block

    block

    logical, intent(in), optional :: transposed

Derived Types

type, private ::  block_buffer_type

Components

Type Visibility Attributes Name Initial
integer, public :: nblock = -1
integer(kind=int_8), 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 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 recursive subroutine dbcsr_tas_reshape(matrix_in, matrix_out, summation, transposed, move_data)

copy data (involves reshape)

Arguments

Type IntentOptional Attributes Name
type(dbcsr_tas_type), intent(inout) :: matrix_in
type(dbcsr_tas_type), intent(inout) :: matrix_out
logical, intent(in), optional :: summation

whether matrix_out = matrix_out + matrix_in

logical, intent(in), optional :: transposed
logical, intent(in), optional :: move_data

memory optimization: move data to matrix_out such that matrix_in is empty on return

public subroutine dbcsr_tas_replicate(matrix_in, info, matrix_out, nodata, move_data)

Replicate matrix_in such that each submatrix of matrix_out is an exact copy of matrix_in

Arguments

Type IntentOptional Attributes Name
type(dbcsr_type), intent(inout) :: matrix_in
type(dbcsr_tas_split_info), intent(in) :: info
type(dbcsr_tas_type), intent(out) :: matrix_out
logical, intent(in), optional :: nodata

Don't copy data but create matrix_out

logical, intent(in), optional :: move_data

memory optimization: move data to matrix_out such that matrix_in is empty on return

public subroutine dbcsr_tas_merge(matrix_out, matrix_in, summation, move_data)

Merge submatrices of matrix_in to matrix_out by sum

Arguments

Type IntentOptional Attributes Name
type(dbcsr_type), intent(inout) :: matrix_out
type(dbcsr_tas_type), intent(inout) :: matrix_in
logical, intent(in), optional :: summation
logical, intent(in), optional :: move_data

memory optimization: move data to matrix_out such that matrix_in is empty on return

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(kind=int_8), intent(out), ALLOCATABLE, DIMENSION(:, :) :: index

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

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

integer, intent(in) :: ndata

number of blocks total number of block entries

integer, intent(in) :: data_type

number of blocks total number of block entries

private subroutine block_buffer_destroy(buffer)

Arguments

Type IntentOptional Attributes Name
type(block_buffer_type), intent(inout) :: buffer

private subroutine block_buffer_add_area_block(buffer, index, block, transposed)

Arguments

Type IntentOptional Attributes Name
type(block_buffer_type), intent(inout) :: buffer
integer(kind=int_8), intent(in), DIMENSION(2) :: index
type(dbcsr_data_obj), intent(in) :: block
logical, intent(in), optional :: transposed

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

Arguments

Type IntentOptional Attributes Name
type(block_buffer_type), intent(inout) :: buffer
integer, intent(out) :: ndata
integer(kind=int_8), intent(out), DIMENSION(2) :: index
type(dbcsr_data_obj), intent(inout), optional :: block
logical, intent(in), optional :: advance_iter

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

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

Arguments

Type IntentOptional Attributes Name
type(block_buffer_type), intent(inout) :: buffer
integer(kind=int_8), intent(in), DIMENSION(2) :: index

index of block

real(kind=real_8), intent(in), DIMENSION(:, :) :: block

block

logical, intent(in), optional :: transposed

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

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

Arguments

Type IntentOptional Attributes Name
type(block_buffer_type), intent(inout) :: buffer
integer(kind=int_8), intent(in), DIMENSION(2) :: index

index of block

real(kind=real_4), intent(in), DIMENSION(:, :) :: block

block

logical, intent(in), optional :: transposed

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

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

Arguments

Type IntentOptional Attributes Name
type(block_buffer_type), intent(inout) :: buffer
integer(kind=int_8), intent(in), DIMENSION(2) :: index

index of block

complex(kind=real_8), intent(in), DIMENSION(:, :) :: block

block

logical, intent(in), optional :: transposed

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

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

Arguments

Type IntentOptional Attributes Name
type(block_buffer_type), intent(inout) :: buffer
integer(kind=int_8), intent(in), DIMENSION(2) :: index

index of block

complex(kind=real_4), intent(in), DIMENSION(:, :) :: block

block

logical, intent(in), optional :: transposed

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(kind=int_8), intent(out), DIMENSION(2) :: index
real(kind=real_8), intent(out), optional, DIMENSION(:, :) :: 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(kind=int_8), intent(out), DIMENSION(2) :: index
real(kind=real_4), intent(out), optional, DIMENSION(:, :) :: 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(kind=int_8), intent(out), DIMENSION(2) :: index
complex(kind=real_8), intent(out), optional, DIMENSION(:, :) :: 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(kind=int_8), intent(out), DIMENSION(2) :: index
complex(kind=real_4), intent(out), optional, DIMENSION(:, :) :: block
logical, intent(in), optional :: advance_iter

private subroutine dbcsr_tas_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