(git:34ef472)
|
represent a full matrix distributed on many processors More...
Functions/Subroutines | |
subroutine, public | cp_fm_create (matrix, matrix_struct, name, use_sp) |
creates a new full matrix with the given structure More... | |
subroutine, public | cp_fm_init_random (matrix, ncol, start_col) |
fills a matrix with random numbers More... | |
subroutine, public | cp_fm_set_all (matrix, alpha, beta) |
set all elements of a matrix to the same value, and optionally the diagonal to a different one More... | |
subroutine, public | cp_fm_get_diag (matrix, diag) |
returns the diagonal elements of a fm More... | |
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 More... | |
subroutine, public | cp_fm_set_element (matrix, irow_global, icol_global, alpha) |
sets an element of a matrix More... | |
subroutine, public | cp_fm_set_submatrix (fm, new_values, start_row, start_col, n_rows, n_cols, alpha, beta, transpose) |
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 More... | |
subroutine, public | cp_fm_get_submatrix (fm, target_m, start_row, start_col, n_rows, n_cols, transpose) |
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 More... | |
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) |
returns all kind of information about the full matrix More... | |
subroutine, public | cp_fm_write_info (matrix, io_unit) |
Write nicely formatted info about the FM to the given I/O unit (including the underlying FM struct) More... | |
subroutine, public | cp_fm_maxabsval (matrix, a_max, ir_max, ic_max) |
find the maximum absolute value of the matrix element maxval(abs(matrix)) More... | |
subroutine, public | cp_fm_maxabsrownorm (matrix, a_max) |
find the maximum over the rows of the sum of the absolute values of the elements of a given row = || A ||_infinity More... | |
subroutine, public | cp_fm_vectorsnorm (matrix, norm_array) |
find the inorm of each column norm_{j}= sqrt( \sum_{i} A_{ij}*A_{ij} ) More... | |
subroutine, public | cp_fm_vectorssum (matrix, sum_array, dir) |
summing up all the elements along the matrix's i-th index \( \mathrm{sum}_{j} = \sum_{i} A_{ij} \) or \( \mathrm{sum}_{i} = \sum_{j} A_{ij} \) More... | |
subroutine, public | cp_fm_to_fm_triangular (msource, mtarget, uplo) |
copy just a triangular matrix More... | |
subroutine, public | cp_fm_to_fm_submat (msource, mtarget, nrow, ncol, s_firstrow, s_firstcol, t_firstrow, t_firstcol) |
copy just a part ot the matrix More... | |
subroutine, public | cp_fm_copy_general (source, destination, para_env) |
General copy of a fm matrix to another fm matrix. Uses non-blocking MPI rather than ScaLAPACK. More... | |
subroutine, public | cp_fm_start_copy_general (source, destination, para_env, info) |
Initiates the copy operation: get distribution data, post MPI isend and irecvs. More... | |
subroutine, public | cp_fm_finish_copy_general (destination, info) |
Completes the copy operation: wait for comms, unpack, clean up MPI state. More... | |
subroutine, public | cp_fm_cleanup_copy_general (info) |
Completes the copy operation: wait for comms clean up MPI state. More... | |
subroutine, public | cp_fm_to_fm_submat_general (source, destination, nrows, ncols, s_firstrow, s_firstcol, d_firstrow, d_firstcol, global_context) |
General copy of a submatrix of fm matrix to a submatrix of another fm matrix. The two matrices can have different contexts. More... | |
subroutine, public | cp_fm_add_to_element (matrix, irow_global, icol_global, alpha) |
... More... | |
subroutine, public | cp_fm_write_unformatted (fm, unit) |
... More... | |
subroutine, public | cp_fm_write_formatted (fm, unit, header, value_format) |
Write out a full matrix in plain text. More... | |
subroutine, public | cp_fm_read_unformatted (fm, unit) |
... More... | |
integer function, public | cp_fm_indxg2p (INDXGLOB, NB, IPROC, ISRCPROC, NPROCS) |
wrapper to scalapack function INDXG2P that computes the process coordinate which possesses the entry of a distributed matrix specified by a global index INDXGLOB. More... | |
integer function, public | cp_fm_indxg2l (INDXGLOB, NB, IPROC, ISRCPROC, NPROCS) |
wrapper to scalapack function INDXG2L that computes the local index of a distributed matrix entry pointed to by the global index INDXGLOB. More... | |
integer function, public | cp_fm_indxl2g (INDXLOC, NB, IPROC, ISRCPROC, NPROCS) |
wrapper to scalapack function INDXL2G that computes the global index of a distributed matrix entry pointed to by the local index INDXLOC of the process indicated by IPROC. More... | |
subroutine, public | cp_fm_setup (mult_type) |
... More... | |
integer function, public | cp_fm_get_mm_type () |
... More... | |
integer function, public | cp_fm_pilaenv (ictxt, prec) |
... More... | |
represent a full matrix distributed on many processors
subroutine, public cp_fm_types::cp_fm_create | ( | type(cp_fm_type), intent(out) | matrix, |
type(cp_fm_struct_type), intent(in), target | matrix_struct, | ||
character(len=*), intent(in), optional | name, | ||
logical, intent(in), optional | use_sp | ||
) |
creates a new full matrix with the given structure
matrix | the matrix to be created |
matrix_struct | the structure of matrix |
name | ... |
use_sp | ... |
Definition at line 166 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_init_random | ( | type(cp_fm_type), intent(in) | matrix, |
integer, intent(in), optional | ncol, | ||
integer, intent(in), optional | start_col | ||
) |
fills a matrix with random numbers
matrix | : to be initialized |
ncol | : numbers of cols to fill |
start_col | : starting at coll number |
Definition at line 451 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_set_all | ( | type(cp_fm_type), intent(in) | matrix, |
real(kind=dp), intent(in) | alpha, | ||
real(kind=dp), intent(in), optional | beta | ||
) |
set all elements of a matrix to the same value, and optionally the diagonal to a different one
matrix | input matrix |
alpha | scalar used to set all elements of the matrix |
beta | scalar used to set diagonal of the matrix |
Definition at line 534 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_get_diag | ( | type(cp_fm_type), intent(in) | matrix, |
real(kind=dp), dimension(:), intent(out) | diag | ||
) |
returns the diagonal elements of a fm
matrix | ... |
diag | ... |
Definition at line 569 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_get_element | ( | type(cp_fm_type), intent(in) | 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
matrix | the matrix to read |
irow_global | the row |
icol_global | the col |
alpha | the value of matrix(irow_global, icol_global) |
local | true if the element is on this cpu, false otherwise |
Definition at line 642 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_set_element | ( | type(cp_fm_type), intent(in) | matrix, |
integer, intent(in) | irow_global, | ||
integer, intent(in) | icol_global, | ||
real(kind=dp), intent(in) | alpha | ||
) |
sets an element of a matrix
matrix | ... |
irow_global | ... |
icol_global | ... |
alpha | ... |
Definition at line 699 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_set_submatrix | ( | type(cp_fm_type), intent(in) | 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 | ||
) |
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 | the full to change |
new_values | a replicated full matrix with the new values |
start_row | the starting row of b_matrix (defaults to 1) |
start_col | the starting col of b_matrix (defaults to 1) |
n_rows | the number of row to change in b (defaults to size(op(new_values),1)) |
n_cols | the number of columns to change in b (defaults to size(op(new_values),2)) |
alpha | rescaling factor for the new values (defaults to 1.0) |
beta | rescaling factor for the old values (defaults to 0.0) |
transpose | if new_values should be transposed: if true op(new_values)=new_values^T, else op(new_values)=new_values (defaults to false) |
Definition at line 766 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_get_submatrix | ( | type(cp_fm_type), intent(in) | 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 | ||
) |
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
fm | the full you want to get the info from |
target_m | a replicated full matrix that will contain the result |
start_row | the starting row of b_matrix (defaults to 1) |
start_col | the starting col of b_matrix (defaults to 1) |
n_rows | the number of row to change in b (defaults to size(op(new_values),1)) |
n_cols | the number of columns to change in b (defaults to size(op(new_values),2)) |
transpose | if target_m should be transposed: if true op(target_m)=target_m^T, else op(target_m)=target_m (defaults to false) |
Definition at line 899 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_get_info | ( | type(cp_fm_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, | ||
real(kind=dp), dimension(:, :), optional, pointer, contiguous | 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(mp_para_env_type), optional, pointer | para_env | ||
) |
returns all kind of information about the full matrix
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 | ... |
Definition at line 1012 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_write_info | ( | type(cp_fm_type), intent(in) | matrix, |
integer, intent(in) | io_unit | ||
) |
Write nicely formatted info about the FM to the given I/O unit (including the underlying FM struct)
matrix | a cp_fm_type instance |
io_unit | the I/O unit to use for writing |
Definition at line 1047 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_maxabsval | ( | type(cp_fm_type), intent(in) | matrix, |
real(kind=dp), intent(out) | a_max, | ||
integer, intent(out), optional | ir_max, | ||
integer, intent(out), optional | ic_max | ||
) |
find the maximum absolute value of the matrix element maxval(abs(matrix))
matrix | ... |
a_max | ... |
ir_max | ... |
ic_max | ... |
Definition at line 1063 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_maxabsrownorm | ( | type(cp_fm_type), intent(in) | matrix, |
real(kind=dp), intent(out) | a_max | ||
) |
find the maximum over the rows of the sum of the absolute values of the elements of a given row = || A ||_infinity
matrix | ... |
a_max | ... |
Definition at line 1165 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_vectorsnorm | ( | type(cp_fm_type), intent(in) | matrix, |
real(kind=dp), dimension(:), intent(out) | norm_array | ||
) |
find the inorm of each column norm_{j}= sqrt( \sum_{i} A_{ij}*A_{ij} )
matrix | ... |
norm_array | ... |
Definition at line 1206 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_vectorssum | ( | type(cp_fm_type), intent(in) | matrix, |
real(kind=dp), dimension(:), intent(out) | sum_array, | ||
character(len=1), intent(in), optional | dir | ||
) |
summing up all the elements along the matrix's i-th index \( \mathrm{sum}_{j} = \sum_{i} A_{ij} \) or \( \mathrm{sum}_{i} = \sum_{j} A_{ij} \)
matrix | an input matrix A |
sum_array | sums of elements in each column/row |
dir | ... |
Definition at line 1251 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_to_fm_triangular | ( | type(cp_fm_type), intent(in) | msource, |
type(cp_fm_type), intent(in) | mtarget, | ||
character(len=*), intent(in) | uplo | ||
) |
copy just a triangular matrix
msource | ... |
mtarget | ... |
uplo | ... |
Definition at line 1427 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_to_fm_submat | ( | type(cp_fm_type), intent(in) | msource, |
type(cp_fm_type), intent(in) | 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 | ||
) |
copy just a part ot the matrix
msource | ... |
mtarget | ... |
nrow | ... |
ncol | ... |
s_firstrow | ... |
s_firstcol | ... |
t_firstrow | ... |
t_firstcol | ... |
Definition at line 1472 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_copy_general | ( | type(cp_fm_type), intent(in) | source, |
type(cp_fm_type), intent(in) | destination, | ||
type(mp_para_env_type), intent(in) | para_env | ||
) |
General copy of a fm matrix to another fm matrix. Uses non-blocking MPI rather than ScaLAPACK.
source | input fm matrix |
destination | output fm matrix |
para_env | parallel environment corresponding to the BLACS env that covers all parts of the input and output matrices |
Definition at line 1537 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_start_copy_general | ( | type(cp_fm_type), intent(in) | source, |
type(cp_fm_type), intent(in) | destination, | ||
type(mp_para_env_type), intent(in) | para_env, | ||
type(copy_info_type), intent(out) | info | ||
) |
Initiates the copy operation: get distribution data, post MPI isend and irecvs.
source | input fm matrix |
destination | output fm matrix |
para_env | parallel environment corresponding to the BLACS env that covers all parts of the input and output matrices |
info | all of the data that will be needed to complete the copy operation |
Definition at line 1567 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_finish_copy_general | ( | type(cp_fm_type), intent(in) | destination, |
type(copy_info_type), intent(inout) | info | ||
) |
Completes the copy operation: wait for comms, unpack, clean up MPI state.
destination | output fm matrix |
info | all of the data that will be needed to complete the copy operation |
Definition at line 1881 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_cleanup_copy_general | ( | type(copy_info_type), intent(inout) | info | ) |
Completes the copy operation: wait for comms clean up MPI state.
info | all of the data that will be needed to complete the copy operation |
Definition at line 1945 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_to_fm_submat_general | ( | type(cp_fm_type), intent(in) | source, |
type(cp_fm_type), intent(in) | destination, | ||
integer, intent(in) | nrows, | ||
integer, intent(in) | ncols, | ||
integer, intent(in) | s_firstrow, | ||
integer, intent(in) | s_firstcol, | ||
integer, intent(in) | d_firstrow, | ||
integer, intent(in) | d_firstcol, | ||
class(cp_blacs_type), intent(in) | global_context | ||
) |
General copy of a submatrix of fm matrix to a submatrix of another fm matrix. The two matrices can have different contexts.
Summary of distribution routines for dense matrices The following will copy A(iA:iA+M-1,jA:jA+N-1) to B(iB:iB+M-1,jB:jB+N-1):
call pdgemr2d(M,N,Aloc,iA,jA,descA,Bloc,iB,jB,descB,context)
A process that is not a part of the context of A should set descA(2) to -1, and similarly for B.
source | input fm matrix |
destination | output fm matrix |
nrows | number of rows of sub matrix to be copied |
ncols | number of cols of sub matrix to be copied |
s_firstrow | starting global row index of sub matrix in source |
s_firstcol | starting global col index of sub matrix in source |
d_firstrow | starting global row index of sub matrix in destination |
d_firstcol | starting global col index of sub matrix in destination |
global_context | process grid that covers all parts of either A or B. |
Definition at line 1994 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_add_to_element | ( | type(cp_fm_type), intent(in) | matrix, |
integer, intent(in) | irow_global, | ||
integer, intent(in) | icol_global, | ||
real(kind=dp), intent(in) | alpha | ||
) |
...
matrix | ... |
irow_global | ... |
icol_global | ... |
alpha | ... |
Definition at line 2092 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_write_unformatted | ( | type(cp_fm_type), intent(in) | fm, |
integer, intent(in) | unit | ||
) |
...
fm | ... |
unit | ... |
Definition at line 2146 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_write_formatted | ( | type(cp_fm_type), intent(in) | fm, |
integer, intent(in) | unit, | ||
character(len=*), intent(in), optional | header, | ||
character(len=*), intent(in), optional | value_format | ||
) |
Write out a full matrix in plain text.
fm | the matrix to be outputted |
unit | the unit number for I/O |
header | optional header |
value_format | ... |
Definition at line 2250 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_read_unformatted | ( | type(cp_fm_type), intent(inout) | fm, |
integer, intent(in) | unit | ||
) |
...
fm | ... |
unit | ... |
Definition at line 2378 of file cp_fm_types.F.
integer function, 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 coordinate which possesses the entry of a distributed matrix specified by a global index INDXGLOB.
INDXGLOB (global input) INTEGER The global index of the element.
NB (global input) INTEGER Block size, size of the blocks the distributed matrix is split into.
IPROC (local dummy) INTEGER Dummy argument in this case in order to unify the calling sequence of the tool-routines.
ISRCPROC (global input) INTEGER The coordinate of the process that possesses the first row/column of the distributed matrix.
NPROCS (global input) INTEGER The total number processes over which the matrix is distributed.
INDXGLOB | ... |
NB | ... |
IPROC | ... |
ISRCPROC | ... |
NPROCS | ... |
Definition at line 2465 of file cp_fm_types.F.
integer function, 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 of a distributed matrix entry pointed to by the global index INDXGLOB.
INDXGLOB (global input) INTEGER The global index of the distributed matrix entry.
NB (global input) INTEGER Block size, size of the blocks the distributed matrix is split into.
IPROC (local dummy) INTEGER Dummy argument in this case in order to unify the calling sequence of the tool-routines.
ISRCPROC (local dummy) INTEGER Dummy argument in this case in order to unify the calling sequence of the tool-routines.
NPROCS (global input) INTEGER The total number processes over which the distributed matrix is distributed.
INDXGLOB | ... |
NB | ... |
IPROC | ... |
ISRCPROC | ... |
NPROCS | ... |
Definition at line 2524 of file cp_fm_types.F.
integer function, 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 of a distributed matrix entry pointed to by the local index INDXLOC of the process indicated by IPROC.
INDXLOC (global input) INTEGER The local index of the distributed matrix entry.
NB (global input) INTEGER Block size, size of the blocks the distributed matrix is split into.
IPROC (local input) INTEGER The coordinate of the process whose local array row or column is to be determined.
ISRCPROC (global input) INTEGER The coordinate of the process that possesses the first row/column of the distributed matrix.
NPROCS (global input) INTEGER The total number processes over which the distributed matrix is distributed.
INDXLOC | ... |
NB | ... |
IPROC | ... |
ISRCPROC | ... |
NPROCS | ... |
Definition at line 2584 of file cp_fm_types.F.
subroutine, public cp_fm_types::cp_fm_setup | ( | integer, intent(in) | mult_type | ) |
...
mult_type | ... |
Definition at line 2612 of file cp_fm_types.F.
integer function, public cp_fm_types::cp_fm_get_mm_type |
...
Definition at line 2622 of file cp_fm_types.F.
integer function, public cp_fm_types::cp_fm_pilaenv | ( | integer | ictxt, |
character(len=1) | prec | ||
) |
...
ictxt | ... |
prec | ... |
Definition at line 2634 of file cp_fm_types.F.