First layer of the dbcsr matrix-matrix multiplication. It performs the MPI parallelization according to Cannon's algorithm. Modification history: - 2010-02-23 Moved from dbcsr_operations - 2011-11 Moved parameter-stack processing routines to dbcsr_mm_methods. - 2013-01 reorganized code (Ole Schuett)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=*), | private, | parameter | :: | moduleN | = | 'dbcsr_mm_cannon' | |
logical, | private, | parameter | :: | debug_mod | = | .FALSE. | |
logical, | private, | parameter | :: | careful_mod | = | .FALSE. |
Switches pointers between two matrix sets
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_2d_array_type), | POINTER | :: | set1p | |||
type(dbcsr_2d_array_type), | POINTER | :: | set2p |
Switches pointers between two data areas
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_data_obj), | POINTER | :: | area1p | |||
type(dbcsr_data_obj), | POINTER | :: | area2p |
Make images from the matrix (left or right)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | matrix | |||
type(dbcsr_2d_array_type), | intent(out), | POINTER | :: | m2s | ||
type(dbcsr_imagedistribution_obj), | intent(inout) | :: | rdist | |||
type(dbcsr_imagedistribution_obj), | intent(inout) | :: | dense_rdist | |||
logical, | intent(in) | :: | use_dense_mult | |||
logical, | intent(in) | :: | ab_dense | |||
character(len=1), | intent(in) | :: | predistribute | |||
integer, | intent(in) | :: | f_k | |||
integer, | intent(in) | :: | l_k | |||
integer, | intent(in) | :: | f_row | |||
integer, | intent(in) | :: | l_row | |||
integer, | intent(in) | :: | f_col | |||
integer, | intent(in) | :: | l_col | |||
type(array_i1d_obj), | intent(inout) | :: | row_blk_size | |||
type(array_i1d_obj), | intent(inout) | :: | col_blk_size | |||
type(array_i1d_obj), | intent(in) | :: | k_vmap | |||
type(array_i1d_obj), | intent(in) | :: | m_map | |||
type(array_i1d_obj), | intent(in) | :: | n_map | |||
type(dbcsr_scalar_type), | intent(in), | optional | :: | alpha |
Creates row and column images of a matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | source |
input matrix |
||
type(dbcsr_2d_array_type), | intent(out) | :: | normalized |
image array of the normalized matrix |
||
type(dbcsr_imagedistribution_obj), | intent(in) | :: | target_image_dist |
normalize to this image distribution |
||
character(len=1), | intent(in), | optional | :: | predistribute |
predistribute data for multiplication |
|
logical, | intent(in), | optional | :: | no_copy_data |
try to not merge data at the end |
|
type(dbcsr_scalar_type), | intent(in), | optional | :: | scale_value |
scale with this value |
Makes column-based and row-based images of a matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | ism |
input symmetric matrix |
||
type(dbcsr_2d_array_type), | intent(out) | :: | ums |
normalized matrices |
||
type(dbcsr_imagedistribution_obj), | intent(in) | :: | target_imgdist |
image distribution to normalize to |
||
logical, | intent(in), | optional | :: | desymmetrize |
desymmetrize a symmetric matrix |
|
character(len=1), | intent(in), | optional | :: | predistribute |
predistribute data for multiplication |
|
logical, | intent(in), | optional | :: | no_copy_data |
try to not merge data at the end |
|
type(dbcsr_scalar_type), | intent(in), | optional | :: | scale_value |
scale with this value |
Makes dense matrices for the image matrices.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_2d_array_type), | intent(inout) | :: | images |
current (undense) matrix images, output is the dense matrix images |
||
type(dbcsr_imagedistribution_obj), | intent(inout) | :: | new_rdist |
the new image distribution for dense matrices |
||
type(array_i1d_obj), | intent(in) | :: | row_map |
mapping of current (undense) rows to dense rows mapping of current (undense) columns to dense columns |
||
type(array_i1d_obj), | intent(in) | :: | col_map |
mapping of current (undense) rows to dense rows mapping of current (undense) columns to dense columns |
||
logical, | intent(in) | :: | join_cols |
make columns dense, default is yes make rows dense, default is yes |
||
logical, | intent(in) | :: | join_rows |
make columns dense, default is yes make rows dense, default is yes |
||
type(dbcsr_type), | intent(in) | :: | new_template |
template dense matrix for creating image matrices |
Multiplies two DBCSR matrices
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_2d_array_type), | POINTER | :: | left_set |
set of imaged left matrices set of imaged right matrices |
||
type(dbcsr_2d_array_type), | POINTER | :: | right_set |
set of imaged left matrices set of imaged right matrices |
||
type(dbcsr_type), | intent(inout) | :: | product_matrix |
DBCSR product matrix |
||
logical, | intent(in), | optional | :: | retain_sparsity |
retain the sparsity of the existing product matrix; default is no |
|
real(kind=real_8), | intent(in), | optional | :: | filter_eps | ||
integer(kind=int_8), | intent(out) | :: | flop |
effective flop |
||
logical, | intent(in) | :: | keep_product_data |
Multiplies two DBCSR matrices
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_2d_array_type), | POINTER | :: | left_set |
set of imaged left matrices set of imaged right matrices |
||
type(dbcsr_2d_array_type), | POINTER | :: | right_set |
set of imaged left matrices set of imaged right matrices |
||
type(dbcsr_type), | intent(inout) | :: | product_matrix |
DBCSR product matrix |
||
logical, | intent(in), | optional | :: | retain_sparsity |
retain the sparsity of the existing product matrix; default is no |
|
real(kind=real_8), | intent(in), | optional | :: | filter_eps | ||
integer(kind=int_8), | intent(out) | :: | flop |
effective flop |
||
logical, | intent(in) | :: | keep_product_data |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_2d_array_type), | intent(out) | :: | buffer_set | |||
integer, | intent(in) | :: | buff_nrows | |||
integer, | intent(in) | :: | buff_ncols | |||
type(dbcsr_type), | intent(in) | :: | source_matrix | |||
integer, | intent(in) | :: | index_size | |||
integer, | intent(in), | optional | :: | data_size |
Enlarge left_set and right_set to hold any a/b-panel. left_set and right_set are created by make_images to hold the a/b-panels used for the initial cannon-tick. This routine ensures that these buffers can hold any a/b-panel occurring during a matrix multiply and makes them therefore suitable as buffers for the entire cannon algorithm. This saves memory since no separate buffers for the first cannon-tick have to be allocated.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_2d_array_type), | intent(inout) | :: | buffer_set | |||
integer, | intent(in) | :: | index_size | |||
integer, | intent(in) | :: | data_size |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_2d_array_type), | intent(inout) | :: | matrix_set | |||
integer, | intent(in) | :: | n_rows | |||
integer, | intent(in) | :: | n_cols |
Used to thunk a call to rec_sort_index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | m | |||
integer, | intent(in) | :: | n | |||
integer, | intent(in) | :: | nblks | |||
integer, | intent(inout), | DIMENSION(3, 1:nblks) | :: | idx |
Switches pointers between two matrix sets
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_2d_array_type), | POINTER | :: | set1p | |||
type(dbcsr_2d_array_type), | POINTER | :: | set2p |
Switches pointers between two data areas
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_data_obj), | POINTER | :: | area1p | |||
type(dbcsr_data_obj), | POINTER | :: | area2p |
Prepare buffers for multiplications
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(in) | :: | negate_real | |||
logical, | intent(in) | :: | negate_imaginary | |||
type(dbcsr_iterator), | intent(inout) | :: | iter | |||
integer, | intent(inout) | :: | row | |||
integer, | intent(inout) | :: | col | |||
integer, | intent(inout) | :: | blk | |||
integer, | intent(inout) | :: | blk_p | |||
integer, | intent(inout) | :: | bp | |||
integer, | intent(inout) | :: | row_size | |||
integer, | intent(inout) | :: | col_size | |||
integer, | intent(inout) | :: | nze | |||
integer, | intent(in) | :: | nsymmetries | |||
integer, | intent(inout) | :: | symmetry_i | |||
integer, | intent(inout) | :: | stored_row | |||
integer, | intent(inout) | :: | stored_col | |||
integer, | intent(inout) | :: | tr_row_size | |||
integer, | intent(inout) | :: | tr_col_size | |||
logical, | intent(inout) | :: | tr | |||
integer, | intent(inout) | :: | row_img | |||
integer, | intent(inout) | :: | col_img | |||
integer, | intent(in) | :: | nrow_images | |||
integer, | intent(in) | :: | ncol_images | |||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | row_img_dist | ||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | col_img_dist | ||
character(len=1), | intent(in) | :: | predist_type_fwd | |||
integer, | intent(in), | DIMENSION(:, :), CONTIGUOUS, POINTER | :: | blacs2mpi | ||
type(dbcsr_imagedistribution_obj), | intent(in) | :: | target_imgdist | |||
integer, | intent(inout) | :: | prow | |||
integer, | intent(inout) | :: | pcol | |||
integer, | intent(inout) | :: | rowi | |||
integer, | intent(inout) | :: | coli | |||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | row_dist | ||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | col_dist | ||
integer, | intent(inout) | :: | dst_p | |||
integer, | intent(inout) | :: | sm_pos | |||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | myt_smp | ||
integer, | intent(in) | :: | metalen | |||
integer, | intent(inout) | :: | sd_pos | |||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | myt_sdp | ||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | send_meta | ||
integer, | intent(in), | DIMENSION(:), ALLOCATABLE | :: | sd_disp | ||
real(kind=real_8), | intent(in), | DIMENSION(:), CONTIGUOUS | :: | data_area | ||
type(dbcsr_data_obj), | intent(inout) | :: | send_data_area | |||
type(dbcsr_scalar_type), | intent(in) | :: | scale_neg_one | |||
type(dbcsr_scalar_type), | intent(in), | optional | :: | scale_value |
Prepare buffers for multiplications
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(in) | :: | negate_real | |||
logical, | intent(in) | :: | negate_imaginary | |||
type(dbcsr_iterator), | intent(inout) | :: | iter | |||
integer, | intent(inout) | :: | row | |||
integer, | intent(inout) | :: | col | |||
integer, | intent(inout) | :: | blk | |||
integer, | intent(inout) | :: | blk_p | |||
integer, | intent(inout) | :: | bp | |||
integer, | intent(inout) | :: | row_size | |||
integer, | intent(inout) | :: | col_size | |||
integer, | intent(inout) | :: | nze | |||
integer, | intent(in) | :: | nsymmetries | |||
integer, | intent(inout) | :: | symmetry_i | |||
integer, | intent(inout) | :: | stored_row | |||
integer, | intent(inout) | :: | stored_col | |||
integer, | intent(inout) | :: | tr_row_size | |||
integer, | intent(inout) | :: | tr_col_size | |||
logical, | intent(inout) | :: | tr | |||
integer, | intent(inout) | :: | row_img | |||
integer, | intent(inout) | :: | col_img | |||
integer, | intent(in) | :: | nrow_images | |||
integer, | intent(in) | :: | ncol_images | |||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | row_img_dist | ||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | col_img_dist | ||
character(len=1), | intent(in) | :: | predist_type_fwd | |||
integer, | intent(in), | DIMENSION(:, :), CONTIGUOUS, POINTER | :: | blacs2mpi | ||
type(dbcsr_imagedistribution_obj), | intent(in) | :: | target_imgdist | |||
integer, | intent(inout) | :: | prow | |||
integer, | intent(inout) | :: | pcol | |||
integer, | intent(inout) | :: | rowi | |||
integer, | intent(inout) | :: | coli | |||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | row_dist | ||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | col_dist | ||
integer, | intent(inout) | :: | dst_p | |||
integer, | intent(inout) | :: | sm_pos | |||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | myt_smp | ||
integer, | intent(in) | :: | metalen | |||
integer, | intent(inout) | :: | sd_pos | |||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | myt_sdp | ||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | send_meta | ||
integer, | intent(in), | DIMENSION(:), ALLOCATABLE | :: | sd_disp | ||
real(kind=real_4), | intent(in), | DIMENSION(:), CONTIGUOUS | :: | data_area | ||
type(dbcsr_data_obj), | intent(inout) | :: | send_data_area | |||
type(dbcsr_scalar_type), | intent(in) | :: | scale_neg_one | |||
type(dbcsr_scalar_type), | intent(in), | optional | :: | scale_value |
Prepare buffers for multiplications
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(in) | :: | negate_real | |||
logical, | intent(in) | :: | negate_imaginary | |||
type(dbcsr_iterator), | intent(inout) | :: | iter | |||
integer, | intent(inout) | :: | row | |||
integer, | intent(inout) | :: | col | |||
integer, | intent(inout) | :: | blk | |||
integer, | intent(inout) | :: | blk_p | |||
integer, | intent(inout) | :: | bp | |||
integer, | intent(inout) | :: | row_size | |||
integer, | intent(inout) | :: | col_size | |||
integer, | intent(inout) | :: | nze | |||
integer, | intent(in) | :: | nsymmetries | |||
integer, | intent(inout) | :: | symmetry_i | |||
integer, | intent(inout) | :: | stored_row | |||
integer, | intent(inout) | :: | stored_col | |||
integer, | intent(inout) | :: | tr_row_size | |||
integer, | intent(inout) | :: | tr_col_size | |||
logical, | intent(inout) | :: | tr | |||
integer, | intent(inout) | :: | row_img | |||
integer, | intent(inout) | :: | col_img | |||
integer, | intent(in) | :: | nrow_images | |||
integer, | intent(in) | :: | ncol_images | |||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | row_img_dist | ||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | col_img_dist | ||
character(len=1), | intent(in) | :: | predist_type_fwd | |||
integer, | intent(in), | DIMENSION(:, :), CONTIGUOUS, POINTER | :: | blacs2mpi | ||
type(dbcsr_imagedistribution_obj), | intent(in) | :: | target_imgdist | |||
integer, | intent(inout) | :: | prow | |||
integer, | intent(inout) | :: | pcol | |||
integer, | intent(inout) | :: | rowi | |||
integer, | intent(inout) | :: | coli | |||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | row_dist | ||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | col_dist | ||
integer, | intent(inout) | :: | dst_p | |||
integer, | intent(inout) | :: | sm_pos | |||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | myt_smp | ||
integer, | intent(in) | :: | metalen | |||
integer, | intent(inout) | :: | sd_pos | |||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | myt_sdp | ||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | send_meta | ||
integer, | intent(in), | DIMENSION(:), ALLOCATABLE | :: | sd_disp | ||
complex(kind=real_8), | intent(in), | DIMENSION(:), CONTIGUOUS | :: | data_area | ||
type(dbcsr_data_obj), | intent(inout) | :: | send_data_area | |||
type(dbcsr_scalar_type), | intent(in) | :: | scale_neg_one | |||
type(dbcsr_scalar_type), | intent(in), | optional | :: | scale_value |
Prepare buffers for multiplications
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(in) | :: | negate_real | |||
logical, | intent(in) | :: | negate_imaginary | |||
type(dbcsr_iterator), | intent(inout) | :: | iter | |||
integer, | intent(inout) | :: | row | |||
integer, | intent(inout) | :: | col | |||
integer, | intent(inout) | :: | blk | |||
integer, | intent(inout) | :: | blk_p | |||
integer, | intent(inout) | :: | bp | |||
integer, | intent(inout) | :: | row_size | |||
integer, | intent(inout) | :: | col_size | |||
integer, | intent(inout) | :: | nze | |||
integer, | intent(in) | :: | nsymmetries | |||
integer, | intent(inout) | :: | symmetry_i | |||
integer, | intent(inout) | :: | stored_row | |||
integer, | intent(inout) | :: | stored_col | |||
integer, | intent(inout) | :: | tr_row_size | |||
integer, | intent(inout) | :: | tr_col_size | |||
logical, | intent(inout) | :: | tr | |||
integer, | intent(inout) | :: | row_img | |||
integer, | intent(inout) | :: | col_img | |||
integer, | intent(in) | :: | nrow_images | |||
integer, | intent(in) | :: | ncol_images | |||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | row_img_dist | ||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | col_img_dist | ||
character(len=1), | intent(in) | :: | predist_type_fwd | |||
integer, | intent(in), | DIMENSION(:, :), CONTIGUOUS, POINTER | :: | blacs2mpi | ||
type(dbcsr_imagedistribution_obj), | intent(in) | :: | target_imgdist | |||
integer, | intent(inout) | :: | prow | |||
integer, | intent(inout) | :: | pcol | |||
integer, | intent(inout) | :: | rowi | |||
integer, | intent(inout) | :: | coli | |||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | row_dist | ||
integer, | intent(in), | DIMENSION(:), CONTIGUOUS, POINTER | :: | col_dist | ||
integer, | intent(inout) | :: | dst_p | |||
integer, | intent(inout) | :: | sm_pos | |||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | myt_smp | ||
integer, | intent(in) | :: | metalen | |||
integer, | intent(inout) | :: | sd_pos | |||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | myt_sdp | ||
integer, | intent(inout), | DIMENSION(:), ALLOCATABLE | :: | send_meta | ||
integer, | intent(in), | DIMENSION(:), ALLOCATABLE | :: | sd_disp | ||
complex(kind=real_4), | intent(in), | DIMENSION(:), CONTIGUOUS | :: | data_area | ||
type(dbcsr_data_obj), | intent(inout) | :: | send_data_area | |||
type(dbcsr_scalar_type), | intent(in) | :: | scale_neg_one | |||
type(dbcsr_scalar_type), | intent(in), | optional | :: | scale_value |