Common variables and routines for the dbcsr matrix-matrix multiplication algorithms. Modification history: - 2016-08 Code organization (Alfio Lazzaro).
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=*), | private, | parameter | :: | moduleN | = | 'dbcsr_mm_common' | |
type(dbcsr_memtype_type_p), | public, | DIMENSION(:), POINTER, SAVE | :: | memtype_product_wm | => | Null() | |
type(dbcsr_mpi_statistics_type), | public, | SAVE | :: | dbcsr_mpi_statistics | |||
integer, | public, | SAVE | :: | num_multiplications | = | 0 | |
real, | public, | SAVE | :: | max_memory | = | 0 | |
real, | public, | parameter | :: | huge_norm | = | HUGE(1.0)**(1.0/3.0) | |
type(dbcsr_memtype_type), | public, | SAVE | :: | memtype_abpanel_1 | |||
type(dbcsr_memtype_type), | public, | SAVE | :: | memtype_abpanel_2 | |||
type(dbcsr_memtype_type), | public, | SAVE | :: | memtype_trsbuffer_1 | |||
type(dbcsr_memtype_type), | public, | SAVE | :: | memtype_trsbuffer_2 | |||
type(dbcsr_memtype_type), | public, | SAVE | :: | memtype_normsbuf | |||
type(dbcsr_memtype_type), | public, | SAVE | :: | memtype_offsetsbuf | |||
type(dbcsr_memtype_type), | public, | SAVE | :: | memtype_nelemsbuf | |||
type(dbcsr_memtype_type), | public, | SAVE | :: | memtype_mpi_buffer | |||
type(dbcsr_memtype_type), | public, | SAVE | :: | memtype_mpi_product | |||
type(acc_stream_type), | public, | SAVE | :: | stream_1 | |||
type(acc_stream_type), | public, | SAVE | :: | stream_2 |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(dbcsr_memtype_type), | public, | POINTER | :: | p | => | Null() | |
integer(kind=int_4), | public, | DIMENSION(64) | :: | padding | = | -1_int_4 |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(dbcsr_mm_multrec_type), | public, | POINTER | :: | p | => | Null() | |
integer(kind=int_4), | public, | DIMENSION(64) | :: | padding |
Guess the size of the product matrix from the A and B sparsities
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | matrix_left | |||
type(dbcsr_type), | intent(in) | :: | matrix_right | |||
type(dbcsr_type), | intent(in) | :: | product_matrix | |||
integer, | intent(in) | :: | left_data_size | |||
integer, | intent(in) | :: | right_data_size | |||
integer, | intent(in) | :: | left_col_nimages | |||
integer, | intent(in) | :: | right_row_nimages | |||
integer, | intent(in) | :: | nthreads |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(inout), | DIMENSION(:) | :: | mpi_statistics | ||
integer, | intent(in) | :: | data_size | |||
integer, | intent(in) | :: | element_size_bytes | |||
integer(kind=int_8), | intent(inout), | optional, | DIMENSION(:, :) | :: | size_breakdown |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix | |||
type(dbcsr_type), | intent(in) | :: | source_matrix | |||
integer, | intent(in), | optional | :: | index_size | ||
integer, | intent(in), | optional | :: | data_size | ||
type(dbcsr_data_obj), | intent(in), | optional | :: | data_buffer | ||
type(dbcsr_memtype_type), | intent(in), | optional | :: | data_memory_type |
Sorts index for recursing.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | mi | |||
integer, | intent(in) | :: | mf | |||
integer, | intent(in) | :: | ni | |||
integer, | intent(in) | :: | nf | |||
integer, | intent(in) | :: | nele | |||
integer, | intent(inout), | DIMENSION(3, 1:nele) | :: | a | ||
integer, | intent(in) | :: | d |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nele | |||
integer, | intent(in), | DIMENSION(3, nele) | :: | a | ||
integer, | intent(out), | DIMENSION(3, nele) | :: | split | ||
integer, | intent(in) | :: | row_or_col | |||
integer, | intent(out) | :: | nlow | |||
integer, | intent(in) | :: | mi | |||
integer, | intent(in) | :: | half |
Enumerate all occurring blocksizes
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | DIMENSION(:), POINTER, CONTIGUOUS | :: | blk_sizes | |||
integer, | intent(in) | :: | max_size | |||
integer, | DIMENSION(:), POINTER, CONTIGUOUS | :: | enum | |||
integer, | DIMENSION(:), POINTER, CONTIGUOUS | :: | rev_enum |
write out a stack for transposing the blocks
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | matrix | |||
type(dbcsr_data_obj), | intent(inout) | :: | trs_stackbuf | |||
integer, | intent(in), | DIMENSION(:), POINTER, CONTIGUOUS | :: | row_blk_sizes | ||
integer, | intent(in), | DIMENSION(:), POINTER, CONTIGUOUS | :: | col_blk_sizes | ||
integer, | intent(in), | DIMENSION(:), POINTER, CONTIGUOUS | :: | row_blk_sizes2enum | ||
integer, | intent(in), | DIMENSION(:), POINTER, CONTIGUOUS | :: | enum2row_blk_sizes | ||
integer, | intent(in), | DIMENSION(:), POINTER, CONTIGUOUS | :: | col_blk_sizes2enum | ||
integer, | intent(in), | DIMENSION(:), POINTER, CONTIGUOUS | :: | enum2col_blk_sizes | ||
logical, | intent(in), | optional | :: | noresize |
calculate norms for a set of blocks in matrix whose row and col sizes are given
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | matrix | |||
real(kind=sp), | intent(out), | DIMENSION(:) | :: | norms | ||
type(dbcsr_data_obj), | intent(inout), | TARGET | :: | normsbuf | ||
type(dbcsr_data_obj), | intent(inout), | TARGET | :: | offsetsbuf | ||
type(dbcsr_data_obj), | intent(inout), | TARGET | :: | nelemsbuf | ||
integer, | intent(in), | DIMENSION(:), POINTER, CONTIGUOUS | :: | row_blk_sizes | ||
integer, | intent(in), | DIMENSION(:), POINTER, CONTIGUOUS | :: | col_blk_sizes |
Calculates per-block norms. Rewritten to be very low-level.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | matrix |
DBCSR matrix for which to calculate norms |
||
real(kind=sp), | intent(out), | DIMENSION(:) | :: | norms |
Block norms |
|
integer, | intent(in), | DIMENSION(:), POINTER, CONTIGUOUS | :: | row_blk_sizes | ||
integer, | intent(in), | DIMENSION(:), POINTER, CONTIGUOUS | :: | col_blk_sizes |
Gathers the local elements from all data (full_data)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:), CONTIGUOUS | :: | full_data |
All elements |
|
integer, | intent(in) | :: | nle |
Number of local elements |
||
integer, | intent(in), | DIMENSION(1:nle) | :: | local_elements |
List of local elements |
|
integer, | intent(out), | DIMENSION(1:nle) | :: | local_data |
Local elements obtained from all elements |
Calculates norms of the entire matrix with minimal overhead.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(out), | DIMENSION(:) | :: | norms | ||
integer, | intent(in) | :: | nblks | |||
integer, | intent(in), | DIMENSION(3, nblks) | :: | blki | ||
integer, | intent(in), | DIMENSION(:) | :: | rbs | ||
integer, | intent(in), | DIMENSION(:) | :: | cbs | ||
real(kind=real_8), | intent(in), | DIMENSION(:) | :: | DATA |
Calculates norms of the entire matrix with minimal overhead.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(out), | DIMENSION(:) | :: | norms | ||
integer, | intent(in) | :: | nblks | |||
integer, | intent(in), | DIMENSION(3, nblks) | :: | blki | ||
integer, | intent(in), | DIMENSION(:) | :: | rbs | ||
integer, | intent(in), | DIMENSION(:) | :: | cbs | ||
real(kind=real_4), | intent(in), | DIMENSION(:) | :: | DATA |
Calculates norms of the entire matrix with minimal overhead.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(out), | DIMENSION(:) | :: | norms | ||
integer, | intent(in) | :: | nblks | |||
integer, | intent(in), | DIMENSION(3, nblks) | :: | blki | ||
integer, | intent(in), | DIMENSION(:) | :: | rbs | ||
integer, | intent(in), | DIMENSION(:) | :: | cbs | ||
complex(kind=real_8), | intent(in), | DIMENSION(:) | :: | DATA |
Calculates norms of the entire matrix with minimal overhead.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(out), | DIMENSION(:) | :: | norms | ||
integer, | intent(in) | :: | nblks | |||
integer, | intent(in), | DIMENSION(3, nblks) | :: | blki | ||
integer, | intent(in), | DIMENSION(:) | :: | rbs | ||
integer, | intent(in), | DIMENSION(:) | :: | cbs | ||
complex(kind=real_4), | intent(in), | DIMENSION(:) | :: | DATA |