Documentation for module dbcsr_mm_multrec

Second layer of the dbcsr matrix-matrix multiplication. It divides the multiplication in a cache-oblivious manner.

source: dbcsr_mm_multrec.F
Loading...

public Types:

dbcsr_mm_multrec_type
Used to carry data among the various calls. Each thread has its own private copy.

public Subroutines/Functions:

Sets up recursive multiplication
Sets up recursive multiplication
FUNCTION
INTEGER
dbcsr_mm_multrec_get_nblks (this)
Return number of blocks
FUNCTION
INTEGER
dbcsr_mm_multrec_get_nze (this)
Return data size
Sets up recursive multiplication
Finalize the library
Initialize the library
Multiplies two DBCSR matrices using recursive algorithm
Signal approaching end of multiplication
Make the reduction of the 3D layers in the local multrec object

public Types:

TYPE :: dbcsr_mm_multrec_type

Used to carry data among the various calls. Each thread has its own private copy.


LOGICAL
:: c_has_symmetry The product matrix has symmetry
LOGICAL
:: keep_sparsity Sparsity of C matrix should be kept
LOGICAL
:: use_eps Use on-the-fly filtering
INTEGER,
DIMENSION(:), POINTER :: m_sizes Block sizes of A and C matrix rows, indexed locally
INTEGER,
DIMENSION(:), POINTER :: n_sizes Block sizes of B and C matrix columns, indexed locally
INTEGER,
DIMENSION(:), POINTER :: k_sizes Block sizes of A matrix columns and B matrix rows, indexed locally
INTEGER,
DIMENSION(:), POINTER :: m_global_sizes ...
INTEGER,
DIMENSION(:), POINTER :: n_global_sizes ...
INTEGER,
DIMENSION(:), POINTER :: c_local_rows C and A matrix local rows. Map from local row (index) to global row (value).
INTEGER,
DIMENSION(:), POINTER :: c_local_cols C and B matrix local columns. Map from local column (index) to global column (value).
INTEGER,
DIMENSION(:), POINTER :: k_locals A matrix local columns and B matrix local rows. Map from local row/column (index) to global row/column (value).
INTEGER,
DIMENSION(:), POINTER :: c_global_rows C and A matrix global rows. Map from global rows (index) to local rows (value).
INTEGER,
DIMENSION(:), POINTER :: c_global_cols C and B matrix global columns. Map from global columns (index) to local columns (value).
REAL(sp),
DIMENSION(:), POINTER :: row_max_epss Maximum eps to be used for one row.
REAL(sp),
DIMENSION(:), POINTER :: a_norms Norms of A matrix blocks.
REAL(sp),
DIMENSION(:), POINTER :: b_norms Norms of B matrix blocks.
REAL(real_8)
:: eps ...
INTEGER
:: original_lastblk Number of work matrix blocks before addition
INTEGER(int_8)
:: flop flop count
POINTER :: product_wm => NULL() ...
:: csr ...
LOGICAL
:: new_row_max_epss = .FALSE. ...
LOGICAL
:: initialized = .FALSE. ...

SUBROUTINEdbcsr_mm_multrec_dev2host_init(this)

Sets up recursive multiplication

Arguments:
INTENT(inout)
:: this ...

SUBROUTINEdbcsr_mm_multrec_finalize(this, meta_buffer)

Sets up recursive multiplication

Arguments:
INTENT(inout)
:: this ...
INTEGER,
INTENT(inout),
OPTIONAL
:: meta_buffer(:) ...

FUNCTIONdbcsr_mm_multrec_get_nblks(this)

Return number of blocks

Return Value ::
INTEGER
Arguments:
INTENT(in)
:: this ...

FUNCTIONdbcsr_mm_multrec_get_nze(this)

Return data size

Return Value ::
INTEGER
Arguments:
INTENT(in)
:: this ...

SUBROUTINEdbcsr_mm_multrec_init(this, left, right, product, keep_sparsity, eps, row_max_epss, block_estimate, right_row_blk_size, m_sizes, n_sizes, nlayers)

Sets up recursive multiplication

Arguments:
INTENT(out)
:: this ...
TYPE(dbcsr_type),
INTENT(in),
OPTIONAL
:: left left DBCSR matrix
TYPE(dbcsr_type),
INTENT(in),
OPTIONAL
:: right right DBCSR matrix
TYPE(dbcsr_type),
INTENT(inout)
:: product resulting DBCSR product matrix
LOGICAL,
INTENT(in)
:: keep_sparsity retain the sparsity of the existing product matrix, default is no
REAL(real_8),
INTENT(in),
OPTIONAL
:: eps on-the-fly filtering epsilon
REAL(sp),
INTENT(in),
TARGET
:: row_max_epss(:) ...
INTEGER,
INTENT(in)
:: block_estimate ...
INTEGER,
INTENT(in)
:: right_row_blk_size(:) ...
INTEGER,
INTENT(in),
POINTER
:: m_sizes(:) ...
INTEGER,
INTENT(in),
POINTER
:: n_sizes(:) ...
INTEGER,
OPTIONAL
:: nlayers ...

SUBROUTINEdbcsr_mm_multrec_lib_finalize(group, output_unit)

Finalize the library

Arguments:
INTEGER,
INTENT(in)
:: group ...
INTEGER,
INTENT(in)
:: output_unit ...

SUBROUTINEdbcsr_mm_multrec_lib_init()

Initialize the library

SUBROUTINEdbcsr_mm_multrec_multiply(this, left, right, flop, a_norms, b_norms, k_sizes)

Multiplies two DBCSR matrices using recursive algorithm

Arguments:
INTENT(inout)
:: this ...
TYPE(dbcsr_type),
INTENT(in)
:: left left DBCSR matrix
TYPE(dbcsr_type),
INTENT(in)
:: right right DBCSR matrix
INTEGER(int_8),
INTENT(out)
:: flop number of effective double-precision floating point operations performed
REAL(sp),
INTENT(in),
TARGET
:: a_norms(:) norms of left-matrix blocks
REAL(sp),
INTENT(in),
TARGET
:: b_norms(:) norms of right-matrix blocks
INTEGER,
INTENT(in),
POINTER
:: k_sizes(:) ...

SUBROUTINEdbcsr_mm_multrec_phaseout(this)

Signal approaching end of multiplication

Arguments:
INTENT(inout)
:: this ...

SUBROUTINEdbcsr_mm_multrec_red3d(this, meta_buffer, data_buffer, flop, g2l_map_rows, g2l_map_cols)

Make the reduction of the 3D layers in the local multrec object

Arguments:
INTENT(inout)
:: this ...
INTEGER,
INTENT(in)
:: meta_buffer(:) ...
INTENT(in)
:: data_buffer ...
INTEGER(int_8),
INTENT(inout)
:: flop ...
INTEGER,
INTENT(in)
:: g2l_map_rows(:) ...
INTEGER,
INTENT(in)
:: g2l_map_cols(:) ...