CP2K 2.4 (Revision 12889)
Classes | Functions | Variables

cp_fm_types Namespace Reference

represent a full matrix distribued on many processors More...

Classes

interface  cp_fm_to_fm
struct  cp_fm_type
 represent a full matrix More...
struct  cp_fm_p_type
 just to build arrays of pointers to matrixes More...

Functions

subroutine, public cp_fm_create (matrix, matrix_struct, name, use_sp, error)
 creates a new full matrix with the given structure
subroutine, public cp_fm_retain (matrix, error)
 retains a full matrix
subroutine, public cp_fm_release (matrix, error)
 releases a full matrix
subroutine, public cp_fm_init_random (matrix, ncol, start_col, error)
 fills a matrix with random numbers
subroutine, public cp_fm_set_all (matrix, alpha, beta, error)
 set all elements of a matrix to the same value, and optionally the diagonal to a different one
subroutine, public cp_fm_get_diag (matrix, diag, error)
 returns the diagonal elements of a fm
subroutine, public cp_fm_set_diag (matrix, diag, error)
 returns the diagonal elements of a fm
subroutine, public cp_fm_get_element (matrix, irow_global, icol_global, alpha, local)
 returns an element of a fm this value is valid on every cpu using this call is expensive
subroutine, public cp_fm_set_element (matrix, irow_global, icol_global, alpha, error)
 sets an element of a matrix
subroutine, public cp_fm_set_submatrix (fm, new_values, start_row, start_col, n_rows, n_cols, alpha, beta, transpose, error)
 sets a submatrix of a full matrix fm(start_row:start_row+n_rows,start_col:start_col+n_cols) = alpha*op(new_values)(1:n_rows,1:n_cols)+ beta * fm(start_row:start_row+n_rows,start_col:start_col+n_cols)
subroutine, public cp_fm_get_submatrix (fm, target_m, start_row, start_col, n_rows, n_cols, transpose, error)
 gets a submatrix of a full matrix op(target_m)(1:n_rows,1:n_cols) =fm(start_row:start_row+n_rows,start_col:start_col+n_cols) target_m is replicated on all cpus using this call is expensive
subroutine, public cp_fm_get_info (matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, nrow_locals, ncol_locals, matrix_struct, para_env, error)
 returns all kind of information about the full matrix
subroutine, public cp_fm_maxabsval (matrix, a_max, ir_max, ic_max, error)
 find the maximum absolute value of the matrix element maxval(abs(matrix))
subroutine, public cp_fm_maxabsrownorm (matrix, a_max, error)
 find the maximum over the rows of the sum of the absolute values of the elements of a given row = || A ||_infinity
subroutine, public cp_fm_vectorsnorm (matrix, norm_array, error)
 find the inorm of each column norm_{j}= sqrt( {i} A_{ij}*A_{ij} )
subroutine, public cp_fm_write (matrix, unit_nr, long_description, local, error)
 writes out the matrix (if long description, might need some refactoring
subroutine cp_fm_to_fm_matrix (source, destination, error)
 copy one identically sized matrix in the other
subroutine cp_fm_to_fm_columns (msource, mtarget, ncol, source_start, target_start)
 copy just a subset of columns of a fm to a fm
subroutine, public cp_fm_to_fm_submat (msource, mtarget, nrow, ncol, s_firstrow, s_firstcol, t_firstrow, t_firstcol, error)
subroutine, public cp_fm_add_to_element (matrix, irow_global, icol_global, alpha, error)
subroutine, public cp_fm_write_unformatted (fm, unit, error)
subroutine, public cp_fm_read_unformatted (fm, unit, error)
INTEGER, public cp_fm_indxg2p (INDXGLOB, NB, IPROC, ISRCPROC, NPROCS)
 wrapper to scalapack function INDXG2P that computes the process
INTEGER, public cp_fm_indxg2l (INDXGLOB, NB, IPROC, ISRCPROC, NPROCS)
 wrapper to scalapack function INDXG2L that computes the local index
INTEGER, public cp_fm_indxl2g (INDXLOC, NB, IPROC, ISRCPROC, NPROCS)
 wrapper to scalapack function INDXL2G that computes the global index

Variables

CHARACTER(len=*), parameter,
private 
moduleN = 'cp_fm_types'
LOGICAL, parameter debug_this_module = .TRUE.
INTEGER, save last_fm_id_nr = 0

Detailed Description

represent a full matrix distribued on many processors

History
3) separated structure object, removed globenv, renamed to full matrix many changes (fawzi 08.2002)
Author:
Matthias Krack (22.05.2001)

Function Documentation

subroutine,public cp_fm_types::cp_fm_add_to_element ( TYPE(cp_fm_type),pointer  matrix,
INTEGER,intent(in)  irow_global,
INTEGER,intent(in)  icol_global,
REAL(KIND=dp),intent(in)  alpha,
TYPE(cp_error_type),intent(inout)  error 
)

Definition at line 1568 of file cp_fm_types.f90.

Referenced by qs_scf_diagonalization::do_roks_diag().

Here is the caller graph for this function:

subroutine,public cp_fm_types::cp_fm_create ( TYPE(cp_fm_type),pointer  matrix,
TYPE(cp_fm_struct_type),pointer  matrix_struct,
CHARACTER(len=*),intent(in),optional  name,
LOGICAL,intent(in),optional  use_sp,
TYPE(cp_error_type),intent(inout)  error 
)

creates a new full matrix with the given structure

Parameters:
matrixthe matrix to be created
matrix_structthe structure of matrix
errorvariable to control error logging, stopping,... see module cp_error_handling
Note:
preferred allocation routine
History
08.2002 created [fawzi]
Author:
Fawzi Mohamed

Definition at line 144 of file cp_fm_types.f90.

References CPPostcondition, last_fm_id_nr, and timings::timeset().

Referenced by xc_pot_saop::add_saop_pot(), admm_types::admm_env_create(), qs_tddfpt_eigensolver::allocate_krylov_vectors(), rt_propagation::apply_delta_pulse(), rt_propagation::apply_delta_pulse_periodic(), preconditioner::apply_full_all(), preconditioner::apply_full_direct(), preconditioner::apply_solve_lin_system_fm(), qs_localization_methods::approx_l1_norm_sd(), rt_matrix_exp::arnoldi(), rt_propagation_methods::aspc_extrapolate(), rt_matrix_exp::backtransform_matrix(), qs_block_davidson_types::block_davidson_allocate(), rt_propagation_utils::calc_c_mat_force(), et_coupling::calc_et_coupling(), rt_propagation_utils::calc_S_derivs(), rt_propagation_methods::calc_SinvH(), qs_mo_methods::calculate_dm_sparse(), rt_propagation_utils::calculate_dp_imag(), qs_initial_guess::calculate_first_density_matrix(), mp2_ri_gpw::calculate_Lmin1(), qs_mo_methods::calculate_magnitude(), qs_mo_methods::calculate_orthonormality(), qs_pdos::calculate_projected_dos(), qs_ks_methods::calculate_w_matrix_1(), qs_ks_methods::calculate_w_matrix_ot(), qs_ks_methods::calculate_w_matrix_roks(), qs_localization_methods::check_tolerance(), qs_loc_utils::check_tolerance_real(), s_square_methods::compute_s_square(), molecular_states::construct_molecular_states(), wannier_states::construct_wannier_states(), 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_operations::cp_dbcsr_copy_columns_hack(), cp_dbcsr_operations::cp_dbcsr_plus_fm_fm_t_native(), cp_dbcsr_diag::cp_dbcsr_syevd(), cp_dbcsr_diag::cp_dbcsr_syevr(), cp_dbcsr_diag::cp_dbcsr_syevx(), library_tests::cp_fm_gemm_test(), cp_fm_basic_linalg::cp_fm_invert(), cp_fm_diag::cp_fm_syevd(), qs_localization_methods::crazy_rotations(), rpa_ri_gpw::create_integ_mat(), qs_linres_current::current_build_chi_many_centers(), qs_linres_current::current_build_chi_one_center(), qs_linres_current::current_build_current(), qs_linres_current_utils::current_env_init(), qs_linres_op::current_operators(), qs_linres_current_utils::current_response(), qs_localization_methods::direct_mini(), dkh_main::DKH_full_transformation(), qs_mo_types::duplicate_mo_set(), library_tests::eigensolver_test(), dkh_main::even2c(), dkh_main::even3b(), rt_matrix_exp::exp_diag(), rt_matrix_exp::exp_pade_only_imaginary(), rt_matrix_exp::exp_pade_real(), qs_tddfpt_utils::find_contributions(), cp_fm_pool_types::fm_pool_create_fm(), xc_pot_saop::gapw_add_atomic_saop_pot(), qs_scf_block_davidson::generate_extended_space(), qs_scf_block_davidson::generate_extended_space_sparse(), qs_pdos::generate_virtual_mo(), bfgs_optimizer::geoopt_bfgs(), bfgs_optimizer::geoopt_get_step(), rt_propagator_init::get_maxabs_eigval(), qs_linres_issc_utils::issc_env_init(), qs_linres_issc_utils::issc_response(), qs_tddfpt_eigensolver::iterative_solver(), qs_localization_methods::jacobi_rot_para(), qs_loc_utils::jacobi_rotation_pipek(), qs_localization_methods::jacobi_rotations_serial(), qs_scf_lanczos::krylov_space_allocate(), qs_scf_lanczos::lanczos_refinement(), qs_scf_lanczos::lanczos_refinement_2v(), qs_linres_methods::linres_localize(), qs_linres_methods::linres_solver(), dft_plus_u::lowdin(), population_analyses::lowdin_population_analysis(), qs_mo_methods::make_basis_cholesky(), qs_mo_methods::make_basis_lowdin(), qs_mo_methods::make_basis_simple(), qs_mo_methods::make_basis_sm(), qs_mo_methods::make_basis_sv_dbcsr(), qs_mo_methods::make_basis_sv_fm(), rt_make_propagators::make_em_propagator(), rt_make_propagators::make_etrs_exp(), preconditioner::make_full_all(), preconditioner::make_full_all_ortho(), 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(), qs_scf_post_gpw::make_lumo(), preconditioner::make_sparse_inverse_bif(), dkh_main::mat_arxra(), dkh_main::mat_axa(), mp2_gpw::mp2_gpw_compute(), mp2::mp2_main(), mp2_ri_gpw::mp2_ri_gpw_compute_in(), qs_moments::op_orbbas_rtp(), qs_conductivity::optical_conductivity(), qs_loc_methods::optimize_loc_berry(), qs_loc_methods::optimize_loc_pipek(), qs_p_env_methods::p_postortho(), qs_p_env_methods::p_preortho(), dkh_main::peven1p(), rt_make_propagators::propagate_arnoldi(), rt_propagation_methods::propagate_cn_or_em(), rt_propagation_methods::propagate_etrs(), rt_propagation_methods::propagation_step(), qs_diis::qs_diis_b_check_i_alloc(), 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_loc_methods::qs_loc_driver(), qs_loc_utils::qs_loc_env_init(), qs_moments::qs_moment_berry_phase(), qs_scf_post_gpw::qs_scf_post_et(), qs_scf_post_gpw::qs_scf_post_molopt(), mp2_gpw::replicate_mat_to_subgroup(), qs_loc_utils::retain_history(), qs_scf_block_davidson::ritz_coefficients(), qs_localization_methods::rotate_orbitals(), qs_loc_utils::rotate_state_to_ref(), rt_propagation_output::rt_calculate_orthonormality(), rt_propagation_output::rt_convergence(), rt_propagation_types::rt_prop_create(), rtp_admm_methods::rtp_fit_mo_coeffs_none(), rt_propagation_types::rtp_history_create(), rt_propagation_methods::s_matrices_create(), qs_scf::scf_env_check_i_alloc(), qs_scf_post_gpw::scf_post_calculation_gpw(), qs_scf_post_se::scf_post_calculation_se(), qs_ks_methods::sic_explicit_orbitals(), stm_images::stm_cubes(), qs_mo_methods::subspace_eigenvalues_ks_fm(), rt_matrix_exp::taylor_only_imaginary(), qs_tddfpt_types::tddfpt_env_allocate(), stm_images::th_stm_image(), qs_wf_history_methods::wfi_extrapolate(), qs_scf_post_gpw::wfn_mix(), qs_wf_history_methods::wfs_duplicate_snapshot(), and xas_methods::xas_env_init().

Here is the call graph for this function:

subroutine,public cp_fm_types::cp_fm_get_diag ( TYPE(cp_fm_type),pointer  matrix,
REAL(KIND = dp),dimension(:),intent(out)  diag,
TYPE(cp_error_type),intent(inout)  error 
)

returns the diagonal elements of a fm

Definition at line 432 of file cp_fm_types.f90.

References cp_fm_get_info().

Referenced by qs_scf_block_davidson::generate_extended_space(), and qs_scf_block_davidson::ritz_coefficients().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_fm_types::cp_fm_get_element ( TYPE(cp_fm_type),pointer  matrix,
INTEGER,intent(in)  irow_global,
INTEGER,intent(in)  icol_global,
REAL(KIND = dp),intent(out)  alpha,
LOGICAL,intent(out),optional  local 
)

returns an element of a fm this value is valid on every cpu using this call is expensive

Parameters:
matrixthe matrix to read
irow_globalthe row
icol_globalthe col
alphathe value of matrix(irow_global, icol_global)
localtrue if the element is on this cpu, false otherwise
Note:
  • modified semantics. now this function always returns the value previously the value was zero on cpus that didn't own the relevant part of the matrix (Joost VandeVondele, May 2003)
  • usage of the function should be avoided, as it is likely to rather slow using row_indices/col_indices/local_data + some smart scheme normally yields a real parallel code

Definition at line 574 of file cp_fm_types.f90.

Referenced by qs_collocate_density::calculate_wavefunction(), qs_loc_methods::centers_spreads_berry(), qs_loc_methods::centers_spreads_pipek(), qs_localization_methods::check_tolerance_new(), qs_loc_utils::check_tolerance_real(), cp_fm_basic_linalg::cp_fm_invert(), cp_fm_basic_linalg::cp_fm_lu_decompose(), qs_localization_methods::crazy_rotations(), qs_scf_methods::eigensolver(), qs_loc_utils::jacobi_rotation_pipek(), and qs_scf_methods::simple_eigensolver().

Here is the caller graph for this function:

subroutine,public cp_fm_types::cp_fm_get_info ( TYPE(cp_fm_type),pointer  matrix,
CHARACTER(LEN=*),intent(out),optional  name,
INTEGER,intent(out),optional  nrow_global,
INTEGER,intent(out),optional  ncol_global,
INTEGER,intent(out),optional  nrow_block,
INTEGER,intent(out),optional  ncol_block,
INTEGER,intent(out),optional  nrow_local,
INTEGER,intent(out),optional  ncol_local,
INTEGER,dimension(:),optional,pointer  row_indices,
INTEGER,dimension(:),optional,pointer  col_indices,
REAL(KIND = dp),dimension(:,:),optional,pointer  local_data,
TYPE(cp_blacs_env_type),optional,pointer  context,
INTEGER,dimension(:),optional,pointer  nrow_locals,
INTEGER,dimension(:),optional,pointer  ncol_locals,
TYPE(cp_fm_struct_type),optional,pointer  matrix_struct,
TYPE(cp_para_env_type),optional,pointer  para_env,
TYPE(cp_error_type),intent(inout)  error 
)

returns all kind of information about the full matrix

Note:
see also cp_fm_struct for explaination
  • nrow_local, ncol_local, row_indices, col_indices, local_data are hooks for efficient access to the local blacs block

Definition at line 962 of file cp_fm_types.f90.

References error.

Referenced by qs_loc_methods::centers_spreads_berry(), qs_loc_methods::centers_spreads_pipek(), qs_localization_methods::check_tolerance_new(), qs_loc_utils::check_tolerance_real(), cp_fm_get_diag(), cp_fm_get_submatrix(), cp_fm_init_random(), cp_fm_maxabsrownorm(), cp_fm_maxabsval(), cp_fm_read_unformatted(), cp_fm_set_diag(), cp_fm_set_submatrix(), cp_fm_basic_linalg::cp_fm_triangular_multiply(), cp_fm_vectorsnorm(), cp_fm_write_unformatted(), qs_localization_methods::crazy_rotations(), ep_methods::ep_env_localize_matrix(), ep_methods::ep_env_transfer_psi0(), xas_restart::find_excited_core_orbital(), rpa_communication::fm_redistribute(), qs_localization_methods::grad_at_0(), qs_localization_methods::gradsq_at_0(), qs_mo_types::init_mo_set(), rpa_communication::initialize_buffer(), qs_linres_op::issc_operators(), qs_localization_methods::jacobi_rot_para(), qs_loc_utils::jacobi_rotation_pipek(), qs_localization_methods::jacobi_rotations_serial(), mp2_laplace::laplace_minimax_approx(), qs_loc_utils::loc_write_restart(), qs_loc_methods::optimize_loc_berry(), qs_loc_methods::optimize_loc_pipek(), qs_ot_eigensolver::ot_eigensolver(), qs_p_sparse_psi::p_proj_restrain_f(), qs_p_sparse_psi::p_proj_transfer_blacs_to_f(), hfx_admm_utils::pw_hfx(), qs_environment_types::qs_env_reorthogonalize_vectors(), qs_loc_methods::qs_loc_driver(), qs_loc_utils::qs_loc_env_init(), qs_loc_utils::retain_history(), qs_scf_block_davidson::ritz_coefficients(), qs_localization_methods::rotate_orbitals(), qs_loc_utils::rotate_rmat_real(), qs_loc_utils::rotate_state_to_ref(), qs_loc_utils::rotate_zij_real(), cp_dbcsr_output::write_fm_with_basis_info(), qs_mo_types::write_mo_set_low(), and qs_mo_types::write_mo_set_to_output_unit().

Here is the caller graph for this function:

subroutine,public cp_fm_types::cp_fm_get_submatrix ( TYPE(cp_fm_type),pointer  fm,
REAL(KIND=dp),dimension(:, :),intent(out)  target_m,
INTEGER,intent(in),optional  start_row,
INTEGER,intent(in),optional  start_col,
INTEGER,intent(in),optional  n_rows,
INTEGER,intent(in),optional  n_cols,
LOGICAL,intent(in),optional  transpose,
TYPE(cp_error_type),intent(inout)  error 
)

gets a submatrix of a full matrix op(target_m)(1:n_rows,1:n_cols) =fm(start_row:start_row+n_rows,start_col:start_col+n_cols) target_m is replicated on all cpus using this call is expensive

Parameters:
target_ma replicated full matrix that will contain the result
fmthe full you want to get the info from
start_rowthe starting row of b_matrix (defaults to 1)
start_colthe starting col of b_matrix (defaults to 1)
n_rowsthe number of row to change in b (defaults to size(op(new_values),1))
n_colsthe number of columns to change in b (defaults to size(op(new_values),2))
transposeif target_m should be transposed: if true op(target_m)=target_m^T, else op(target_m)=target_m (defaults to false)
errorvariable to control error logging, stopping,... see module cp_error_handling
Note:
optimized for full column updates. Zeros out a little too much of target_m the target_m is replicated and valid on all cpus
History
07.2002 created borrowing from Joost's blacs_replicated_copy [fawzi]
Author:
Fawzi Mohamed

Definition at line 854 of file cp_fm_types.f90.

References cp_fm_get_info(), error, and timings::timeset().

Referenced by qs_initial_guess::calculate_first_density_matrix(), xas_tp_scf::cls_prepare_states(), cp_fm_basic_linalg::cp_fm_qr_factorization(), qs_linres_op::current_operators(), qs_localization_methods::jacobi_rot_para(), qs_scf_lanczos::lanczos_refinement(), qs_scf_lanczos::lanczos_refinement_2v(), qs_loc_methods::qs_loc_driver(), qs_loc_utils::qs_loc_env_init(), and qs_mo_types::write_mo_set_to_output_unit().

Here is the call graph for this function:

Here is the caller graph for this function:

INTEGER,public cp_fm_types::cp_fm_indxg2l ( INTEGER,intent(in)  INDXGLOB,
INTEGER,intent(in)  NB,
INTEGER,intent(in)  IPROC,
INTEGER,intent(in)  ISRCPROC,
INTEGER,intent(in)  NPROCS 
)

wrapper to scalapack function INDXG2L that computes the local index

Author:
Mauro Del Ben [MDB] - 12.2012

Definition at line 1861 of file cp_fm_types.f90.

INTEGER,public cp_fm_types::cp_fm_indxg2p ( INTEGER,intent(in)  INDXGLOB,
INTEGER,intent(in)  NB,
INTEGER,intent(in)  IPROC,
INTEGER,intent(in)  ISRCPROC,
INTEGER,intent(in)  NPROCS 
)

wrapper to scalapack function INDXG2P that computes the process

Author:
Mauro Del Ben [MDB] - 12.2012

Definition at line 1810 of file cp_fm_types.f90.

INTEGER,public cp_fm_types::cp_fm_indxl2g ( INTEGER,intent(in)  INDXLOC,
INTEGER,intent(in)  NB,
INTEGER,intent(in)  IPROC,
INTEGER,intent(in)  ISRCPROC,
INTEGER,intent(in)  NPROCS 
)

wrapper to scalapack function INDXL2G that computes the global index

Author:
Mauro Del Ben [MDB] - 12.2012

Definition at line 1913 of file cp_fm_types.f90.

subroutine,public cp_fm_types::cp_fm_init_random ( TYPE(cp_fm_type),pointer  matrix,
INTEGER,intent(in),optional  ncol,
INTEGER,intent(in),optional  start_col,
TYPE(cp_error_type),intent(inout)  error 
)

fills a matrix with random numbers

Parameters:
matrix: to be initialized
ncol: numbers of cols to fill
start_col: starting at coll number
Note:
the value of a_ij is independent of the number of cpus
Author:
Joost VandeVondele

Definition at line 307 of file cp_fm_types.f90.

References cp_fm_get_info(), timings::timeset(), and parallel_rng_types::UNIFORM.

Referenced by qs_initial_guess::calculate_first_density_matrix().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_fm_types::cp_fm_maxabsrownorm ( TYPE(cp_fm_type),pointer  matrix,
REAL(KIND=dp),intent(out)  a_max,
TYPE(cp_error_type),intent(inout)  error 
)

find the maximum over the rows of the sum of the absolute values of the elements of a given row = || A ||_infinity

Note:
for a real symmetric matrix it holds that || A ||_2 = |lambda_max| < || A ||_infinity Hence this can be used to estimate an upper bound for the eigenvalues of a matrix http://mathworld.wolfram.com/MatrixNorm.html (but the bound is not so tight in the general case)

Definition at line 1130 of file cp_fm_types.f90.

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

Referenced by qs_localization_methods::crazy_rotations().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_fm_types::cp_fm_maxabsval ( TYPE(cp_fm_type),pointer  matrix,
REAL(KIND=dp),intent(out)  a_max,
INTEGER,intent(out),optional  ir_max,
INTEGER,intent(out),optional  ic_max,
TYPE(cp_error_type),intent(inout)  error 
)

find the maximum absolute value of the matrix element maxval(abs(matrix))

Definition at line 1021 of file cp_fm_types.f90.

References cp_fm_get_info(), CPPostcondition, and timings::timeset().

Referenced by qs_localization_methods::check_tolerance(), qs_loc_utils::check_tolerance_real(), and qs_localization_methods::direct_mini().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_fm_types::cp_fm_read_unformatted ( TYPE(cp_fm_type),pointer  fm,
INTEGER  unit,
TYPE(cp_error_type),intent(inout)  error 
)

Definition at line 1724 of file cp_fm_types.f90.

References cp_fm_get_info(), cp_fm_set_submatrix(), CPPostcondition, and timings::timeset().

Here is the call graph for this function:

subroutine,public cp_fm_types::cp_fm_release ( TYPE(cp_fm_type),pointer  matrix,
TYPE(cp_error_type),intent(inout)  error 
)
subroutine,public cp_fm_types::cp_fm_retain ( TYPE(cp_fm_type),pointer  matrix,
TYPE(cp_error_type),intent(inout)  error 
)

retains a full matrix

Parameters:
matrixthe matrix to retain
errorvariable to control error logging, stopping,... see module cp_error_handling
History
08.2002 created [fawzi]
Author:
Fawzi Mohamed

Definition at line 232 of file cp_fm_types.f90.

subroutine,public cp_fm_types::cp_fm_set_all ( TYPE(cp_fm_type),pointer  matrix,
REAL(KIND=dp),intent(in)  alpha,
REAL(KIND=dp),intent(in),optional  beta,
TYPE(cp_error_type),intent(inout)  error 
)
subroutine,public cp_fm_types::cp_fm_set_diag ( TYPE(cp_fm_type),pointer  matrix,
REAL(KIND = dp),dimension(:),intent(in)  diag,
TYPE(cp_error_type),intent(inout)  error 
)

returns the diagonal elements of a fm

Definition at line 500 of file cp_fm_types.f90.

References cp_fm_get_info().

Here is the call graph for this function:

subroutine,public cp_fm_types::cp_fm_set_element ( TYPE(cp_fm_type),pointer  matrix,
INTEGER,intent(in)  irow_global,
INTEGER,intent(in)  icol_global,
REAL(KIND=dp),intent(in)  alpha,
TYPE(cp_error_type),intent(inout)  error 
)

sets an element of a matrix

Note:
we expect all cpus to have the same arguments in the call to this function (otherwise one should use local_data tricks)

Definition at line 632 of file cp_fm_types.f90.

Referenced by cp_fm_set_all().

Here is the caller graph for this function:

subroutine,public cp_fm_types::cp_fm_set_submatrix ( TYPE(cp_fm_type),pointer  fm,
REAL(KIND=dp),dimension(:, :),intent(in)  new_values,
INTEGER,intent(in),optional  start_row,
INTEGER,intent(in),optional  start_col,
INTEGER,intent(in),optional  n_rows,
INTEGER,intent(in),optional  n_cols,
REAL(KIND=dp),intent(in),optional  alpha,
REAL(KIND=dp),intent(in),optional  beta,
LOGICAL,intent(in),optional  transpose,
TYPE(cp_error_type),intent(inout)  error 
)

sets a submatrix of a full matrix fm(start_row:start_row+n_rows,start_col:start_col+n_cols) = alpha*op(new_values)(1:n_rows,1:n_cols)+ beta * fm(start_row:start_row+n_rows,start_col:start_col+n_cols)

Parameters:
new_valuesa replicated full matrix with the new values
fmthe full to change
start_rowthe starting row of b_matrix (defaults to 1)
start_colthe starting col of b_matrix (defaults to 1)
n_rowsthe number of row to change in b (defaults to size(op(new_values),1))
n_colsthe number of columns to change in b (defaults to size(op(new_values),2))
alpharescaling factor for the new values (defaults to 1.0)
betarescaling factor for the old values (defaults to 0.0)
transposeif new_values should be transposed: if true op(new_values)=new_values^T, else op(new_values)=new_values (defaults to false)
errorvariable to control error logging, stopping,... see module cp_error_handling
Note:
optimized for full column updates and alpha=1.0, beta=0.0 the new_values need to be valid on all cpus
History
07.2002 created borrowing from Joost's blacs_replicated_copy [fawzi]
Author:
Fawzi Mohamed

Definition at line 706 of file cp_fm_types.f90.

References cp_fm_get_info(), and error.

Referenced by qs_initial_guess::calculate_first_density_matrix(), cp_fm_basic_linalg::cp_fm_qr_factorization(), cp_fm_read_unformatted(), qs_linres_op::current_operators(), qs_localization_methods::jacobi_rot_para(), qs_scf_lanczos::lanczos_refinement(), qs_loc_utils::loc_read_restart(), qs_loc_methods::qs_loc_driver(), qs_loc_utils::qs_loc_env_init(), and qs_mo_types::read_mos_restart_low().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine cp_fm_types::cp_fm_to_fm_columns ( TYPE(cp_fm_type),pointer  msource,
TYPE(cp_fm_type),pointer  mtarget,
INTEGER,intent(in)  ncol,
INTEGER,intent(in),optional  source_start,
INTEGER,intent(in),optional  target_start 
) [private]

copy just a subset of columns of a fm to a fm

Definition at line 1448 of file cp_fm_types.f90.

References timings::timeset().

Here is the call graph for this function:

subroutine cp_fm_types::cp_fm_to_fm_matrix ( TYPE(cp_fm_type),pointer  source,
TYPE(cp_fm_type),pointer  destination,
TYPE(cp_error_type),intent(inout)  error 
) [private]

copy one identically sized matrix in the other

Note:
see also cp_fm_to_fm_columns

Definition at line 1332 of file cp_fm_types.f90.

References message_passing::cp2k_is_parallel, cp_fm_struct::cp_fm_struct_equivalent(), CPAssert, and timings::timeset().

Here is the call graph for this function:

subroutine,public cp_fm_types::cp_fm_to_fm_submat ( TYPE(cp_fm_type),pointer  msource,
TYPE(cp_fm_type),pointer  mtarget,
INTEGER,intent(in)  nrow,
INTEGER,intent(in)  ncol,
INTEGER,intent(in)  s_firstrow,
INTEGER,intent(in)  s_firstcol,
INTEGER,intent(in)  t_firstrow,
INTEGER,intent(in)  t_firstcol,
TYPE(cp_error_type),intent(inout)  error 
)

Definition at line 1491 of file cp_fm_types.f90.

References timings::timeset().

Referenced by qs_scf_block_davidson::generate_extended_space(), qs_scf_block_davidson::generate_extended_space_sparse(), and qs_scf_block_davidson::ritz_coefficients().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_fm_types::cp_fm_vectorsnorm ( TYPE(cp_fm_type),pointer  matrix,
REAL(KIND=dp),dimension(:),intent(out)  norm_array,
TYPE(cp_error_type),intent(inout)  error 
)

find the inorm of each column norm_{j}= sqrt( {i} A_{ij}*A_{ij} )

Definition at line 1172 of file cp_fm_types.f90.

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

Referenced by qs_scf_block_davidson::generate_extended_space(), qs_scf_lanczos::lanczos_refinement(), and qs_scf_lanczos::lanczos_refinement_2v().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public cp_fm_types::cp_fm_write ( TYPE(cp_fm_type),pointer  matrix,
INTEGER,intent(in)  unit_nr,
LOGICAL,intent(in),optional  long_description,
LOGICAL,intent(in),optional  local,
TYPE(cp_error_type),intent(inout)  error 
)

writes out the matrix (if long description, might need some refactoring

Parameters:
matrixthe matrix to output
unit_nrthe unit where to output
long_descriptionif a long description should be written (is needed to see the content of the matrix) (defaults to false)
localif the unit is a local unit or a global unit (defaults to false, i.e. global)
errorvariable to control error logging, stopping,... see module cp_error_handling
Note:
uniquing_nr should be smartened: don't add if no file exist, else increase nr until no file exists routine to help debugging
History
08.2002 created [fawzi]
Author:
Fawzi Mohamed

Definition at line 1229 of file cp_fm_types.f90.

References cp_files::close_file(), string_utilities::compress(), and cp_array_r_utils::cp_2d_r_write().

Here is the call graph for this function:

subroutine,public cp_fm_types::cp_fm_write_unformatted ( TYPE(cp_fm_type),pointer  fm,
INTEGER  unit,
TYPE(cp_error_type),intent(inout)  error 
)

Definition at line 1626 of file cp_fm_types.f90.

References cp_fm_get_info(), CPPostcondition, and timings::timeset().

Referenced by qs_loc_utils::loc_write_restart(), and qs_mo_types::write_mo_set_low().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

LOGICAL,parameter cp_fm_types::debug_this_module = .TRUE.

Definition at line 56 of file cp_fm_types.f90.

Definition at line 58 of file cp_fm_types.f90.

Referenced by cp_fm_create().

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

Definition at line 55 of file cp_fm_types.f90.