Third layer of the dbcsr matrix-matrix multiplication. It collects the full matrix blocks, which need to be multiplied, and stores their parameters in various stacks. After a certain amount of parameters is collected it dispatches the filled stacks to either the CPU or the accelerator device. 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_csr' | |
logical, | private, | parameter | :: | debug_mod | = | .FALSE. | |
logical, | private, | parameter | :: | careful_mod | = | .FALSE. | |
integer, | private, | parameter | :: | max_stack_block_size | = | HUGE(INT(0)) |
max_stack_block_size The maximal block size to be specially treated. |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(hash_table_type), | private, | DIMENSION(:), POINTER | :: | c_hashes | => | Null() | |
integer, | private | :: | nm_stacks | = | -1 | ||
integer, | private | :: | nn_stacks | = | -1 | ||
integer, | private | :: | nk_stacks | = | -1 | ||
integer(kind=int_4), | private, | DIMENSION(:), POINTER | :: | m_size_maps | => | Null() | |
integer(kind=int_4), | private, | DIMENSION(:), POINTER | :: | n_size_maps | => | Null() | |
integer(kind=int_4), | private, | DIMENSION(:), POINTER | :: | k_size_maps | => | Null() | |
integer, | private | :: | max_m | = | -1 | ||
integer, | private | :: | max_n | = | -1 | ||
integer, | private | :: | max_k | = | -1 | ||
integer, | private | :: | m_size_maps_size | = | -1 | ||
integer, | private | :: | n_size_maps_size | = | -1 | ||
integer, | private | :: | k_size_maps_size | = | -1 | ||
integer(kind=int_1), | private, | DIMENSION(:, :, :), POINTER | :: | stack_map | => | Null() | |
type(stack_descriptor_type), | private, | DIMENSION(:), POINTER | :: | stacks_descr | => | Null() | |
type(dbcsr_work_type), | private, | POINTER | :: | product_wm | => | Null() | |
integer, | private, | DIMENSION(:, :, :), POINTER | :: | stacks_data | => | Null() | |
integer, | private, | DIMENSION(:), POINTER | :: | stacks_fillcount | => | Null() | |
type(dbcsr_mm_sched_type), | private | :: | sched | = | dbcsr_mm_sched_type() | ||
logical, | private | :: | keep_product_data | = | .FALSE. |
Types needed for the hashtable.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | c | = | 0 | ||
integer, | public | :: | p | = | 0 |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(ele_type), | public, | DIMENSION(:), POINTER | :: | table | |||
integer, | public | :: | nele | = | 0 | ||
integer, | public | :: | nmax | = | 0 | ||
integer, | public | :: | prime | = | 0 |
Determines whether a transpose must be applied
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | row |
The absolute matrix row. The absolute matrix column. |
||
integer, | intent(in) | :: | column |
The absolute matrix row. The absolute matrix column. |
finds a prime equal or larger than i, needed at creation
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | i |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(hash_table_type), | intent(in) | :: | hash_table | |||
integer, | intent(in) | :: | c |
Initialize the library
Finalize the library
A wrapper around dbcsr_mm_csr_multiply_low to avoid expensive dereferencings.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_csr_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) | :: | bi | |||
integer, | intent(in) | :: | bf | |||
integer, | intent(inout), | DIMENSION(:) | :: | m_sizes | ||
integer, | intent(inout), | DIMENSION(:) | :: | n_sizes | ||
integer, | intent(inout), | DIMENSION(:) | :: | k_sizes | ||
integer, | intent(inout), | DIMENSION(:) | :: | c_local_rows | ||
integer, | intent(inout), | DIMENSION(:) | :: | c_local_cols | ||
logical, | intent(inout) | :: | c_has_symmetry | |||
logical, | intent(inout) | :: | keep_sparsity | |||
logical, | intent(inout) | :: | use_eps | |||
real(kind=sp), | DIMENSION(:) | :: | row_max_epss | |||
integer(kind=int_8), | intent(inout) | :: | flop | |||
integer, | intent(in), | DIMENSION(1:3, 1:af) | :: | a_index | ||
integer, | intent(in), | DIMENSION(1:3, 1:bf) | :: | b_index | ||
real(kind=sp), | DIMENSION(:), POINTER | :: | a_norms | |||
real(kind=sp), | DIMENSION(:), POINTER | :: | b_norms |
Performs multiplication of smaller submatrices.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_csr_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) | :: | ki | |||
integer, | intent(in) | :: | kf | |||
integer, | intent(in) | :: | ai | |||
integer, | intent(in) | :: | af | |||
integer, | intent(in) | :: | bi | |||
integer, | intent(in) | :: | bf | |||
integer, | intent(inout), | DIMENSION(:) | :: | c_row_i | ||
integer, | intent(inout), | DIMENSION(:) | :: | c_col_i | ||
integer, | intent(inout), | DIMENSION(:) | :: | c_blk_p | ||
integer, | intent(inout) | :: | lastblk | |||
integer, | intent(inout) | :: | datasize | |||
integer, | intent(in), | DIMENSION(:) | :: | m_sizes | ||
integer, | intent(in), | DIMENSION(:) | :: | n_sizes | ||
integer, | intent(in), | DIMENSION(:) | :: | k_sizes | ||
integer, | intent(in), | DIMENSION(:) | :: | c_local_rows | ||
integer, | intent(in), | DIMENSION(:) | :: | c_local_cols | ||
logical, | intent(in) | :: | c_has_symmetry | |||
logical, | intent(in) | :: | keep_sparsity | |||
logical, | intent(in) | :: | use_eps | |||
real(kind=sp), | DIMENSION(:) | :: | row_max_epss | |||
integer(kind=int_8), | intent(inout) | :: | flop | |||
integer(kind=int_4), | intent(in), | DIMENSION(0:row_size_maps_size - 1) | :: | row_size_maps | ||
integer(kind=int_4), | intent(in), | DIMENSION(0:col_size_maps_size - 1) | :: | col_size_maps | ||
integer(kind=int_4), | intent(in), | DIMENSION(0:k_size_maps_size - 1) | :: | k_size_maps | ||
integer, | intent(in) | :: | row_size_maps_size | |||
integer, | intent(in) | :: | col_size_maps_size | |||
integer, | intent(in) | :: | k_size_maps_size | |||
integer, | intent(in) | :: | nm_stacks | |||
integer, | intent(in) | :: | nn_stacks | |||
integer, | intent(in) | :: | nk_stacks | |||
integer(kind=int_1), | intent(in), | DIMENSION(nn_stacks + 1, nk_stacks + 1, nm_stacks + 1) | :: | stack_map | ||
integer, | intent(inout), | DIMENSION(:, :, :) | :: | stacks_data | ||
integer, | intent(inout), | DIMENSION(:) | :: | stacks_fillcount | ||
type(hash_table_type), | intent(inout), | DIMENSION(:) | :: | c_hashes | ||
integer, | intent(in), | DIMENSION(1:3, 1:af) | :: | a_index | ||
integer, | intent(in), | DIMENSION(1:3, 1:bf) | :: | b_index | ||
real(kind=sp), | DIMENSION(:), POINTER | :: | a_norms | |||
real(kind=sp), | DIMENSION(:), POINTER | :: | b_norms |
Initializes a multiplication cycle for new set of C-blocks.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_csr_type), | intent(inout) | :: | this | |||
type(dbcsr_type), | intent(in), | optional | :: | left | ||
type(dbcsr_type), | intent(in), | optional | :: | right | ||
type(dbcsr_type), | intent(inout) | :: | product | |||
integer, | DIMENSION(:), POINTER | :: | m_sizes | |||
integer, | DIMENSION(:), POINTER | :: | n_sizes | |||
integer, | intent(in) | :: | block_estimate | |||
integer, | intent(in), | DIMENSION(:) | :: | right_row_blk_size | ||
integer, | optional | :: | nlayers | |||
logical, | intent(in) | :: | keep_product_data |
Fills row hashtable from an existing matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(hash_table_type), | intent(inout), | DIMENSION(:) | :: | hashes | ||
type(dbcsr_type), | intent(in) | :: | matrix | |||
integer | :: | block_estimate |
guess for the number of blocks in the product matrix, can be zero |
|||
integer, | intent(in), | DIMENSION(:) | :: | row_map | ||
integer, | intent(in), | DIMENSION(:) | :: | col_map |
Finalizes a multiplication cycle for a set of C-blocks.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_csr_type), | intent(inout) | :: | this |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_csr_type), | intent(inout) | :: | this |
Make the reduction of the 3D layers in the local csr object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_csr_type), | intent(inout) | :: | this | |||
integer, | intent(in), | DIMENSION(:), TARGET | :: | meta_buffer | ||
type(dbcsr_data_obj), | intent(in) | :: | data_buffer | |||
integer(kind=int_8), | intent(inout) | :: | flop | |||
integer, | intent(in), | DIMENSION(:) | :: | m_sizes | ||
integer, | intent(in), | DIMENSION(:) | :: | n_sizes | ||
integer, | intent(in), | DIMENSION(:) | :: | g2l_map_rows | ||
integer, | intent(in), | DIMENSION(:) | :: | g2l_map_cols | ||
integer, | intent(in) | :: | original_lastblk | |||
logical, | intent(in) | :: | keep_sparsity |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_csr_type), | intent(inout) | :: | this | |||
type(dbcsr_type), | intent(in) | :: | left | |||
type(dbcsr_type), | intent(in) | :: | right |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_mm_csr_type), | intent(inout) | :: | this | |||
type(dbcsr_type), | intent(in) | :: | left | |||
type(dbcsr_type), | intent(in) | :: | right | |||
logical, | intent(in), | optional | :: | purge |
Builds and sorts a CSR index from a list index.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | mi | |||
integer, | intent(in) | :: | mf | |||
integer, | intent(in) | :: | ai | |||
integer, | intent(in) | :: | af | |||
integer, | intent(out), | DIMENSION(mi:mf + 1) | :: | row_p | ||
integer, | intent(out), | DIMENSION(2, 1:af - ai + 1) | :: | blk_info | ||
integer, | intent(in), | DIMENSION(3, 1:af) | :: | list_index | ||
integer, | intent(in) | :: | nnorms | |||
real(kind=sp), | intent(out), | DIMENSION(1:af - ai + 1) | :: | csr_norms | ||
real(kind=sp), | intent(in), | DIMENSION(:) | :: | list_norms |
create a hash_table of given initial size. the hash table will expand as needed (but this requires rehashing)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(hash_table_type) | :: | hash_table | ||||
integer, | intent(in) | :: | table_size |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(hash_table_type) | :: | hash_table |
add a pair (c,p) to the hash table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(hash_table_type), | intent(inout) | :: | hash_table | |||
integer, | intent(in) | :: | c |
this value is being hashed this is being stored |
||
integer, | intent(in) | :: | p |
this value is being hashed this is being stored |