Second layer of the dbcsr matrix-matrix multiplication. It divides the multiplication in a cache-oblivious manner. Modification history: - 2010-02-23 Moved from dbcsr_operations - 2011-11 Moved parameter-stack processing routines to dbcsr_mm_methods. - 2013-01 extensive refactoring (Ole Schuett)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=*), | private, | parameter | :: | moduleN | = | 'dbcsr_mm_multrec' | |
logical, | private, | parameter | :: | careful_mod | = | .FALSE. |
Used to carry data among the various calls. Each thread has its own private copy.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | private | :: | c_has_symmetry | = | .FALSE. |
The product matrix has symmetry Sparsity of C matrix should be kept Use on-the-fly filtering |
|
logical, | private | :: | keep_sparsity | = | .FALSE. |
The product matrix has symmetry Sparsity of C matrix should be kept Use on-the-fly filtering |
|
logical, | private | :: | keep_product_data | = | .FALSE. |
The product matrix has symmetry Sparsity of C matrix should be kept Use on-the-fly filtering |
|
logical, | private | :: | use_eps | = | .FALSE. |
The product matrix has symmetry Sparsity of C matrix should be kept Use on-the-fly filtering |
|
integer, | private, | DIMENSION(:), POINTER | :: | m_sizes | => | NULL() |
Block sizes of A and C matrix rows, indexed locally Block sizes of B and C matrix columns, indexed locally Block sizes of A matrix columns and B matrix rows, indexed locally |
integer, | private, | DIMENSION(:), POINTER | :: | n_sizes | => | NULL() |
Block sizes of A and C matrix rows, indexed locally Block sizes of B and C matrix columns, indexed locally Block sizes of A matrix columns and B matrix rows, indexed locally |
integer, | private, | DIMENSION(:), POINTER | :: | k_sizes | => | NULL() |
Block sizes of A and C matrix rows, indexed locally Block sizes of B and C matrix columns, indexed locally Block sizes of A matrix columns and B matrix rows, indexed locally |
integer, | private, | DIMENSION(:), POINTER | :: | m_global_sizes | => | NULL() | |
integer, | private, | DIMENSION(:), POINTER | :: | n_global_sizes | => | NULL() | |
integer, | private, | DIMENSION(:), POINTER | :: | c_local_rows | => | NULL() |
C and A matrix local rows. Map from local row (index) to global row (value). C and B matrix local columns. Map from local column (index) to global column (value). A matrix local columns and B matrix local rows. Map from local row/column (index) to global row/column (value). C and A matrix global rows. Map from global rows (index) to local rows (value). C and B matrix global columns. Map from global columns (index) to local columns (value). |
integer, | private, | DIMENSION(:), POINTER | :: | c_local_cols | => | NULL() |
C and A matrix local rows. Map from local row (index) to global row (value). C and B matrix local columns. Map from local column (index) to global column (value). A matrix local columns and B matrix local rows. Map from local row/column (index) to global row/column (value). C and A matrix global rows. Map from global rows (index) to local rows (value). C and B matrix global columns. Map from global columns (index) to local columns (value). |
integer, | private, | DIMENSION(:), POINTER | :: | k_locals | => | NULL() |
C and A matrix local rows. Map from local row (index) to global row (value). C and B matrix local columns. Map from local column (index) to global column (value). A matrix local columns and B matrix local rows. Map from local row/column (index) to global row/column (value). C and A matrix global rows. Map from global rows (index) to local rows (value). C and B matrix global columns. Map from global columns (index) to local columns (value). |
integer, | private, | DIMENSION(:), POINTER | :: | c_global_rows | => | NULL() |
C and A matrix local rows. Map from local row (index) to global row (value). C and B matrix local columns. Map from local column (index) to global column (value). A matrix local columns and B matrix local rows. Map from local row/column (index) to global row/column (value). C and A matrix global rows. Map from global rows (index) to local rows (value). C and B matrix global columns. Map from global columns (index) to local columns (value). |
integer, | private, | DIMENSION(:), POINTER | :: | c_global_cols | => | NULL() |
C and A matrix local rows. Map from local row (index) to global row (value). C and B matrix local columns. Map from local column (index) to global column (value). A matrix local columns and B matrix local rows. Map from local row/column (index) to global row/column (value). C and A matrix global rows. Map from global rows (index) to local rows (value). C and B matrix global columns. Map from global columns (index) to local columns (value). |
real(kind=sp), | private, | DIMENSION(:), POINTER | :: | row_max_epss | => | NULL() |
Maximum eps to be used for one row. Norms of A matrix blocks. Norms of B matrix blocks. |
real(kind=sp), | private, | DIMENSION(:), POINTER | :: | a_norms | => | NULL() |
Maximum eps to be used for one row. Norms of A matrix blocks. Norms of B matrix blocks. |
real(kind=sp), | private, | DIMENSION(:), POINTER | :: | b_norms | => | NULL() |
Maximum eps to be used for one row. Norms of A matrix blocks. Norms of B matrix blocks. |
real(kind=real_8), | private | :: | eps | = | -1.0_real_8 | ||
integer, | private | :: | original_lastblk | = | -1 |
Number of work matrix blocks before addition |
|
integer(kind=int_8), | private | :: | flop | = | -1_int_8 |
flop count |
|
type(dbcsr_work_type), | private, | POINTER | :: | product_wm | => | Null() | |
type(dbcsr_mm_csr_type), | private | :: | csr | = | dbcsr_mm_csr_type() | ||
logical, | private | :: | new_row_max_epss | = | .FALSE. | ||
logical, | private | :: | initialized | = | .FALSE. |
Return number of blocks
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_multrec_type), | intent(in) | :: | this |
Return data size
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_multrec_type), | intent(in) | :: | this |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ai | |||
integer, | intent(in) | :: | af | |||
integer, | intent(in), | DIMENSION(3, 1:af) | :: | a | ||
integer, | intent(in) | :: | val |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ai | |||
integer, | intent(in) | :: | af | |||
integer, | intent(in), | DIMENSION(3, 1:af) | :: | a | ||
integer, | intent(in) | :: | val |
Initialize the library
Finalize the library
Sets up recursive multiplication
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_multrec_type), | intent(out) | :: | this | |||
type(dbcsr_type), | intent(in), | optional | :: | left |
left DBCSR matrix right DBCSR matrix |
|
type(dbcsr_type), | intent(in), | optional | :: | right |
left DBCSR matrix 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(kind=real_8), | intent(in), | optional | :: | eps |
on-the-fly filtering epsilon |
|
real(kind=sp), | intent(in), | DIMENSION(:), TARGET | :: | row_max_epss | ||
integer, | intent(in) | :: | block_estimate | |||
integer, | intent(in), | DIMENSION(:) | :: | right_row_blk_size | ||
integer, | intent(in), | DIMENSION(:), POINTER | :: | m_sizes | ||
integer, | intent(in), | DIMENSION(:), POINTER | :: | n_sizes | ||
integer, | optional | :: | nlayers | |||
logical, | intent(in), | optional | :: | keep_product_data |
Perform final reduction on C data, default is yes |
Multiplies two DBCSR matrices using recursive algorithm This routine sets up the multiplication. Specifically, it
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_multrec_type), | intent(inout) | :: | this | |||
type(dbcsr_type), | intent(in) | :: | left |
left DBCSR matrix right DBCSR matrix |
||
type(dbcsr_type), | intent(in) | :: | right |
left DBCSR matrix right DBCSR matrix |
||
integer(kind=int_8), | intent(inout) | :: | flop |
number of effective double-precision floating point operations performed |
||
real(kind=sp), | intent(in), | DIMENSION(:), TARGET | :: | a_norms |
norms of left-matrix blocks norms of right-matrix blocks |
|
real(kind=sp), | intent(in), | DIMENSION(:), TARGET | :: | b_norms |
norms of left-matrix blocks norms of right-matrix blocks |
|
integer, | intent(in), | DIMENSION(:), POINTER | :: | k_sizes |
Sets up recursive multiplication
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_multrec_type), | intent(inout) | :: | this |
Sets up recursive multiplication
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_multrec_type), | intent(inout) | :: | this | |||
integer, | intent(inout), | optional, | DIMENSION(:) | :: | meta_buffer |
Applying in-place filtering on the workspace
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_multrec_type), | intent(inout) | :: | this |
Make the reduction of the 3D layers in the local multrec object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_multrec_type), | intent(inout) | :: | this | |||
integer, | intent(in), | DIMENSION(:) | :: | meta_buffer | ||
type(dbcsr_data_obj), | intent(in) | :: | data_buffer | |||
integer(kind=int_8), | intent(inout) | :: | flop | |||
integer, | intent(in), | DIMENSION(:) | :: | g2l_map_rows | ||
integer, | intent(in), | DIMENSION(:) | :: | g2l_map_cols |
Performs recursive multiplication
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_multrec_type), | intent(inout) | :: | this | |||
type(dbcsr_type), | intent(in) | :: | left | |||
type(dbcsr_type), | intent(in) | :: | right | |||
integer, | intent(in) | :: | mi | |||
integer, | intent(in) | :: | mf | |||
integer, | intent(in) | :: | ni | |||
integer, | intent(in) | :: | nf | |||
integer, | intent(in) | :: | ki | |||
integer, | intent(in) | :: | kf | |||
integer, | intent(in) | :: | ai | |||
integer, | intent(in) | :: | af | |||
integer, | intent(in), | DIMENSION(3, 1:af) | :: | a_index | ||
integer, | intent(in) | :: | bi | |||
integer, | intent(in) | :: | bf | |||
integer, | intent(in), | DIMENSION(3, 1:bf) | :: | b_index | ||
integer, | intent(in) | :: | d |
Packs a globally-indexed array into a locally-indexed array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(inout), | DIMENSION(1:last) | :: | row_i | ||
integer, | intent(inout), | DIMENSION(1:last) | :: | col_i | ||
integer, | intent(in), | DIMENSION(:) | :: | local_rows | ||
integer, | intent(in), | DIMENSION(:) | :: | local_cols | ||
integer, | intent(in) | :: | first | |||
integer, | intent(in) | :: | last |
Gathers the local elements from all data (full_data) for single precision elements.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(in), | DIMENSION(:) | :: | full_data | ||
integer, | intent(in) | :: | nle | |||
integer, | intent(in), | DIMENSION(1:nle) | :: | local_elements | ||
real(kind=sp), | intent(out), | DIMENSION(1:nle) | :: | local_data |
Applying in-place filtering on the workspace. \brief Use Frobenius norm
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real_8), | intent(in) | :: | filter_eps | |||
integer, | intent(inout) | :: | nblks | |||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | rowi | ||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | coli | ||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | blkp | ||
integer, | intent(in), | DIMENSION(:) | :: | rbs | ||
integer, | intent(in), | DIMENSION(:) | :: | cbs | ||
integer, | intent(inout) | :: | nze | |||
real(kind=real_8), | intent(inout), | DIMENSION(:) | :: | DATA |
Applying in-place filtering on the workspace. \brief Use Frobenius norm
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real_8), | intent(in) | :: | filter_eps | |||
integer, | intent(inout) | :: | nblks | |||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | rowi | ||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | coli | ||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | blkp | ||
integer, | intent(in), | DIMENSION(:) | :: | rbs | ||
integer, | intent(in), | DIMENSION(:) | :: | cbs | ||
integer, | intent(inout) | :: | nze | |||
real(kind=real_4), | intent(inout), | DIMENSION(:) | :: | DATA |
Applying in-place filtering on the workspace. \brief Use Frobenius norm
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real_8), | intent(in) | :: | filter_eps | |||
integer, | intent(inout) | :: | nblks | |||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | rowi | ||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | coli | ||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | blkp | ||
integer, | intent(in), | DIMENSION(:) | :: | rbs | ||
integer, | intent(in), | DIMENSION(:) | :: | cbs | ||
integer, | intent(inout) | :: | nze | |||
complex(kind=real_8), | intent(inout), | DIMENSION(:) | :: | DATA |
Applying in-place filtering on the workspace. \brief Use Frobenius norm
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real_8), | intent(in) | :: | filter_eps | |||
integer, | intent(inout) | :: | nblks | |||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | rowi | ||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | coli | ||
integer, | intent(inout), | DIMENSION(1:nblks) | :: | blkp | ||
integer, | intent(in), | DIMENSION(:) | :: | rbs | ||
integer, | intent(in), | DIMENSION(:) | :: | cbs | ||
integer, | intent(inout) | :: | nze | |||
complex(kind=real_4), | intent(inout), | DIMENSION(:) | :: | DATA |