(git:6a2e663)
cp_cfm_types Module Reference

Represents a complex full matrix distributed on many processors. More...

Functions/Subroutines

subroutine, public cp_cfm_create (matrix, matrix_struct, name)
 Creates a new full matrix with the given structure. More...
 
subroutine, public cp_cfm_release (matrix)
 Releases a full matrix. More...
 
subroutine, public cp_cfm_set_all (matrix, alpha, beta)
 Set all elements of the full matrix to alpha. Besides, set all diagonal matrix elements to beta (if given explicitly). More...
 
subroutine, public cp_cfm_get_element (matrix, irow_global, icol_global, alpha)
 Get the matrix element by its global index. More...
 
subroutine, public cp_cfm_set_element (matrix, irow_global, icol_global, alpha)
 Set the matrix element (irow_global,icol_global) of the full matrix to alpha. More...
 
subroutine, public cp_cfm_get_submatrix (fm, target_m, start_row, start_col, n_rows, n_cols, transpose)
 Extract a sub-matrix from the full matrix: op(target_m)(1:n_rows,1:n_cols) = fm(start_row:start_row+n_rows,start_col:start_col+n_cols). Sub-matrix 'target_m' is replicated on each CPU. Using this call is expensive. More...
 
subroutine, public cp_cfm_set_submatrix (matrix, new_values, start_row, start_col, n_rows, n_cols, alpha, beta, transpose)
 Set a sub-matrix of the full matrix: matrix(start_row:start_row+n_rows,start_col:start_col+n_cols) = alpha*op(new_values)(1:n_rows,1:n_cols) + beta*matrix(start_row:start_row+n_rows,start_col:start_col+n_cols) More...
 
subroutine, public cp_cfm_get_info (matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, matrix_struct, para_env)
 Returns information about a full matrix. More...
 
subroutine, public cp_cfm_to_fm (msource, mtargetr, mtargeti)
 Copy real and imaginary parts of a complex full matrix into separate real-value full matrices. More...
 
subroutine, public cp_fm_to_cfm (msourcer, msourcei, mtarget)
 Construct a complex full matrix by taking its real and imaginary parts from two separate real-value full matrices. More...
 
subroutine, public cp_cfm_start_copy_general (source, destination, para_env, info)
 Initiate the copy operation: get distribution data, post MPI isend and irecvs. More...
 
subroutine, public cp_cfm_finish_copy_general (destination, info)
 Complete the copy operation: wait for comms, unpack, clean up MPI state. More...
 
subroutine, public cp_cfm_cleanup_copy_general (info)
 Complete the copy operation: wait for comms clean up MPI state. More...
 

Detailed Description

Represents a complex full matrix distributed on many processors.

Author
Joost VandeVondele, based on Fawzi's cp_fm_* routines

Function/Subroutine Documentation

◆ cp_cfm_create()

subroutine, public cp_cfm_types::cp_cfm_create ( type(cp_cfm_type), intent(out)  matrix,
type(cp_fm_struct_type), intent(in), target  matrix_struct,
character(len=*), intent(in), optional  name 
)

Creates a new full matrix with the given structure.

Parameters
matrixmatrix to be created
matrix_structstructure of the matrix
namename of the matrix
Note
preferred allocation routine

Definition at line 120 of file cp_cfm_types.F.

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

◆ cp_cfm_release()

subroutine, public cp_cfm_types::cp_cfm_release ( type(cp_cfm_type), intent(inout)  matrix)

Releases a full matrix.

Parameters
matrixthe matrix to release

Definition at line 158 of file cp_cfm_types.F.

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

◆ cp_cfm_set_all()

subroutine, public cp_cfm_types::cp_cfm_set_all ( type(cp_cfm_type), intent(in)  matrix,
complex(kind=dp), intent(in)  alpha,
complex(kind=dp), intent(in), optional  beta 
)

Set all elements of the full matrix to alpha. Besides, set all diagonal matrix elements to beta (if given explicitly).

Parameters
matrixmatrix to initialise
alphavalue of off-diagonal matrix elements
betavalue of diagonal matrix elements (equal to alpha if absent)
Date
12.06.2001
Author
Matthias Krack
Version
1.0

Definition at line 178 of file cp_cfm_types.F.

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

◆ cp_cfm_get_element()

subroutine, public cp_cfm_types::cp_cfm_get_element ( type(cp_cfm_type), intent(in)  matrix,
integer, intent(in)  irow_global,
integer, intent(in)  icol_global,
complex(kind=dp), intent(out)  alpha 
)

Get the matrix element by its global index.

Parameters
matrixfull matrix
irow_globalglobal row index
icol_globalglobal column index
alphamatrix element
History
, TCH, created always return the answer

Definition at line 231 of file cp_cfm_types.F.

Here is the caller graph for this function:

◆ cp_cfm_set_element()

subroutine, public cp_cfm_types::cp_cfm_set_element ( type(cp_cfm_type), intent(in)  matrix,
integer, intent(in)  irow_global,
integer, intent(in)  icol_global,
complex(kind=dp), intent(in)  alpha 
)

Set the matrix element (irow_global,icol_global) of the full matrix to alpha.

Parameters
matrixfull matrix
irow_globalglobal row index
icol_globalglobal column index
alphavalue of the matrix element
Date
12.06.2001
Author
Matthias Krack
Version
1.0

Definition at line 278 of file cp_cfm_types.F.

Here is the caller graph for this function:

◆ cp_cfm_get_submatrix()

subroutine, public cp_cfm_types::cp_cfm_get_submatrix ( type(cp_cfm_type), intent(in)  fm,
complex(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 
)

Extract a sub-matrix from the full matrix: op(target_m)(1:n_rows,1:n_cols) = fm(start_row:start_row+n_rows,start_col:start_col+n_cols). Sub-matrix 'target_m' is replicated on each CPU. Using this call is expensive.

Parameters
fmfull matrix you want to get the elements from
target_m2-D array to store the extracted sub-matrix
start_rowglobal row index of the matrix element target_m(1,1) (defaults to 1)
start_colglobal column index of the matrix element target_m(1,1) (defaults to 1)
n_rowsnumber of rows to extract (defaults to size(op(target_m),1))
n_colsnumber of columns to extract (defaults to size(op(target_m),2))
transposeindicates that the extracted sub-matrix target_m should be transposed: op(target_m) = target_m^T if .TRUE., op(target_m) = target_m if .FALSE. (defaults to false)
History
  • 04.2016 created borrowing from Fawzi's cp_fm_get_submatrix [Lianheng Tong]
  • 01.2018 drop innermost conditional branching [Sergey Chulkov]
Author
Lianheng Tong
Note
Optimized for full column updates. The matrix target_m is replicated and valid on all CPUs.

Definition at line 332 of file cp_cfm_types.F.

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

◆ cp_cfm_set_submatrix()

subroutine, public cp_cfm_types::cp_cfm_set_submatrix ( type(cp_cfm_type), intent(in)  matrix,
complex(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,
complex(kind=dp), intent(in), optional  alpha,
complex(kind=dp), intent(in), optional  beta,
logical, intent(in), optional  transpose 
)

Set a sub-matrix of the full matrix: matrix(start_row:start_row+n_rows,start_col:start_col+n_cols) = alpha*op(new_values)(1:n_rows,1:n_cols) + beta*matrix(start_row:start_row+n_rows,start_col:start_col+n_cols)

Parameters
matrixfull to update
new_valuesreplicated 2-D array that holds new elements of the updated sub-matrix
start_rowglobal row index of the matrix element new_values(1,1) (defaults to 1)
start_colglobal column index of the matrix element new_values(1,1) (defaults to 1)
n_rowsnumber of rows to update (defaults to size(op(new_values),1))
n_colsnumber of columns to update (defaults to size(op(new_values),2))
alphascale factor for the new values (defaults to (1.0,0.0))
betascale factor for the old values (defaults to (0.0,0.0))
transposeindicates that the matrix new_values should be transposed: op(new_values) = new_values^T if .TRUE., op(new_values) = new_values if .FALSE. (defaults to false)
History
  • 04.2016 created borrowing from Fawzi's cp_fm_set_submatrix [Lianheng Tong]
  • 01.2018 drop innermost conditional branching [Sergey Chulkov]
Author
Lianheng Tong
Note
Optimized for alpha=(1.0,0.0), beta=(0.0,0.0) All matrix elements 'new_values' need to be valid on all CPUs

Definition at line 468 of file cp_cfm_types.F.

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

◆ cp_cfm_get_info()

subroutine, public cp_cfm_types::cp_cfm_get_info ( type(cp_cfm_type), intent(in)  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,
complex(kind=dp), dimension(:, :), optional, pointer, contiguous  local_data,
type(cp_blacs_env_type), optional, pointer  context,
type(cp_fm_struct_type), optional, pointer  matrix_struct,
type(mp_para_env_type), optional, pointer  para_env 
)

Returns information about a full matrix.

Parameters
matrixmatrix
namename of the matrix
nrow_globaltotal number of rows
ncol_globaltotal number of columns
nrow_blocknumber of rows per ScaLAPACK block
ncol_blocknumber of columns per ScaLAPACK block
nrow_localnumber of locally stored rows
ncol_localnumber of locally stored columns
row_indicesglobal indices of locally stored rows
col_indicesglobal indices of locally stored columns
local_datalocally stored matrix elements
contextBLACS context
matrix_structmatrix structure
para_envparallel environment
Date
12.06.2001
Author
Matthias Krack
Version
1.0

Definition at line 603 of file cp_cfm_types.F.

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

◆ cp_cfm_to_fm()

subroutine, public cp_cfm_types::cp_cfm_to_fm ( type(cp_cfm_type), intent(in)  msource,
type(cp_fm_type), intent(in), optional  mtargetr,
type(cp_fm_type), intent(in), optional  mtargeti 
)

Copy real and imaginary parts of a complex full matrix into separate real-value full matrices.

Parameters
msourcecomplex matrix
mtargetr(optional) real part of the source matrix
mtargeti(optional) imaginary part of the source matrix
Note
Matrix structures are assumed to be equivalent.

Definition at line 764 of file cp_cfm_types.F.

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

◆ cp_fm_to_cfm()

subroutine, public cp_cfm_types::cp_fm_to_cfm ( type(cp_fm_type), intent(in), optional  msourcer,
type(cp_fm_type), intent(in), optional  msourcei,
type(cp_cfm_type), intent(in)  mtarget 
)

Construct a complex full matrix by taking its real and imaginary parts from two separate real-value full matrices.

Parameters
msourcer(optional) real part of the complex matrix (defaults to 0.0)
msourcei(optional) imaginary part of the complex matrix (defaults to 0.0)
mtargetresulting complex matrix
Note
Matrix structures are assumed to be equivalent.

Definition at line 816 of file cp_cfm_types.F.

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

◆ cp_cfm_start_copy_general()

subroutine, public cp_cfm_types::cp_cfm_start_copy_general ( type(cp_cfm_type), intent(in)  source,
type(cp_cfm_type), intent(in)  destination,
type(mp_para_env_type), intent(in), pointer  para_env,
type(copy_cfm_info_type), intent(out)  info 
)

Initiate the copy operation: get distribution data, post MPI isend and irecvs.

Parameters
sourceinput complex-valued fm matrix
destinationoutput complex-valued fm matrix
para_envparallel environment corresponding to the BLACS env that covers all parts of the input and output matrices
infoall of the data that will be needed to complete the copy operation
Note
a slightly modified version of the subroutine cp_fm_start_copy_general() that uses allocatable arrays instead of pointers wherever possible.

Definition at line 878 of file cp_cfm_types.F.

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

◆ cp_cfm_finish_copy_general()

subroutine, public cp_cfm_types::cp_cfm_finish_copy_general ( type(cp_cfm_type), intent(in)  destination,
type(copy_cfm_info_type), intent(inout)  info 
)

Complete the copy operation: wait for comms, unpack, clean up MPI state.

Parameters
destinationoutput cfm matrix
infoall of the data that will be needed to complete the copy operation
Note
a slightly modified version of the subroutine cp_fm_finish_copy_general() that uses allocatable arrays instead of pointers wherever possible.

Definition at line 1190 of file cp_cfm_types.F.

Here is the caller graph for this function:

◆ cp_cfm_cleanup_copy_general()

subroutine, public cp_cfm_types::cp_cfm_cleanup_copy_general ( type(copy_cfm_info_type), intent(inout)  info)

Complete the copy operation: wait for comms clean up MPI state.

Parameters
infoall of the data that will be needed to complete the copy operation
Note
a slightly modified version of the subroutine cp_fm_cleanup_copy_general() that uses allocatable arrays instead of pointers wherever possible.

Definition at line 1257 of file cp_cfm_types.F.

Here is the caller graph for this function: