dbcsr_tensor_example_1 Program

Sparse tensor contraction example


Variables

Type Attributes Name Initial
integer, parameter :: example_type = 2
real(kind=real64), parameter :: filter_eps = 1.0e-08_real64
integer, parameter :: nbatch = 8
real(kind=real64) :: alpha
real(kind=real64) :: beta
real(kind=real64) :: gamma
integer :: max_bsize
integer :: nel
real(kind=real64) :: scale_exp
logical :: contract_direct
logical :: contract_batched
integer :: verbosity
integer :: ierr
integer :: numnodes
integer :: mynode
integer :: node_holds_blk
integer :: io_unit
integer :: io_unit_dbcsr
integer :: ind
integer :: row
integer :: col
integer :: blk
integer :: group
integer :: i
integer :: j
integer :: k
integer :: l
integer :: n
integer :: o
integer :: i_arr
integer :: j_arr
integer :: k_arr
integer :: l_arr
integer :: n_arr
integer :: o_arr
integer :: blk_size
integer :: min_exp
integer :: min_exp_ij
integer :: min_exp_ik
integer :: min_exp_jk
integer :: min_exp_il
integer :: min_exp_in
integer :: min_exp_ln
integer :: ibatch
integer :: jbatch
integer :: lbatch
integer :: mbatch
integer, dimension(:), allocatable :: offset_i
integer, dimension(:), allocatable :: offset_j
integer, dimension(:), allocatable :: offset_l
integer, dimension(:), allocatable :: offset_k
integer, dimension(:), allocatable :: offset_n
integer, dimension(:), allocatable :: tmp
integer, dimension(:), allocatable :: start_batch_i
integer, dimension(:), allocatable :: start_batch_j
integer, dimension(:), allocatable :: start_batch_l
integer, dimension(:), allocatable :: start_batch_m
integer, dimension(:), allocatable :: end_batch_i
integer, dimension(:), allocatable :: end_batch_j
integer, dimension(:), allocatable :: end_batch_l
integer, dimension(:), allocatable :: end_batch_m
integer, dimension(:), allocatable, target :: blk_ind_1
integer, dimension(:), allocatable, target :: blk_ind_2
integer, dimension(:), allocatable, target :: blk_ind_3
integer, dimension(:), allocatable, target :: blk_size_i
integer, dimension(:), allocatable, target :: blk_size_j
integer, dimension(:), allocatable, target :: blk_size_k
integer, dimension(:), allocatable, target :: blk_size_l
integer, dimension(:), allocatable, target :: blk_size_m
integer, dimension(:), allocatable, target :: blk_size_n
integer, dimension(:), allocatable, target :: blk_size_o
integer, dimension(:), allocatable, target :: dist_1
integer, dimension(:), allocatable, target :: dist_2
integer, dimension(:), allocatable, target :: dist_3
integer, dimension(:), allocatable, target :: dist_4
integer, dimension(:, :), allocatable :: bounds_1
integer, dimension(:, :), allocatable :: bounds_2
integer, dimension(:, :), allocatable :: bounds_3
integer, dimension(:), pointer :: row_dist
integer, dimension(:), pointer :: col_dist
integer, dimension(:), pointer :: row_blk_size
integer, dimension(:), pointer :: col_blk_size
integer, dimension(:), pointer :: row_offset
integer, dimension(:), pointer :: col_offset
integer, dimension(2) :: shape_2d
integer, dimension(2) :: blk_ind_2d
integer, dimension(2) :: blk_size_2d
integer, dimension(2) :: blk_offset_2d
integer, dimension(2) :: pdims_2d
integer, dimension(3) :: blk_ind_3d
integer, dimension(3) :: pdims_3d
integer, dimension(3) :: shape_3d
integer, dimension(3) :: blk_size_3d
integer, dimension(3) :: blk_offset_3d
integer, dimension(4) :: shape_4d
integer, dimension(4) :: pdims_4d
integer, dimension(7) :: shape_ijklmno
integer(kind=int64) :: nflop_sum
integer(kind=int64) :: nflop
real(kind=real64) :: cs
real(kind=real64) :: t1
real(kind=real64) :: t0
real(kind=real64) :: time
real(kind=real64) :: flop_rate
real(kind=real64), dimension(:, :), pointer :: blk_values_2d
real(kind=real64), dimension(:, :, :), allocatable :: blk_values_3d
logical :: tr
logical, dimension(2) :: period = .true.
type(dbcsr_type) :: c_matrix
type(dbcsr_distribution_type) :: dist_matrix
type(dbcsr_iterator_type) :: iter_matrix
type(dbcsr_t_pgrid_type) :: pgrid_3d
type(dbcsr_t_pgrid_type) :: pgrid_4d
type(dbcsr_t_distribution_type) :: dist_tensor
type(dbcsr_t_type) :: a_ijk
type(dbcsr_t_type) :: a_lmk
type(dbcsr_t_type) :: b_iln
type(dbcsr_t_type) :: c_no
type(dbcsr_t_type) :: d_ijlm
type(dbcsr_t_type) :: e_jmn
type(dbcsr_t_type) :: f_jmo
type(dbcsr_t_iterator_type) :: iter_tensor

Functions

function block_minabsdiff(offset_1, offset_2, size_1, size_2)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: offset_1
integer, intent(in) :: offset_2
integer, intent(in) :: size_1
integer, intent(in) :: size_2

Return Value integer


Subroutines

subroutine random_blk_sizes(total_size, nblk, blk_sizes)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: total_size
integer, intent(out) :: nblk
integer, intent(out), allocatable :: blk_sizes(:)

subroutine create_batches(blk_sizes, nbatch, start_batch, end_batch)

Arguments

Type IntentOptional Attributes Name
integer, intent(in), dimension(:) :: blk_sizes
integer, intent(in) :: nbatch
integer, intent(out), dimension(:), allocatable :: start_batch
integer, intent(out), dimension(:), allocatable :: end_batch