![]() |
(git:3d5d2e5)
|
DBCSR operations in CP2K. More...
Data Types | |
| type | dbcsr_fm_copy_plan_type |
| interface | dbcsr_allocate_matrix_set |
| interface | dbcsr_deallocate_matrix_set |
Functions/Subroutines | |
| subroutine, public | dbcsr_sum_many (matrix_c, matrix_a, alpha) |
| Sum local, nonsymmetric matrices in history order, using bounded per-worker storage. Pack and store outside OpenMP, including missing or transposed input blocks. | |
| subroutine, public | copy_dbcsr_to_local (matrix, dense) |
| Load a single-rank, nonsymmetric matrix without redistribution. | |
| subroutine, public | copy_local_to_dbcsr (matrix, dense) |
| Store a single-rank, nonsymmetric matrix without redistribution. | |
| subroutine, public | copy_fm_to_dbcsr (fm, matrix, keep_sparsity) |
| Copy a BLACS matrix to a dbcsr matrix. | |
| 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. | |
| subroutine, public | copy_dbcsr_to_fm (matrix, fm, plan, check_plan) |
| Copy a DBCSR matrix to a BLACS matrix. | |
| subroutine, public | copy_dbcsr_to_fm_bc (bc_mat, fm) |
| Copy a DBCSR_BLACS matrix to a BLACS matrix. | |
| subroutine, public | dbcsr_copy_columns_hack (matrix_b, matrix_a, ncol, source_start, target_start, para_env, blacs_env) |
| hack for dbcsr_copy_columns | |
| subroutine, public | cp_dbcsr_dist2d_to_dist (dist2d, dist) |
| Creates a DBCSR distribution from a distribution_2d. | |
| 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 | |
| subroutine, public | cp_dbcsr_sm_fm_multiply (matrix, fm_in, fm_out, ncol, alpha, beta) |
| multiply a dbcsr with a fm matrix | |
| 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. | |
| 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). | |
| subroutine, public | cp_dbcsr_m_by_n_from_template (matrix, template, m, n, sym) |
| 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). | |
| subroutine, public | cp_dbcsr_m_by_n_from_row_template (matrix, template, n, sym) |
| 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). | |
| 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. | |
Variables | |
| integer, save, public | max_elements_per_block = 32 |
DBCSR operations in CP2K.
Modification history:
| subroutine, public cp_dbcsr_operations::dbcsr_sum_many | ( | type(dbcsr_p_type), dimension(:), intent(in) | matrix_c, |
| type(dbcsr_p_type), dimension(:, :), intent(in) | matrix_a, | ||
| real(dp), dimension(:), intent(in) | alpha ) |
Sum local, nonsymmetric matrices in history order, using bounded per-worker storage. Pack and store outside OpenMP, including missing or transposed input blocks.
| matrix_c | independent output matrices |
| matrix_a | input matrices, indexed by output and history entry; must not alias outputs |
| alpha | coefficients of the history entries |
Definition at line 121 of file cp_dbcsr_operations.F.
| subroutine, public cp_dbcsr_operations::copy_dbcsr_to_local | ( | type(dbcsr_type), intent(in) | matrix, |
| real(dp), dimension(:, :), intent(out) | dense ) |
Load a single-rank, nonsymmetric matrix without redistribution.
| matrix | DBCSR matrix |
| dense | full local matrix |
Definition at line 171 of file cp_dbcsr_operations.F.
| subroutine, public cp_dbcsr_operations::copy_local_to_dbcsr | ( | type(dbcsr_type), intent(inout) | matrix, |
| real(dp), dimension(:, :), intent(in) | dense ) |
Store a single-rank, nonsymmetric matrix without redistribution.
| matrix | DBCSR matrix |
| dense | full local matrix |
Definition at line 200 of file cp_dbcsr_operations.F.
| 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 239 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 277 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(inout) | fm, | ||
| type(dbcsr_fm_copy_plan_type), intent(inout), optional | plan, | ||
| logical, intent(in), optional | check_plan ) |
Copy a DBCSR matrix to a BLACS matrix.
| [in] | matrix | DBCSR matrix |
| [out] | fm | full matrix |
| plan | optional S/A routing plan; discard before releasing the FM structure | |
| check_plan | check for layout changes and collectively rebuild the plan; defaults to false for callers that guarantee fixed layouts and threads |
Definition at line 343 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(inout) | fm ) |
Copy a DBCSR_BLACS matrix to a BLACS matrix.
| bc_mat | DBCSR matrix | |
| [out] | fm | full matrix |
Definition at line 664 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 761 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 806 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 846 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(inout) | 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 938 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 1091 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 1256 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 ) |
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 | ... |
Definition at line 1290 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 ) |
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 | ... |
Definition at line 1333 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 1481 of file cp_dbcsr_operations.F.
| integer, save, public cp_dbcsr_operations::max_elements_per_block = 32 |
Definition at line 58 of file cp_dbcsr_operations.F.