(git:6a2e663)
|
DBCSR operations in CP2K. More...
Data Types | |
interface | dbcsr_allocate_matrix_set |
interface | dbcsr_deallocate_matrix_set |
Functions/Subroutines | |
subroutine, public | copy_fm_to_dbcsr (fm, matrix, keep_sparsity) |
Copy a BLACS matrix to a dbcsr matrix. More... | |
subroutine, public | copy_fm_to_dbcsr_bc (fm, bc_mat) |
Copy a BLACS matrix to a dbcsr matrix with a special block-cyclic distribution, which requires no complete redistribution. More... | |
subroutine, public | copy_dbcsr_to_fm (matrix, fm) |
Copy a DBCSR matrix to a BLACS matrix. More... | |
subroutine, public | copy_dbcsr_to_fm_bc (bc_mat, fm) |
Copy a DBCSR_BLACS matrix to a BLACS matrix. More... | |
subroutine, public | copy_cfm_to_dbcsr (fm, matrix, keep_sparsity) |
Copy a BLACS matrix to a dbcsr matrix. More... | |
subroutine, public | copy_dbcsr_to_cfm (matrix, fm) |
Copy a DBCSR matrix to a BLACS matrix. More... | |
subroutine, public | dbcsr_copy_columns_hack (matrix_b, matrix_a, ncol, source_start, target_start, para_env, blacs_env) |
hack for dbcsr_copy_columns More... | |
subroutine, public | cp_dbcsr_dist2d_to_dist (dist2d, dist) |
Creates a DBCSR distribution from a distribution_2d. More... | |
subroutine, public | dbcsr_multiply_local (matrix_a, vec_b, vec_c, ncol, alpha) |
multiply a dbcsr with a replicated array c = alpha_scalar * A (dbscr) * b + c More... | |
subroutine, public | cp_dbcsr_sm_fm_multiply (matrix, fm_in, fm_out, ncol, alpha, beta) |
multiply a dbcsr with a fm matrix More... | |
subroutine, public | cp_dbcsr_plus_fm_fm_t (sparse_matrix, matrix_v, matrix_g, ncol, alpha, keep_sparsity, symmetry_mode) |
performs the multiplication sparse_matrix+dense_mat*dens_mat^T if matrix_g is not explicitly given, matrix_v^T will be used this can be important to save the necessary redistribute for a different matrix_g and increase performance. More... | |
subroutine, public | cp_fm_to_dbcsr_row_template (matrix, fm_in, template) |
Utility function to copy a specially shaped fm to dbcsr_matrix The result matrix will be the matrix in dbcsr format with the row blocks sizes according to the block_sizes of the template and the col blocks sizes evenly blocked with the internal dbcsr conversion size (32 is the current default) More... | |
subroutine, public | cp_dbcsr_m_by_n_from_template (matrix, template, m, n, sym, data_type) |
Utility function to create an arbitrary shaped dbcsr matrix with the same processor grid as the template matrix both row sizes and col sizes are evenly blocked with the internal dbcsr_conversion size (32 is the current default) More... | |
subroutine, public | cp_dbcsr_m_by_n_from_row_template (matrix, template, n, sym, data_type) |
Utility function to create dbcsr matrix, m x n matrix (n arbitrary) with the same processor grid and row distribution as the template matrix col sizes are evenly blocked with the internal dbcsr_conversion size (32 is the current default) More... | |
subroutine, public | dbcsr_create_dist_r_unrot (dist_right, dist_left, ncolumns, right_col_blk_sizes) |
Creates a new distribution for the right matrix in a matrix multiplication with unrotated grid. More... | |
Variables | |
logical, parameter | debug_mod = .FALSE. |
integer, save, public | max_elements_per_block = 32 |
DBCSR operations in CP2K.
Modification history:
subroutine, public cp_dbcsr_operations::copy_fm_to_dbcsr | ( | type(cp_fm_type), intent(in) | fm, |
type(dbcsr_type), intent(inout) | matrix, | ||
logical, intent(in), optional | keep_sparsity | ||
) |
Copy a BLACS matrix to a dbcsr matrix.
real_matrix=beta*real_matrix+alpha*fm beta defaults to 0, alpha to 1
[in] | fm | full matrix |
[out] | matrix | DBCSR matrix |
[in] | keep_sparsity | (optional) retains the sparsity of the input matrix |
Definition at line 117 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::copy_fm_to_dbcsr_bc | ( | type(cp_fm_type), intent(in) | fm, |
type(dbcsr_type), intent(inout) | bc_mat | ||
) |
Copy a BLACS matrix to a dbcsr matrix with a special block-cyclic distribution, which requires no complete redistribution.
fm | ... |
bc_mat | ... |
Definition at line 142 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::copy_dbcsr_to_fm | ( | type(dbcsr_type), intent(in) | matrix, |
type(cp_fm_type), intent(in) | fm | ||
) |
Copy a DBCSR matrix to a BLACS matrix.
[in] | matrix | DBCSR matrix |
[out] | fm | full matrix |
Definition at line 207 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::copy_dbcsr_to_fm_bc | ( | type(dbcsr_type), intent(in) | bc_mat, |
type(cp_fm_type), intent(in) | fm | ||
) |
Copy a DBCSR_BLACS matrix to a BLACS matrix.
bc_mat | DBCSR matrix | |
[out] | fm | full matrix |
Definition at line 269 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::copy_cfm_to_dbcsr | ( | type(cp_cfm_type), intent(in) | fm, |
type(dbcsr_type), intent(inout) | matrix, | ||
logical, intent(in), optional | keep_sparsity | ||
) |
Copy a BLACS matrix to a dbcsr matrix.
real_matrix=beta*real_matrix+alpha*fm beta defaults to 0, alpha to 1
[in] | fm | full matrix |
[out] | matrix | DBCSR matrix |
[in] | keep_sparsity | (optional) retains the sparsity of the input matrix |
Definition at line 318 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::copy_dbcsr_to_cfm | ( | type(dbcsr_type), intent(in) | matrix, |
type(cp_cfm_type), intent(in) | fm | ||
) |
Copy a DBCSR matrix to a BLACS matrix.
[in] | matrix | DBCSR matrix |
[out] | fm | full matrix |
Definition at line 407 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::dbcsr_copy_columns_hack | ( | type(dbcsr_type), intent(inout) | matrix_b, |
type(dbcsr_type), intent(in) | matrix_a, | ||
integer, intent(in) | ncol, | ||
integer, intent(in) | source_start, | ||
integer, intent(in) | target_start, | ||
type(mp_para_env_type), pointer | para_env, | ||
type(cp_blacs_env_type), pointer | blacs_env | ||
) |
hack for dbcsr_copy_columns
matrix_b | ... |
matrix_a | ... |
ncol | ... |
source_start | ... |
target_start | ... |
para_env | ... |
blacs_env | ... |
Definition at line 565 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::cp_dbcsr_dist2d_to_dist | ( | type(distribution_2d_type), intent(in), target | dist2d, |
type(dbcsr_distribution_type), intent(out) | dist | ||
) |
Creates a DBCSR distribution from a distribution_2d.
[in] | dist2d | distribution_2d |
[out] | dist | DBCSR distribution |
Definition at line 610 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::dbcsr_multiply_local | ( | type(dbcsr_type), intent(in) | matrix_a, |
real(dp), dimension(:, :), intent(in) | vec_b, | ||
real(dp), dimension(:, :), intent(inout) | vec_c, | ||
integer, intent(in), optional | ncol, | ||
real(dp), intent(in), optional | alpha | ||
) |
multiply a dbcsr with a replicated array c = alpha_scalar * A (dbscr) * b + c
[in] | matrix_a | DBSCR matrxx |
[in] | vec_b | vectors b |
[in,out] | vec_c | vectors c |
[in] | ncol | nbr of columns |
[in] | alpha | alpha |
Definition at line 650 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::cp_dbcsr_sm_fm_multiply | ( | type(dbcsr_type), intent(in) | matrix, |
type(cp_fm_type), intent(in) | fm_in, | ||
type(cp_fm_type), intent(in) | fm_out, | ||
integer, intent(in) | ncol, | ||
real(dp), intent(in), optional | alpha, | ||
real(dp), intent(in), optional | beta | ||
) |
multiply a dbcsr with a fm matrix
For backwards compatibility with BLAS XGEMM, this routine supports the multiplication of matrices with incompatible dimensions.
[in] | matrix | DBCSR matrix |
fm_in | full matrix | |
fm_out | full matrix | |
[in] | ncol | nbr of columns |
[in] | alpha | alpha |
[in] | beta | beta |
Definition at line 743 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::cp_dbcsr_plus_fm_fm_t | ( | type(dbcsr_type), intent(inout) | sparse_matrix, |
type(cp_fm_type), intent(in) | matrix_v, | ||
type(cp_fm_type), intent(in), optional | matrix_g, | ||
integer, intent(in) | ncol, | ||
real(kind=dp), intent(in), optional | alpha, | ||
logical, intent(in), optional | keep_sparsity, | ||
integer, intent(in), optional | symmetry_mode | ||
) |
performs the multiplication sparse_matrix+dense_mat*dens_mat^T if matrix_g is not explicitly given, matrix_v^T will be used this can be important to save the necessary redistribute for a different matrix_g and increase performance.
sparse_matrix | ... |
matrix_v | ... |
matrix_g | ... |
ncol | ... |
alpha | ... |
keep_sparsity | Determines if the sparsity of sparse_matrix is retained by default it is TRUE |
symmetry_mode | There are the following modes 1: sparse_matrix += 0.5*alpha*(v*g^T+g^T*v) (symmetric update) -1: sparse_matrix += 0.5*alpha*(v*g^T-g^T*v) (skewsymmetric update) else: sparse_matrix += alpha*v*g^T (no symmetry, default) saves some redistribution steps |
Definition at line 886 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::cp_fm_to_dbcsr_row_template | ( | type(dbcsr_type), intent(inout) | matrix, |
type(cp_fm_type), intent(in) | fm_in, | ||
type(dbcsr_type), intent(in) | template | ||
) |
Utility function to copy a specially shaped fm to dbcsr_matrix The result matrix will be the matrix in dbcsr format with the row blocks sizes according to the block_sizes of the template and the col blocks sizes evenly blocked with the internal dbcsr conversion size (32 is the current default)
matrix | ... |
fm_in | ... |
template | ... |
Definition at line 1069 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::cp_dbcsr_m_by_n_from_template | ( | type(dbcsr_type), intent(inout) | matrix, |
type(dbcsr_type), intent(inout) | template, | ||
integer, intent(in) | m, | ||
integer, intent(in) | n, | ||
character, intent(in), optional | sym, | ||
integer, intent(in), optional | data_type | ||
) |
Utility function to create an arbitrary shaped dbcsr matrix with the same processor grid as the template matrix both row sizes and col sizes are evenly blocked with the internal dbcsr_conversion size (32 is the current default)
matrix | dbcsr matrix to be created |
template | template dbcsr matrix giving its mp_env |
m | global row size of output matrix |
n | global col size of output matrix |
sym | ... |
data_type | ... |
Definition at line 1104 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::cp_dbcsr_m_by_n_from_row_template | ( | type(dbcsr_type), intent(inout) | matrix, |
type(dbcsr_type), intent(inout) | template, | ||
integer | n, | ||
character, optional | sym, | ||
integer, optional | data_type | ||
) |
Utility function to create dbcsr matrix, m x n matrix (n arbitrary) with the same processor grid and row distribution as the template matrix col sizes are evenly blocked with the internal dbcsr_conversion size (32 is the current default)
matrix | dbcsr matrix to be created |
template | template dbcsr matrix giving its mp_env |
n | global col size of output matrix |
sym | ... |
data_type | ... |
Definition at line 1155 of file cp_dbcsr_operations.F.
subroutine, public cp_dbcsr_operations::dbcsr_create_dist_r_unrot | ( | type(dbcsr_distribution_type), intent(out) | dist_right, |
type(dbcsr_distribution_type), intent(in) | dist_left, | ||
integer, intent(in) | ncolumns, | ||
integer, dimension(:), intent(out), pointer | right_col_blk_sizes | ||
) |
Creates a new distribution for the right matrix in a matrix multiplication with unrotated grid.
[out] | dist_right | new distribution for the right matrix |
[in] | dist_left | the distribution of the left matrix |
[in] | ncolumns | number of columns in right matrix |
[out] | right_col_blk_sizes | sizes of blocks in the created column |
Definition at line 1301 of file cp_dbcsr_operations.F.
logical, parameter cp_dbcsr_operations::debug_mod = .FALSE. |
Definition at line 58 of file cp_dbcsr_operations.F.
integer, save, public cp_dbcsr_operations::max_elements_per_block = 32 |
Definition at line 60 of file cp_dbcsr_operations.F.