(git:3d5d2e5)
Loading...
Searching...
No Matches
cp_dbcsr_operations Module Reference

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

Detailed Description

DBCSR operations in CP2K.

Author
Urban Borstnik
Date
2009-05-12
Version
0.8

Modification history:

  • Created 2009-05-12
  • Generalized sm_fm_mulitply for matrices w/ different row/col block size (A. Bussy, 11.2018)

Function/Subroutine Documentation

◆ dbcsr_sum_many()

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.

Parameters
matrix_cindependent output matrices
matrix_ainput matrices, indexed by output and history entry; must not alias outputs
alphacoefficients of the history entries

Definition at line 121 of file cp_dbcsr_operations.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_dbcsr_to_local()

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.

Parameters
matrixDBCSR matrix
densefull local matrix

Definition at line 171 of file cp_dbcsr_operations.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_local_to_dbcsr()

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.

Parameters
matrixDBCSR matrix
densefull local matrix

Definition at line 200 of file cp_dbcsr_operations.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_fm_to_dbcsr()

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
Parameters
[in]fmfull matrix
[out]matrixDBCSR matrix
[in]keep_sparsity(optional) retains the sparsity of the input matrix
Date
2009-10-13
History
2009-10-13 rewritten based on copy_dbcsr_to_fm
Author
Urban Borstnik
Version
2.0

Definition at line 239 of file cp_dbcsr_operations.F.

Here is the call graph for this function:

◆ copy_fm_to_dbcsr_bc()

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.

Parameters
fm...
bc_mat...

Definition at line 277 of file cp_dbcsr_operations.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy_dbcsr_to_fm()

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.

Parameters
[in]matrixDBCSR matrix
[out]fmfull matrix
planoptional S/A routing plan; discard before releasing the FM structure
check_plancheck 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.

Here is the call graph for this function:

◆ copy_dbcsr_to_fm_bc()

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.

Parameters
bc_matDBCSR matrix
[out]fmfull matrix

Definition at line 664 of file cp_dbcsr_operations.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dbcsr_copy_columns_hack()

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

Parameters
matrix_b...
matrix_a...
ncol...
source_start...
target_start...
para_env...
blacs_env...
Author
vw

Definition at line 761 of file cp_dbcsr_operations.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_dbcsr_dist2d_to_dist()

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.

Parameters
[in]dist2ddistribution_2d
[out]distDBCSR distribution
History
move form dbcsr_operation 01.2010

Definition at line 806 of file cp_dbcsr_operations.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dbcsr_multiply_local()

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

Parameters
[in]matrix_aDBSCR matrxx
[in]vec_bvectors b
[in,out]vec_cvectors c
[in]ncolnbr of columns
[in]alphaalpha

Definition at line 846 of file cp_dbcsr_operations.F.

Here is the call graph for this function:

◆ cp_dbcsr_sm_fm_multiply()

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.

Parameters
[in]matrixDBCSR matrix
fm_infull matrix
fm_outfull matrix
[in]ncolnbr of columns
[in]alphaalpha
[in]betabeta

Definition at line 938 of file cp_dbcsr_operations.F.

Here is the call graph for this function:

◆ cp_dbcsr_plus_fm_fm_t()

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.

Parameters
sparse_matrix...
matrix_v...
matrix_g...
ncol...
alpha...
keep_sparsityDetermines if the sparsity of sparse_matrix is retained by default it is TRUE
symmetry_modeThere 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_fm_to_dbcsr_row_template()

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).

Parameters
matrix...
fm_in...
template...

Definition at line 1256 of file cp_dbcsr_operations.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_dbcsr_m_by_n_from_template()

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).

Parameters
matrixdbcsr matrix to be created
templatetemplate dbcsr matrix giving its mp_env
mglobal row size of output matrix
nglobal col size of output matrix
sym...

Definition at line 1290 of file cp_dbcsr_operations.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cp_dbcsr_m_by_n_from_row_template()

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).

Parameters
matrixdbcsr matrix to be created
templatetemplate dbcsr matrix giving its mp_env
nglobal col size of output matrix
sym...

Definition at line 1333 of file cp_dbcsr_operations.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dbcsr_create_dist_r_unrot()

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.

Parameters
[out]dist_rightnew distribution for the right matrix
[in]dist_leftthe distribution of the left matrix
[in]ncolumnsnumber of columns in right matrix
[out]right_col_blk_sizessizes of blocks in the created column
The new row distribution for the right matrix is the same as the row
distribution of the left matrix, while the column distribution is created so that it is appropriate to the parallel environment.

Definition at line 1481 of file cp_dbcsr_operations.F.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ max_elements_per_block

integer, save, public cp_dbcsr_operations::max_elements_per_block = 32

Definition at line 58 of file cp_dbcsr_operations.F.