CP2K 2.4 (Revision 12889)
Classes | Functions | Variables

cp_dbcsr_operations Namespace Reference

DBCSR operations in CP2K. More...

Classes

interface  cp_dbcsr_multiply_local
interface  cp_dbcsr_allocate_matrix_set
interface  cp_dbcsr_deallocate_matrix_set
interface  cp_dbcsr_plus_fm_fm_t

Functions

subroutine, public cp_dbcsr_copy_columns_hack (matrix_b, matrix_a, ncol, source_start, target_start, para_env, blacs_env, error)
 hack for dbcsr_copy_columns
subroutine, public cp_dbcsr_dist2d_to_dist (dist2d, dist, error, mp_obj)
 Creates a DBCSR distribution from a distribution_2d.
subroutine, public cp_dbcsr_alloc_block_from_nbl (matrix, sab_orb, error)
 allocate the blocks of a dbcsr based on the neighbor list
subroutine, public cp_dbcsr_multiply_vec (matrix_a, matrix_b, a_row_beg, a_row_end, b_col, pkd, error)
 multiply a dbcsr with a column vector c (packed column) = A (dbscr) * B_b (dbcsr)
subroutine, public cp_dbcsr_mult_pack_vec_local (matrix_a, pkd_b, a_row_beg, a_row_end, b_col, pkd_c, error)
 multiply a dbcsr with a packed vector as c (packed column) = A (dbscr) * b (packed column)
subroutine cp_dbcsr_multiply_local_d (matrix_a, vec_b, vec_c, ncol, alpha, error)
 multiply a dbcsr with a replicated array c = alpha_scalar * A (dbscr) * b + c
subroutine cp_dbcsr_multiply_local_s (matrix_a, vec_b, vec_c, ncol, alpha, error)
subroutine, public cp_dbcsr_sm_fm_multiply (matrix, fm_in, fm_out, ncol, alpha, beta, error)
 multiply a dbcsr with a fm matrix
subroutine match_col_sizes (sizes1, sizes2, full_num)
subroutine cp_dbcsr_plus_fm_fm_t_native (sparse_matrix, matrix_v, matrix_g, ncol, alpha, error)
subroutine, public cp_dbcsr_pack_vec (matrix, ivec, pkd_vec, what, error)
 pack a row or column of a dbcsr
subroutine, public cp_dbcsr_unpack_vec (matrix, ivec, pkd_vec, what, do_sum, error)
 unpack a row or column of a dbcsr
subroutine, public packed_vec_scale (alpha, block, pkd, nvec, ivec, vec_blk_size, side, error)
 Does one of the operations: left) pkd_ji = alpha * block_jj (block) * pkd_ji for j = 1,..., nvec right) pkd_ij = alpha * pkd_ij * block_jj (block) for j = 1,..., nvec.
subroutine, public packed_vec_bif_tech (mat_v, mat_u, pkd_v_fac, pkd_u_fac, ivec, pkd_v, pkd_u, error)
 Does the operations: v(k,:) = v(k,:) - uAk(i,k)' * inv(d(i,i)) * v(i,:) / s u(k,:) = u(k,:) - v(i,k)' * inv(d(i,i)) * u(i,:) / s.
subroutine, public packed_vec_build_u (pkd_u, pkd_v, k, n, s, vec_blk_size, error)
subroutine, public packed_vec_bif_tech2 (mat_v, pkd_v_fac, ivec, pkd_v, error)
 Does the operations: v(k,:) = v(k,:) - uAk(i,k)' * inv(d(i,i)) * v(i,:) / s.
subroutine, public packed_vec_ini (pkd_vec, n, error)
subroutine packed_vec_alltoall (pkd_vec, source, scope, n, vec_blk_size, mp_obj, error)
subroutine, public packed_vec_bcast (pkd_vec, source, scope, do_summation, n, vec_blk_size, mp_obj, error)
subroutine packed_vec_reduce (pkd_vec, to, scope, vec_blk_size, n, mp_obj, error)
subroutine packed_vec_add (pkd_vec_a, pkd_vec_b, vec_blk_size, n, do_summation, error)
subroutine, public cp_dbcsr_copy_vec (matrix_a, matrix_b, what, ivec, error)
 copy a vector (row or column) from a matrix to another matrix
subroutine, public cp_dbcsr_add_block_node (matrix, block_row, block_col, block, error)
 Emulation of sparse_matrix_types/add_block_node mapped to add_real_matrix_block.
INTEGER, public cp_dbcsr_get_id_nr (matrix, error)
 returns the id of the given matrix (from cp_sm_get_id_nr)
subroutine, public cp_dbcsr_deallocate_matrix (matrix, error)
 Deallocates a DBCSR matrix for compatibility with CP2K.
subroutine allocate_dbcsr_matrix_set (matrix_set, nmatrix, error)
 Allocate and initialize a real matrix 1-dimensional set.
subroutine allocate_dbcsr_matrix_set_2d (matrix_set, nmatrix, mmatrix, error)
 Allocate and initialize a real matrix 2-dimensional set.
subroutine deallocate_dbcsr_matrix_set (matrix_set, error)
 Deallocate a real matrix set and release all of the member matrices.
subroutine deallocate_dbcsr_matrix_set_2d (matrix_set, error)
 Deallocate a real matrix set and release all of the member matrices.
subroutine cp_dbcsr_type_from_sm_symmetry (dbcsr_matrix_type, sm_symmetry)
 Maps sparse_matrix_type symmetry to DBCSR matrix type.
subroutine, public cp_dbcsr_from_fm (matrix, fm, threshold, distribution, row_blk_size, col_blk_size, error)
 Converts a cp2k full matrix into a DBCSR matrix.
subroutine, public copy_fm_to_dbcsr (fm, matrix, alpha, beta, keep_sparsity, error)
 Copy a BLACS matrix to a dbcsr matrix.
subroutine, public copy_cfm_to_dbcsr (fm, matrix, keep_sparsity, error)
 Copy a BLACS matrix to a dbcsr matrix.
subroutine, public copy_dbcsr_to_fm (matrix, fm, error)
 Copy a DBCSR matrix to a BLACS matrix.
subroutine, public copy_dbcsr_to_cfm (matrix, fm, error)
 Copy a DBCSR matrix to a BLACS matrix.

Variables

CHARACTER(len=*), parameter,
private 
moduleN = 'cp_dbcsr_operations'
INTEGER, save, private last_matrix_id = 0

Detailed Description

DBCSR operations in CP2K.

Author:
Urban Borstnik
Date:
2009-05-12
Version:
0.8

Modification history:


Function Documentation

subroutine cp_dbcsr_operations::allocate_dbcsr_matrix_set ( TYPE(cp_dbcsr_p_type),dimension(:),pointer  matrix_set,
INTEGER,intent(in)  nmatrix,
TYPE(cp_error_type),intent(inout)  error 
) [private]

Allocate and initialize a real matrix 1-dimensional set.

Parameters:
[in,out]matrix_setSet containing the DBCSR matrices
[in]nmatrixSize of set
[in,out]errorcp2k error
History
2009-08-17 Adapted from sparse_matrix_type for DBCSR

Definition at line 1836 of file cp_dbcsr_operations.f90.

subroutine cp_dbcsr_operations::allocate_dbcsr_matrix_set_2d ( TYPE(cp_dbcsr_p_type),dimension(:, :),pointer  matrix_set,
INTEGER,intent(in)  nmatrix,
INTEGER,intent(in)  mmatrix,
TYPE(cp_error_type),intent(inout)  error 
) [private]

Allocate and initialize a real matrix 2-dimensional set.

Parameters:
[in,out]matrix_setSet containing the DBCSR matrix pointer type
[in]nmatrixSize of set
[in,out]errorcp2k error
History
2009-08-17 Adapted from sparse_matrix_type for DBCSR

Definition at line 1866 of file cp_dbcsr_operations.f90.

subroutine,public cp_dbcsr_operations::copy_cfm_to_dbcsr ( TYPE(cp_cfm_type),pointer  fm,
TYPE(cp_dbcsr_type),intent(inout)  matrix,
LOGICAL,intent(in),optional  keep_sparsity,
TYPE(cp_error_type),intent(inout)  error 
)

Copy a BLACS matrix to a dbcsr matrix.

real_matrix=beta*real_matrix+alpha*fm beta defaults to 0, alpha to 1

Author:
VW
Date:
2010
History
2010 copied from copy_dbcsr_to_fm
Version:
2.0
Parameters:
[in]fmfull matrix
[out]matrixDBCSR matrix
[in]alpha(optional) scaling of FM
[in]beta(optional) scaling of existing SM
[in]keep_sparsity(optional) retains the sparsity of the input matrix

Definition at line 2241 of file cp_dbcsr_operations.f90.

References dbcsr_work_operations::add_work_coordinate(), dbcsr_util::convert_sizes_to_offsets(), cp_dbcsr_interface::cp_dbcsr_complete_redistribute(), cp_dbcsr_interface::cp_dbcsr_distribution(), cp_dbcsr_interface::cp_dbcsr_finalize(), cp_dbcsr_interface::cp_dbcsr_get_info(), cp_dbcsr_interface::cp_dbcsr_get_matrix_type(), cp_dbcsr_interface::cp_dbcsr_init(), cp_dbcsr_interface::cp_dbcsr_release(), cp_dbcsr_interface::cp_dbcsr_work_create(), dbcsr_block_access::dbcsr_access_flush(), dbcsr_dist_operations::dbcsr_create_dist_block_cyclic(), dbcsr_methods::dbcsr_distribution_init(), dbcsr_methods::dbcsr_distribution_mp(), dbcsr_methods::dbcsr_distribution_release(), dbcsr_error_handling::dbcsr_error_set(), kinds::dp, and timings::timeset().

Referenced by cp_dbcsr_diag::cp_dbcsr_heevd().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_dbcsr_operations::copy_dbcsr_to_cfm ( TYPE(cp_dbcsr_type),intent(in)  matrix,
TYPE(cp_cfm_type),pointer  fm,
TYPE(cp_error_type),intent(inout)  error 
)
subroutine,public cp_dbcsr_operations::copy_dbcsr_to_fm ( TYPE(cp_dbcsr_type),intent(in)  matrix,
TYPE(cp_fm_type),pointer  fm,
TYPE(cp_error_type),intent(inout)  error 
)

Copy a DBCSR matrix to a BLACS matrix.

Parameters:
[in]matrixDBCSR matrix
[out]fmfull matrix

Definition at line 2394 of file cp_dbcsr_operations.f90.

References dbcsr_util::convert_sizes_to_offsets(), cp_dbcsr_interface::cp_dbcsr_complete_redistribute(), cp_dbcsr_interface::cp_dbcsr_distribution(), cp_dbcsr_interface::cp_dbcsr_get_data_size(), cp_dbcsr_interface::cp_dbcsr_get_info(), cp_dbcsr_interface::cp_dbcsr_init(), cp_dbcsr_interface::cp_dbcsr_iterator_blocks_left(), cp_dbcsr_interface::cp_dbcsr_iterator_start(), cp_dbcsr_interface::cp_dbcsr_iterator_stop(), cp_dbcsr_interface::cp_dbcsr_release(), dbcsr_block_access::dbcsr_access_flush(), dbcsr_dist_operations::dbcsr_create_dist_block_cyclic(), dbcsr_methods::dbcsr_distribution_init(), dbcsr_methods::dbcsr_distribution_local_cols(), dbcsr_methods::dbcsr_distribution_local_rows(), dbcsr_methods::dbcsr_distribution_mp(), dbcsr_methods::dbcsr_distribution_ncols(), dbcsr_methods::dbcsr_distribution_nlocal_cols(), dbcsr_methods::dbcsr_distribution_nlocal_rows(), dbcsr_methods::dbcsr_distribution_nrows(), dbcsr_methods::dbcsr_distribution_release(), dbcsr_error_handling::dbcsr_error_set(), and timings::timeset().

Referenced by hfx_admm_utils::admm_density_matrix(), rt_propagation::apply_delta_pulse(), rt_propagation::apply_delta_pulse_periodic(), admm_methods::blockify_density_matrix(), admm_methods::calc_aux_mo_derivs_none(), rt_propagation_utils::calc_S_derivs(), rt_propagation_methods::calc_SinvH(), qs_initial_guess::calculate_first_density_matrix(), qs_pdos::calculate_projected_dos(), qs_ks_methods::calculate_w_matrix_ot(), qs_ks_methods::calculate_w_matrix_roks(), cp_dbcsr_cholesky::cp_dbcsr_cholesky_decompose(), cp_dbcsr_cholesky::cp_dbcsr_cholesky_invert(), cp_dbcsr_cholesky::cp_dbcsr_cholesky_reduce(), cp_dbcsr_cholesky::cp_dbcsr_cholesky_restore(), cp_dbcsr_copy_columns_hack(), cp_dbcsr_plus_fm_fm_t_native(), cp_dbcsr_sm_fm_multiply(), qs_scf_diagonalization::do_block_krylov_diag(), qs_scf_diagonalization::do_general_diag(), qs_scf_diagonalization::do_ot_diag(), qs_scf_diagonalization::do_roks_diag(), qs_scf_diagonalization::do_special_diag(), optbas_opt_utils::evaluate_fval(), admm_methods::fit_mo_coeffs_blocked(), admm_methods::fit_mo_coeffs_diag(), admm_methods::fit_mo_coeffs_no_diag(), admm_methods::fit_mo_coeffs_none(), qs_scf_block_davidson::generate_extended_space(), qs_scf_block_davidson::generate_extended_space_sparse(), rt_propagator_init::get_maxabs_eigval(), qs_gspace_mixing::gspace_density_mixing(), qs_scf::init_scf_loop(), qs_scf::init_scf_run(), population_analyses::lowdin_population_analysis(), qs_mo_methods::make_basis_sv_dbcsr(), rt_make_propagators::make_etrs_exp(), preconditioner::make_full_all(), preconditioner::make_full_all_ortho(), preconditioner::make_full_fact_cholesky(), preconditioner::make_full_inverse_cholesky(), preconditioner::make_full_kinetic(), preconditioner::make_full_s_inverse(), preconditioner::make_full_single(), preconditioner::make_full_single_inverse(), preconditioner::make_full_single_inverse_ortho(), preconditioner::make_full_single_ortho(), preconditioner::make_preconditioner(), preconditioner::make_sparse_inverse_bif(), admm_methods::merge_ks_matrix_cauchy(), admm_methods::merge_ks_matrix_cauchy_blocked(), admm_methods::merge_ks_matrix_cauchy_subspace(), admm_methods::merge_ks_matrix_none(), admm_methods::merge_mo_derivs_diag(), admm_methods::merge_mo_derivs_no_diag(), mp2_gpw::mp2_gpw_compute(), mp2::mp2_main(), mp2_ri_gpw::mp2_ri_gpw_compute_in(), qs_loc_methods::optimize_loc_pipek(), qs_ot_eigensolver::ot_eigensolver(), admm_methods::purify_density_matrix_cauchy(), admm_methods::purify_dm_cauchy_blocked(), hfx_admm_utils::pw_hfx(), qs_diis::qs_diis_b_step(), qs_efield_berry::qs_efield_mo_derivatives(), qs_ks_methods::qs_ks_build_kohn_sham_matrix(), qs_ks_apply_restraints::qs_ks_s2_restraint(), qs_scf_post_gpw::qs_scf_post_molopt(), rtp_admm_methods::rt_merge_ks_matrix_cauchy(), rtp_admm_methods::rt_merge_ks_matrix_none(), rtp_admm_methods::rtp_fit_mo_coeffs_none(), rtp_admm_methods::rtp_purify_dm_cauchy(), rt_propagation_methods::s_matrices_create(), qs_scf::scf_env_do_scf(), qs_ks_methods::sic_explicit_orbitals(), qs_mo_methods::subspace_eigenvalues_ks_fm(), qs_tddfpt_utils::tddfpt_env_init(), qs_mo_types::write_mo_set_to_restart(), and xas_methods::xas().

Here is the call graph for this function:

subroutine,public cp_dbcsr_operations::copy_fm_to_dbcsr ( TYPE(cp_fm_type),pointer  fm,
TYPE(cp_dbcsr_type),intent(inout)  matrix,
REAL(kind=dp),intent(in),optional  alpha,
REAL(kind=dp),intent(in),optional  beta,
LOGICAL,intent(in),optional  keep_sparsity,
TYPE(cp_error_type),intent(inout)  error 
)

Copy a BLACS matrix to a dbcsr matrix.

real_matrix=beta*real_matrix+alpha*fm beta defaults to 0, alpha to 1

Author:
Urban Borstnik
Date:
2009-10-13
History
2009-10-13 rewritten based on copy_dbcsr_to_fm
Version:
2.0
Parameters:
[in]fmfull matrix
[out]matrixDBCSR matrix
[in]alpha(optional) scaling of FM
[in]beta(optional) scaling of existing SM
[in]keep_sparsity(optional) retains the sparsity of the input matrix

Definition at line 2036 of file cp_dbcsr_operations.f90.

References dbcsr_work_operations::add_work_coordinate(), dbcsr_util::convert_sizes_to_offsets(), cp_dbcsr_interface::cp_dbcsr_complete_redistribute(), cp_dbcsr_interface::cp_dbcsr_distribution(), cp_dbcsr_interface::cp_dbcsr_finalize(), cp_dbcsr_interface::cp_dbcsr_get_data_type(), cp_dbcsr_interface::cp_dbcsr_get_info(), cp_dbcsr_interface::cp_dbcsr_get_matrix_type(), cp_dbcsr_interface::cp_dbcsr_init(), cp_dbcsr_interface::cp_dbcsr_release(), cp_dbcsr_interface::cp_dbcsr_work_create(), dbcsr_block_access::dbcsr_access_flush(), dbcsr_dist_operations::dbcsr_create_dist_block_cyclic(), dbcsr_methods::dbcsr_distribution_init(), dbcsr_methods::dbcsr_distribution_mp(), dbcsr_methods::dbcsr_distribution_release(), dbcsr_error_handling::dbcsr_error_set(), and timings::timeset().

Referenced by admm_utils::admm_correct_for_eigenvalues(), admm_utils::admm_uncorrect_for_eigenvalues(), cp_dbcsr_copy_columns_hack(), cp_dbcsr_from_fm(), cp_dbcsr_plus_fm_fm_t_native(), cp_dbcsr_sm_fm_multiply(), dft_plus_u::lowdin(), preconditioner::make_preconditioner(), preconditioner::make_sparse_inverse_bif(), and qs_ot_scf::ot_scf_init().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_dbcsr_operations::cp_dbcsr_add_block_node ( TYPE(cp_dbcsr_type),intent(inout)  matrix,
INTEGER,intent(in)  block_row,
INTEGER,intent(in)  block_col,
REAL(KIND=dp),dimension(:, :),pointer  block,
TYPE(cp_error_type),intent(inout)  error 
)

Emulation of sparse_matrix_types/add_block_node mapped to add_real_matrix_block.

It adds a block to the dbcsr matrix and returns a rank-2 pointer to the block. Currently it only and always uses the mutable data.

Parameters:
[in,out]matrixDBCSR matrix
[in]rowthe row
[in]colthe column
[in]blockthe block to put
[in,out]errorcp2k error

Definition at line 1717 of file cp_dbcsr_operations.f90.

References cp_dbcsr_interface::cp_dbcsr_distribution(), cp_dbcsr_interface::cp_dbcsr_get_stored_coordinates(), cp_dbcsr_interface::cp_dbcsr_work_create(), dbcsr_methods::dbcsr_distribution_mp(), dbcsr_methods::dbcsr_mp_mynode(), and dbcsr_methods::dbcsr_wm_use_mutable().

Referenced by qs_dftb_matrices::build_dftb_matrices(), qs_linres_current::calculate_jrho_resp(), qs_integrate_potential::integrate_v_rspace(), and scp_environment::scp_nddo_init().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_dbcsr_operations::cp_dbcsr_alloc_block_from_nbl ( TYPE(cp_dbcsr_type)  matrix,
TYPE(neighbor_list_set_p_type),dimension(:),pointer  sab_orb,
TYPE(cp_error_type),intent(inout)  error 
)

allocate the blocks of a dbcsr based on the neighbor list

Note:
Parameters:
matrixthe matrix
sab_orbthe corresponding neighbor list
error
History
11.2009 created vw
Author:
vw

Definition at line 265 of file cp_dbcsr_operations.f90.

References cp_dbcsr_interface::cp_dbcsr_finalize(), cp_dbcsr_interface::cp_dbcsr_get_matrix_type(), cp_dbcsr_interface::cp_dbcsr_reserve_blocks(), qs_neighbor_list_types::get_iterator_info(), and timings::timeset().

Referenced by qs_kinetic::build_kinetic_matrix(), qs_overlap::build_overlap_matrix(), qs_overlap::build_overlap_matrix_simple(), qs_linres_op::current_operators(), qs_linres_current_utils::current_response(), qs_linres_issc_utils::issc_env_init(), dm_ls_scf_qs::ls_scf_init_qs(), and qs_rho_methods::qs_rho_rebuild().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_dbcsr_operations::cp_dbcsr_copy_columns_hack ( TYPE(cp_dbcsr_type),intent(inout)  matrix_b,
TYPE(cp_dbcsr_type),intent(in)  matrix_a,
INTEGER,intent(in)  ncol,
INTEGER,intent(in)  source_start,
INTEGER,intent(in)  target_start,
TYPE(cp_para_env_type),pointer  para_env,
TYPE(cp_blacs_env_type),pointer  blacs_env,
TYPE(cp_error_type),intent(inout)  error 
)

hack for dbcsr_copy_columns

Author:
vw

Definition at line 154 of file cp_dbcsr_operations.f90.

References copy_dbcsr_to_fm(), copy_fm_to_dbcsr(), cp_dbcsr_interface::cp_dbcsr_get_info(), cp_fm_types::cp_fm_create(), cp_fm_struct::cp_fm_struct_create(), and error.

Here is the call graph for this function:

subroutine,public cp_dbcsr_operations::cp_dbcsr_copy_vec ( TYPE(cp_dbcsr_type),intent(inout)  matrix_a,
TYPE(cp_dbcsr_type),intent(in)  matrix_b,
CHARACTER(LEN=*),intent(in)  what,
INTEGER,intent(in)  ivec,
TYPE(cp_error_type),intent(inout)  error 
)

copy a vector (row or column) from a matrix to another matrix

Parameters:
inout]matrix_b matrix
[in]matrix_amatrix
[in]whatrow or column
[in]ivecthe column/row index

Definition at line 1660 of file cp_dbcsr_operations.f90.

References cp_dbcsr_interface::cp_dbcsr_finalize(), cp_dbcsr_interface::cp_dbcsr_iterator_blocks_left(), cp_dbcsr_interface::cp_dbcsr_iterator_start(), cp_dbcsr_interface::cp_dbcsr_iterator_stop(), and timings::timeset().

Referenced by preconditioner::make_sparse_inverse_bif().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_dbcsr_operations::cp_dbcsr_deallocate_matrix ( TYPE(cp_dbcsr_type),pointer  matrix,
TYPE(cp_error_type),intent(inout)  error 
)
subroutine,public cp_dbcsr_operations::cp_dbcsr_dist2d_to_dist ( TYPE(distribution_2d_type),intent(in),target  dist2d,
TYPE(dbcsr_distribution_obj),intent(out)  dist,
TYPE(cp_error_type),intent(inout)  error,
TYPE(dbcsr_mp_obj),intent(in),optional  mp_obj 
)

Creates a DBCSR distribution from a distribution_2d.

Parameters:
[in]dist2ddistribution_2d
[out]distDBCSR distribution
[in,out]errorcp2k error
History
move form dbcsr_operation 01.2010

Definition at line 207 of file cp_dbcsr_operations.f90.

References dbcsr_methods::dbcsr_distribution_new(), dbcsr_methods::dbcsr_mp_hold(), dbcsr_methods::dbcsr_mp_new(), dbcsr_methods::dbcsr_mp_release(), and distribution_2d_types::distribution_2d_get().

Here is the call graph for this function:

subroutine,public cp_dbcsr_operations::cp_dbcsr_from_fm ( TYPE(cp_dbcsr_type),intent(out)  matrix,
TYPE(cp_fm_type),pointer  fm,
REAL(KIND=dp),intent(in)  threshold,
TYPE(dbcsr_distribution_obj)  distribution,
TYPE(array_i1d_obj),intent(in)  row_blk_size,
TYPE(array_i1d_obj),intent(in)  col_blk_size,
TYPE(cp_error_type),intent(inout)  error 
)

Converts a cp2k full matrix into a DBCSR matrix.

Parameters:
[out]matrixthe created BCSR matrix
[in]fmthe cpk full matrix
[in]thresholdthe threshold for determining sparsity
[in]row_blk_sizessizes of row blocks
[in]col_blk_sizessizes of column blocks
[in]distributionthe distribution to use for the new matrix
[in,out]errorcp2k error

Definition at line 1992 of file cp_dbcsr_operations.f90.

References copy_fm_to_dbcsr(), cp_dbcsr_interface::cp_dbcsr_verify_matrix(), error, and timings::timeset().

Referenced by preconditioner::apply_sparse_single().

Here is the call graph for this function:

Here is the caller graph for this function:

INTEGER,public cp_dbcsr_operations::cp_dbcsr_get_id_nr ( TYPE(cp_dbcsr_type),pointer  matrix,
TYPE(cp_error_type),intent(inout)  error 
)

returns the id of the given matrix (from cp_sm_get_id_nr)

Parameters:
matrixthe matrix you want info about
errorvariable to control error logging, stopping,... see module cp_error_handling

Definition at line 1775 of file cp_dbcsr_operations.f90.

subroutine,public cp_dbcsr_operations::cp_dbcsr_mult_pack_vec_local ( TYPE(cp_dbcsr_type),intent(in)  matrix_a,
REAL(dp),dimension(:),intent(in)  pkd_b,
INTEGER,intent(in)  a_row_beg,
INTEGER,intent(in)  a_row_end,
INTEGER,intent(in)  b_col,
REAL(dp),dimension(:),intent(inout)  pkd_c,
TYPE(cp_error_type),intent(inout)  error 
)

multiply a dbcsr with a packed vector as c (packed column) = A (dbscr) * b (packed column)

Parameters:
[in]matrixDBCSR matrix
[in]pkd_bpacked vector b
[in]b_colthe column of the packed b (this should be changed in b_col_size)
[out]pkd_cpacked vector c

Definition at line 421 of file cp_dbcsr_operations.f90.

References cp_dbcsr_interface::cp_dbcsr_iterator_blocks_left(), cp_dbcsr_interface::cp_dbcsr_iterator_start(), cp_dbcsr_interface::cp_dbcsr_iterator_stop(), cp_dbcsr_interface::cp_dbcsr_nblkrows_total(), packed_vec_ini(), and timings::timeset().

Referenced by cp_dbcsr_multiply_vec().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine cp_dbcsr_operations::cp_dbcsr_multiply_local_d ( TYPE(cp_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,
TYPE(cp_error_type),intent(inout)  error 
) [private]

multiply a dbcsr with a replicated array c = alpha_scalar * A (dbscr) * b + c

Parameters:
[in]matrixDBCSR matrix
[in]vec_bvectors b
inout]vec_c vectors c
[in]ncolnbr of columns
[in]alphaalpha

Definition at line 493 of file cp_dbcsr_operations.f90.

References cp_dbcsr_interface::cp_dbcsr_get_matrix_type(), cp_dbcsr_interface::cp_dbcsr_iterator_blocks_left(), cp_dbcsr_interface::cp_dbcsr_iterator_start(), cp_dbcsr_interface::cp_dbcsr_iterator_stop(), and timings::timeset().

Here is the call graph for this function:

subroutine cp_dbcsr_operations::cp_dbcsr_multiply_local_s ( TYPE(cp_dbcsr_type),intent(in)  matrix_a,
REAL,dimension(:, :),intent(in)  vec_b,
REAL,dimension(:, :),intent(inout)  vec_c,
INTEGER,intent(in),optional  ncol,
REAL,intent(in),optional  alpha,
TYPE(cp_error_type),intent(inout)  error 
) [private]
subroutine,public cp_dbcsr_operations::cp_dbcsr_multiply_vec ( TYPE(cp_dbcsr_type),intent(in)  matrix_a,
TYPE(cp_dbcsr_type),intent(in)  matrix_b,
INTEGER,intent(in)  a_row_beg,
INTEGER,intent(in)  a_row_end,
INTEGER,intent(in)  b_col,
REAL(dp),dimension(:),pointer  pkd,
TYPE(cp_error_type),intent(inout)  error 
)

multiply a dbcsr with a column vector c (packed column) = A (dbscr) * B_b (dbcsr)

Parameters:
[in]matrix_aDBCSR matrix
[in]matrix_bDBCSR matrix
[in]b_colthe column of the matrix B
[out]pkdthe result in a packed format

Definition at line 358 of file cp_dbcsr_operations.f90.

References cp_dbcsr_interface::cp_dbcsr_distribution(), cp_dbcsr_interface::cp_dbcsr_get_stored_coordinates(), cp_dbcsr_mult_pack_vec_local(), cp_dbcsr_interface::cp_dbcsr_nblkcols_total(), cp_dbcsr_pack_vec(), dbcsr_methods::dbcsr_distribution_mp(), dbcsr_methods::dbcsr_mp_get_coordinates(), packed_vec_alltoall(), and timings::timeset().

Referenced by preconditioner::make_sparse_inverse_bif().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_dbcsr_operations::cp_dbcsr_pack_vec ( TYPE(cp_dbcsr_type),intent(in)  matrix,
INTEGER,intent(in)  ivec,
REAL(dp),dimension(:),intent(inout)  pkd_vec,
CHARACTER(LEN=*),intent(in)  what,
TYPE(cp_error_type),intent(inout)  error 
)

pack a row or column of a dbcsr

Parameters:
[in]matrixDBCSR matrix
[in]ivecthe vector to pack
[out]pkd_vecpacked vector
[in]whatwhat to pack (row or column)

Definition at line 890 of file cp_dbcsr_operations.f90.

References cp_dbcsr_interface::cp_dbcsr_iterator_blocks_left(), cp_dbcsr_interface::cp_dbcsr_iterator_start(), cp_dbcsr_interface::cp_dbcsr_iterator_stop(), cp_dbcsr_interface::cp_dbcsr_nblkrows_total(), and timings::timeset().

Referenced by cp_dbcsr_multiply_vec(), and preconditioner::make_sparse_inverse_bif().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine cp_dbcsr_operations::cp_dbcsr_plus_fm_fm_t_native ( TYPE(cp_dbcsr_type),intent(inout)  sparse_matrix,
TYPE(cp_fm_type),pointer  matrix_v,
TYPE(cp_fm_type),optional,pointer  matrix_g,
INTEGER,intent(in)  ncol,
REAL(KIND=dp),intent(in),optional  alpha,
TYPE(cp_error_type),intent(inout)  error 
) [private]
subroutine,public cp_dbcsr_operations::cp_dbcsr_sm_fm_multiply ( TYPE(cp_dbcsr_type),intent(in)  matrix,
TYPE(cp_fm_type),pointer  fm_in,
TYPE(cp_fm_type),pointer  fm_out,
INTEGER,intent(in)  ncol,
REAL(dp),intent(in),optional  alpha,
REAL(dp),intent(in),optional  beta,
TYPE(cp_error_type),intent(inout)  error 
)
subroutine cp_dbcsr_operations::cp_dbcsr_type_from_sm_symmetry ( CHARACTER,intent(out)  dbcsr_matrix_type,
CHARACTER(LEN=*),intent(in)  sm_symmetry 
) [private]

Maps sparse_matrix_type symmetry to DBCSR matrix type.

Parameters:
[out]dbcsr_matrix_typematrix_type of the DBCSR matrix
[in]sm_symmetrysparse_matrix_symmetry

Definition at line 1958 of file cp_dbcsr_operations.f90.

subroutine,public cp_dbcsr_operations::cp_dbcsr_unpack_vec ( TYPE(cp_dbcsr_type),intent(inout)  matrix,
INTEGER,intent(in)  ivec,
REAL(dp),dimension(:),intent(in)  pkd_vec,
CHARACTER(LEN=*),intent(in)  what,
LOGICAL,intent(in),optional  do_sum,
TYPE(cp_error_type),intent(inout)  error 
)

unpack a row or column of a dbcsr

Parameters:
inout]matrix DBCSR matrix
[in]ivecthe vector to pack
[in]pkd_vecpacked vector
[in]whatwhat to unpack (row or column)

Definition at line 978 of file cp_dbcsr_operations.f90.

References cp_dbcsr_interface::cp_dbcsr_distribution(), cp_dbcsr_interface::cp_dbcsr_finalize(), cp_dbcsr_interface::cp_dbcsr_get_stored_coordinates(), cp_dbcsr_interface::cp_dbcsr_nblkcols_total(), cp_dbcsr_interface::cp_dbcsr_nblkrows_total(), dbcsr_methods::dbcsr_distribution_mp(), dbcsr_methods::dbcsr_mp_mynode(), and timings::timeset().

Referenced by preconditioner::make_sparse_inverse_bif().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine cp_dbcsr_operations::deallocate_dbcsr_matrix_set ( TYPE(cp_dbcsr_p_type),dimension(:),pointer  matrix_set,
TYPE(cp_error_type),intent(inout)  error 
) [private]

Deallocate a real matrix set and release all of the member matrices.

Parameters:
[in,out]matrix_setSet containing the DBCSR matrix pointer type
[in,out]errorcp2k error
History
2009-08-17 Adapted from sparse_matrix_type for DBCSR

Definition at line 1898 of file cp_dbcsr_operations.f90.

References cp_dbcsr_deallocate_matrix(), and timings::timeset().

Here is the call graph for this function:

subroutine cp_dbcsr_operations::deallocate_dbcsr_matrix_set_2d ( TYPE(cp_dbcsr_p_type),dimension(:, :),pointer  matrix_set,
TYPE(cp_error_type),intent(inout)  error 
) [private]

Deallocate a real matrix set and release all of the member matrices.

Parameters:
[in,out]matrix_setSet containing the DBCSR matrix pointer type
[in,out]errorcp2k error
History
2009-08-17 Adapted from sparse_matrix_type for DBCSR

Definition at line 1930 of file cp_dbcsr_operations.f90.

References cp_dbcsr_deallocate_matrix().

Here is the call graph for this function:

subroutine cp_dbcsr_operations::match_col_sizes ( INTEGER,dimension(:),intent(inout)  sizes1,
INTEGER,dimension(:),intent(in)  sizes2,
INTEGER,intent(in)  full_num 
) [private]

Definition at line 710 of file cp_dbcsr_operations.f90.

Referenced by cp_dbcsr_sm_fm_multiply().

Here is the caller graph for this function:

subroutine cp_dbcsr_operations::packed_vec_add ( REAL(dp),dimension(:),intent(inout)  pkd_vec_a,
REAL(dp),dimension(:),intent(in)  pkd_vec_b,
INTEGER,dimension(:),intent(in)  vec_blk_size,
INTEGER,intent(in)  n,
LOGICAL,intent(in),optional  do_summation,
TYPE(cp_error_type),intent(inout)  error 
) [private]

Definition at line 1592 of file cp_dbcsr_operations.f90.

References timings::timeset().

Referenced by packed_vec_alltoall(), packed_vec_bcast(), and packed_vec_reduce().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine cp_dbcsr_operations::packed_vec_alltoall ( REAL(dp),dimension(:),pointer  pkd_vec,
INTEGER,intent(in)  source,
CHARACTER(LEN=*),intent(in)  scope,
INTEGER,intent(in)  n,
INTEGER,dimension(:),intent(in)  vec_blk_size,
TYPE(dbcsr_mp_obj)  mp_obj,
TYPE(cp_error_type),intent(inout)  error 
) [private]
subroutine,public cp_dbcsr_operations::packed_vec_bcast ( REAL(dp),dimension(:),pointer  pkd_vec,
INTEGER,intent(in)  source,
CHARACTER(LEN=*),intent(in)  scope,
LOGICAL,intent(in)  do_summation,
INTEGER,intent(in)  n,
INTEGER,dimension(:),intent(in)  vec_blk_size,
TYPE(dbcsr_mp_obj)  mp_obj,
TYPE(cp_error_type),intent(inout)  error 
)
subroutine,public cp_dbcsr_operations::packed_vec_bif_tech ( TYPE(cp_dbcsr_type),intent(inout)  mat_v,
TYPE(cp_dbcsr_type),intent(inout)  mat_u,
REAL(dp),dimension(:),intent(in)  pkd_v_fac,
REAL(dp),dimension(:),intent(in)  pkd_u_fac,
INTEGER,intent(in)  ivec,
REAL(dp),dimension(:),intent(inout)  pkd_v,
REAL(dp),dimension(:),intent(inout)  pkd_u,
TYPE(cp_error_type),intent(inout)  error 
)

Does the operations: v(k,:) = v(k,:) - uAk(i,k)' * inv(d(i,i)) * v(i,:) / s u(k,:) = u(k,:) - v(i,k)' * inv(d(i,i)) * u(i,:) / s.

Definition at line 1121 of file cp_dbcsr_operations.f90.

References cp_dbcsr_interface::cp_dbcsr_nblkrows_total(), and timings::timeset().

Here is the call graph for this function:

subroutine,public cp_dbcsr_operations::packed_vec_bif_tech2 ( TYPE(cp_dbcsr_type),intent(inout)  mat_v,
REAL(dp),dimension(:),intent(in)  pkd_v_fac,
INTEGER,intent(in)  ivec,
REAL(dp),dimension(:),intent(inout)  pkd_v,
TYPE(cp_error_type),intent(inout)  error 
)

Does the operations: v(k,:) = v(k,:) - uAk(i,k)' * inv(d(i,i)) * v(i,:) / s.

Definition at line 1259 of file cp_dbcsr_operations.f90.

References cp_dbcsr_interface::cp_dbcsr_iterator_blocks_left(), cp_dbcsr_interface::cp_dbcsr_iterator_start(), cp_dbcsr_interface::cp_dbcsr_iterator_stop(), cp_dbcsr_interface::cp_dbcsr_nblkrows_total(), packed_vec_ini(), and timings::timeset().

Referenced by preconditioner::make_sparse_inverse_bif().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_dbcsr_operations::packed_vec_build_u ( REAL(dp),dimension(:),intent(out)  pkd_u,
REAL(dp),dimension(:),intent(in)  pkd_v,
INTEGER,intent(in)  k,
INTEGER,intent(in)  n,
REAL(dp),intent(in)  s,
INTEGER,dimension(:),intent(in)  vec_blk_size,
TYPE(cp_error_type),intent(inout)  error 
)

Definition at line 1217 of file cp_dbcsr_operations.f90.

Referenced by preconditioner::make_sparse_inverse_bif().

Here is the caller graph for this function:

subroutine,public cp_dbcsr_operations::packed_vec_ini ( REAL(dp),dimension(:),intent(out)  pkd_vec,
INTEGER,intent(in)  n,
TYPE(cp_error_type),intent(inout)  error 
)

Definition at line 1324 of file cp_dbcsr_operations.f90.

Referenced by cp_dbcsr_mult_pack_vec_local(), preconditioner::make_sparse_inverse_bif(), and packed_vec_bif_tech2().

Here is the caller graph for this function:

subroutine cp_dbcsr_operations::packed_vec_reduce ( REAL(dp),dimension(:),intent(inout)  pkd_vec,
INTEGER,intent(in)  to,
CHARACTER(LEN=*),intent(in)  scope,
INTEGER,dimension(:),intent(in)  vec_blk_size,
INTEGER,intent(in)  n,
TYPE(dbcsr_mp_obj)  mp_obj,
TYPE(cp_error_type),intent(inout)  error 
) [private]
subroutine,public cp_dbcsr_operations::packed_vec_scale ( REAL(dp),intent(in)  alpha,
REAL(dp),dimension(:),intent(in)  block,
REAL(dp),dimension(:),intent(inout)  pkd,
INTEGER,intent(in)  nvec,
INTEGER,intent(in)  ivec,
INTEGER,dimension(:),intent(in)  vec_blk_size,
CHARACTER(LEN=*),intent(in)  side,
TYPE(cp_error_type),intent(inout)  error 
)

Does one of the operations: left) pkd_ji = alpha * block_jj (block) * pkd_ji for j = 1,..., nvec right) pkd_ij = alpha * pkd_ij * block_jj (block) for j = 1,..., nvec.

Definition at line 1062 of file cp_dbcsr_operations.f90.

Referenced by preconditioner::make_sparse_inverse_bif().

Here is the caller graph for this function:


Variable Documentation

Definition at line 146 of file cp_dbcsr_operations.f90.

CHARACTER(len=*),parameter,private cp_dbcsr_operations::moduleN = 'cp_dbcsr_operations'

Definition at line 102 of file cp_dbcsr_operations.f90.