dbcsr_transformations Module

DBCSR transformations



Contents


Variables

TypeVisibilityAttributesNameInitial
character(len=*), private, parameter:: moduleN ='dbcsr_transformations'
logical, private, parameter:: careful_mod =.FALSE.

Subroutines

public subroutine dbcsr_new_transposed(transposed, normal, shallow_data_copy, transpose_data, transpose_distribution, transpose_index, use_distribution, redistribute)

Transposes a DBCSR matrix.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(inout) :: transposed

transposed DBCSR matrix

type(dbcsr_type), intent(in) :: normal

input DBCSR matrix

logical, intent(in), optional :: shallow_data_copy

only shallow data_copy; default is no; if set, the transpose_data option is ignored transpose data blocks, default is True transpose the distribution from the input matrix, default is True transpose the index (default=yes) or turn it into BCSC

logical, intent(in), optional :: transpose_data

only shallow data_copy; default is no; if set, the transpose_data option is ignored transpose data blocks, default is True transpose the distribution from the input matrix, default is True transpose the index (default=yes) or turn it into BCSC

logical, intent(in), optional :: transpose_distribution

only shallow data_copy; default is no; if set, the transpose_data option is ignored transpose data blocks, default is True transpose the distribution from the input matrix, default is True transpose the index (default=yes) or turn it into BCSC

logical, intent(in), optional :: transpose_index

only shallow data_copy; default is no; if set, the transpose_data option is ignored transpose data blocks, default is True transpose the distribution from the input matrix, default is True transpose the index (default=yes) or turn it into BCSC

type(dbcsr_distribution_obj), intent(in), optional :: use_distribution

use this distribution

logical, intent(in), optional :: redistribute

redistributes the matrix; default is .TRUE. unless shallow or transpose_distribution are set.

public subroutine dbcsr_transposed(transposed, normal, shallow_data_copy, transpose_data, transpose_distribution, use_distribution)

Transposes a DBCSR matrix, keeping the same distribution

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(inout) :: transposed
type(dbcsr_type), intent(in) :: normal
logical, intent(in), optional :: shallow_data_copy
logical, intent(in), optional :: transpose_data
logical, intent(in), optional :: transpose_distribution
type(dbcsr_distribution_obj), intent(in), optional :: use_distribution

public subroutine dbcsr_desymmetrize_deep(sm, desm, untransposed_data)

Duplicates data in symmetric matrix to make it normal (w.r.t. data structure. Can handle symmetric/antisymmetric/hermitian/skewhermitian matrices

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(in) :: sm

input symmetric matrix

type(dbcsr_type), intent(inout) :: desm

desymmetrized matrix

logical, intent(in), optional :: untransposed_data

public subroutine dbcsr_distribute(matrix, fast)

Distributes a matrix that is currently replicated.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(inout) :: matrix

matrix to replicate

logical, intent(in), optional :: fast

change just the index, don't touch the data

public subroutine dbcsr_make_untransposed_blocks(matrix)

Detransposes all blocks in a matrix

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(inout) :: matrix

DBCSR matrix

public subroutine dbcsr_make_dense(matrix, dense_matrix, dense_dist, dense_row_sizes, dense_col_sizes, row_map, col_map)

Makes a dense matrix, inplace.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(in) :: matrix

matrix to make dense

type(dbcsr_type), intent(out) :: dense_matrix
type(dbcsr_distribution_obj), intent(inout) :: dense_dist
type(array_i1d_obj), intent(in) :: dense_row_sizes
type(array_i1d_obj), intent(in) :: dense_col_sizes
type(array_i1d_obj), intent(in) :: row_map
type(array_i1d_obj), intent(in) :: col_map

public subroutine dbcsr_make_dense_low(und_matrix, dense_matrix, und_local_rows, und_local_cols, und_row_blk_offsets, und_col_blk_offsets, dense_local_rows, dense_local_cols, dense_row_blk_offsets, dense_col_blk_offsets, row_map, col_map, join_rows, join_cols)

Copies a matrix and makes its data dense.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(in) :: und_matrix

Original non-dense matrix

type(dbcsr_type), intent(inout) :: dense_matrix

Dense copy of und_matrix

integer, intent(in), DIMENSION(:):: und_local_rows

The process-grid local rows of the non-dense und_matrix The process-grid local columns of the non-dense und_matrix The block offsets of the rows of the non-dense matrix The block offsets of the columns of the non-dense matrix The process-grid local rows of the dense matrix The process-grid local columns of the dense matrix The block offsets of the rows of the dense matrix The block offsets of the columns of the dense matrix Mapping of non-dense rows to dense rows Mapping of non-dense columns to dense columns

integer, intent(in), DIMENSION(:):: und_local_cols

The process-grid local rows of the non-dense und_matrix The process-grid local columns of the non-dense und_matrix The block offsets of the rows of the non-dense matrix The block offsets of the columns of the non-dense matrix The process-grid local rows of the dense matrix The process-grid local columns of the dense matrix The block offsets of the rows of the dense matrix The block offsets of the columns of the dense matrix Mapping of non-dense rows to dense rows Mapping of non-dense columns to dense columns

integer, intent(in), DIMENSION(:):: und_row_blk_offsets

The process-grid local rows of the non-dense und_matrix The process-grid local columns of the non-dense und_matrix The block offsets of the rows of the non-dense matrix The block offsets of the columns of the non-dense matrix The process-grid local rows of the dense matrix The process-grid local columns of the dense matrix The block offsets of the rows of the dense matrix The block offsets of the columns of the dense matrix Mapping of non-dense rows to dense rows Mapping of non-dense columns to dense columns

integer, intent(in), DIMENSION(:):: und_col_blk_offsets

The process-grid local rows of the non-dense und_matrix The process-grid local columns of the non-dense und_matrix The block offsets of the rows of the non-dense matrix The block offsets of the columns of the non-dense matrix The process-grid local rows of the dense matrix The process-grid local columns of the dense matrix The block offsets of the rows of the dense matrix The block offsets of the columns of the dense matrix Mapping of non-dense rows to dense rows Mapping of non-dense columns to dense columns

integer, intent(in), DIMENSION(:):: dense_local_rows

The process-grid local rows of the non-dense und_matrix The process-grid local columns of the non-dense und_matrix The block offsets of the rows of the non-dense matrix The block offsets of the columns of the non-dense matrix The process-grid local rows of the dense matrix The process-grid local columns of the dense matrix The block offsets of the rows of the dense matrix The block offsets of the columns of the dense matrix Mapping of non-dense rows to dense rows Mapping of non-dense columns to dense columns

integer, intent(in), DIMENSION(:):: dense_local_cols

The process-grid local rows of the non-dense und_matrix The process-grid local columns of the non-dense und_matrix The block offsets of the rows of the non-dense matrix The block offsets of the columns of the non-dense matrix The process-grid local rows of the dense matrix The process-grid local columns of the dense matrix The block offsets of the rows of the dense matrix The block offsets of the columns of the dense matrix Mapping of non-dense rows to dense rows Mapping of non-dense columns to dense columns

integer, intent(in), DIMENSION(:):: dense_row_blk_offsets

The process-grid local rows of the non-dense und_matrix The process-grid local columns of the non-dense und_matrix The block offsets of the rows of the non-dense matrix The block offsets of the columns of the non-dense matrix The process-grid local rows of the dense matrix The process-grid local columns of the dense matrix The block offsets of the rows of the dense matrix The block offsets of the columns of the dense matrix Mapping of non-dense rows to dense rows Mapping of non-dense columns to dense columns

integer, intent(in), DIMENSION(:):: dense_col_blk_offsets

The process-grid local rows of the non-dense und_matrix The process-grid local columns of the non-dense und_matrix The block offsets of the rows of the non-dense matrix The block offsets of the columns of the non-dense matrix The process-grid local rows of the dense matrix The process-grid local columns of the dense matrix The block offsets of the rows of the dense matrix The block offsets of the columns of the dense matrix Mapping of non-dense rows to dense rows Mapping of non-dense columns to dense columns

integer, intent(in), DIMENSION(:):: row_map

The process-grid local rows of the non-dense und_matrix The process-grid local columns of the non-dense und_matrix The block offsets of the rows of the non-dense matrix The block offsets of the columns of the non-dense matrix The process-grid local rows of the dense matrix The process-grid local columns of the dense matrix The block offsets of the rows of the dense matrix The block offsets of the columns of the dense matrix Mapping of non-dense rows to dense rows Mapping of non-dense columns to dense columns

integer, intent(in), DIMENSION(:):: col_map

The process-grid local rows of the non-dense und_matrix The process-grid local columns of the non-dense und_matrix The block offsets of the rows of the non-dense matrix The block offsets of the columns of the non-dense matrix The process-grid local rows of the dense matrix The process-grid local columns of the dense matrix The block offsets of the rows of the dense matrix The block offsets of the columns of the dense matrix Mapping of non-dense rows to dense rows Mapping of non-dense columns to dense columns

logical, intent(in) :: join_rows

Make rows dense Make columns dense

logical, intent(in) :: join_cols

Make rows dense Make columns dense

public subroutine dbcsr_make_undense(matrix, undense_matrix, distribution, row_blk_offsets, col_blk_offsets, row_blk_sizes, col_blk_sizes, row_map, col_map)

Makes a blocked matrix from a dense matrix, inplace

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(in) :: matrix

dense matrix

type(dbcsr_type), intent(inout) :: undense_matrix

matrix to make undense

type(dbcsr_distribution_obj), intent(in) :: distribution

distribution of non-dense rows and columns

type(array_i1d_obj), intent(in) :: row_blk_offsets

non-dense row block offsets non-dense column block offsets non-dense row block sizes non-dense column block sizes mapping from non-dense rows mapping from non-dense columns

type(array_i1d_obj), intent(in) :: col_blk_offsets

non-dense row block offsets non-dense column block offsets non-dense row block sizes non-dense column block sizes mapping from non-dense rows mapping from non-dense columns

type(array_i1d_obj), intent(in) :: row_blk_sizes

non-dense row block offsets non-dense column block offsets non-dense row block sizes non-dense column block sizes mapping from non-dense rows mapping from non-dense columns

type(array_i1d_obj), intent(in) :: col_blk_sizes

non-dense row block offsets non-dense column block offsets non-dense row block sizes non-dense column block sizes mapping from non-dense rows mapping from non-dense columns

type(array_i1d_obj), intent(in) :: row_map

non-dense row block offsets non-dense column block offsets non-dense row block sizes non-dense column block sizes mapping from non-dense rows mapping from non-dense columns

type(array_i1d_obj), intent(in) :: col_map

non-dense row block offsets non-dense column block offsets non-dense row block sizes non-dense column block sizes mapping from non-dense rows mapping from non-dense columns

private subroutine make_dense_data(matrix, dense_data, nfullrows, nfullcols, und_row_blk_offsets, und_col_blk_offsets, dense_row_blk_offsets, dense_col_blk_offsets, row_map, col_map, row_internal_offsets, col_internal_offsets, join_rows, join_cols, make_tr)

Shuffles the data from blocked to standard dense form

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(in) :: matrix

Existing blocked matrix

type(dbcsr_data_obj), intent(inout) :: dense_data

Dense data

integer, intent(in) :: nfullrows

size of new data size of new data

integer, intent(in) :: nfullcols

size of new data size of new data

integer, intent(in), DIMENSION(:):: und_row_blk_offsets
integer, intent(in), DIMENSION(:):: und_col_blk_offsets
integer, intent(in), DIMENSION(:):: dense_row_blk_offsets
integer, intent(in), DIMENSION(:):: dense_col_blk_offsets
integer, intent(in), DIMENSION(:):: row_map
integer, intent(in), DIMENSION(:):: col_map
integer, intent(in), DIMENSION(:):: row_internal_offsets
integer, intent(in), DIMENSION(:):: col_internal_offsets
logical, intent(in) :: join_rows

make rows dense, default is yes make columns dense, default is yes make the dense blocks transposed

logical, intent(in) :: join_cols

make rows dense, default is yes make columns dense, default is yes make the dense blocks transposed

logical, intent(in) :: make_tr

make rows dense, default is yes make columns dense, default is yes make the dense blocks transposed

private subroutine make_undense_data(matrix, dense_data, nfullrows, nfullcols, dense_row_blk_offsets, dense_col_blk_offsets, row_map, col_map, row_internal_offsets, col_internal_offsets)

Shuffles the data from standard dense to blocked form

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(inout) :: matrix

Matrix with data to fill

type(dbcsr_data_obj), intent(in) :: dense_data

Dense data

integer, intent(in) :: nfullrows

number of full rows in local submatrix number of full columns in local submatrix

integer, intent(in) :: nfullcols

number of full rows in local submatrix number of full columns in local submatrix

integer, intent(in), DIMENSION(:):: dense_row_blk_offsets

row block offsets for dense data column block offsets for dense data mapping from undense to dense rows mapping from undense to dense rows

integer, intent(in), DIMENSION(:):: dense_col_blk_offsets

row block offsets for dense data column block offsets for dense data mapping from undense to dense rows mapping from undense to dense rows

integer, intent(in), DIMENSION(:):: row_map

row block offsets for dense data column block offsets for dense data mapping from undense to dense rows mapping from undense to dense rows

integer, intent(in), DIMENSION(:):: col_map

row block offsets for dense data column block offsets for dense data mapping from undense to dense rows mapping from undense to dense rows

integer, intent(in), DIMENSION(:):: row_internal_offsets

row block offsets for dense data column block offsets for dense data mapping from undense to dense rows mapping from undense to dense rows

integer, intent(in), DIMENSION(:):: col_internal_offsets

row block offsets for dense data column block offsets for dense data mapping from undense to dense rows mapping from undense to dense rows

public subroutine dbcsr_replicate_all(matrix)

Replicates a DBCSR on all processors.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(inout) :: matrix

matrix to replicate

private subroutine dbcsr_replicate(matrix, replicate_rows, replicate_columns, restrict_source)

Replicates a DBCSR matrix among process rows and columns

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(inout) :: matrix

matrix to replicate

logical, intent(in) :: replicate_rows

Row should be replicated among all processors Column should be replicated among all processors

logical, intent(in) :: replicate_columns

Row should be replicated among all processors Column should be replicated among all processors

integer, intent(in), optional :: restrict_source

Send only from this node (ignores blocks on other nodes)

public subroutine dbcsr_complete_redistribute(matrix, redist, keep_sparsity, summation)

Fully redistributes a DBCSR matrix. The new distribution may be arbitrary as long as the total number full rows and columns matches that of the existing matrix.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(in) :: matrix

matrix to redistribute

type(dbcsr_type), intent(inout) :: redist

redistributed matrix

logical, intent(in), optional :: keep_sparsity

retains the sparsity of the redist matrix sum blocks with identical row and col from different processes

logical, intent(in), optional :: summation

retains the sparsity of the redist matrix sum blocks with identical row and col from different processes

public subroutine dbcsr_redistribute(matrix, redist)

Redistributes a DBCSR matrix. The new distribution should have compatible row and column blocks.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_type), intent(in) :: matrix

matrix to redistribute

type(dbcsr_type), intent(inout) :: redist

redistributed matrix, which should already be created

public subroutine dbcsr_datablock_redistribute(dblk, row_p, col_i, blk_p, proc_nblks, proc_darea_sizes, new_matrix)

Redistributes data blocks of a DBCSR matrix read from a file. This routine should be used with dbcsr_binary_read in the module dbcsr_io.F

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_data_obj), intent(in) :: dblk

data blocks of the DBCSR matrix that the current node possesses after reading the data file

integer, intent(in), DIMENSION(:), POINTER:: row_p

row_p of the DBCSR matrix that the current node possesses after reading the data file col_i of the DBCSR matrix that the current node possesses after reading the data file blk_p of the DBCSR matrix that the current node possesses after reading the data file 1D array holding nblks of those nodes of the mp environment, that created the file, whose contents have been read by the current node of the present mp environment 1D array holding data_area_size of those nodes of the mp environment, that created the file, whose contents have been read by the current node of the present mp environment

integer, intent(in), DIMENSION(:), POINTER:: col_i

row_p of the DBCSR matrix that the current node possesses after reading the data file col_i of the DBCSR matrix that the current node possesses after reading the data file blk_p of the DBCSR matrix that the current node possesses after reading the data file 1D array holding nblks of those nodes of the mp environment, that created the file, whose contents have been read by the current node of the present mp environment 1D array holding data_area_size of those nodes of the mp environment, that created the file, whose contents have been read by the current node of the present mp environment

integer, intent(in), DIMENSION(:), POINTER:: blk_p

row_p of the DBCSR matrix that the current node possesses after reading the data file col_i of the DBCSR matrix that the current node possesses after reading the data file blk_p of the DBCSR matrix that the current node possesses after reading the data file 1D array holding nblks of those nodes of the mp environment, that created the file, whose contents have been read by the current node of the present mp environment 1D array holding data_area_size of those nodes of the mp environment, that created the file, whose contents have been read by the current node of the present mp environment

integer, intent(in), DIMENSION(:), POINTER:: proc_nblks

row_p of the DBCSR matrix that the current node possesses after reading the data file col_i of the DBCSR matrix that the current node possesses after reading the data file blk_p of the DBCSR matrix that the current node possesses after reading the data file 1D array holding nblks of those nodes of the mp environment, that created the file, whose contents have been read by the current node of the present mp environment 1D array holding data_area_size of those nodes of the mp environment, that created the file, whose contents have been read by the current node of the present mp environment

integer, intent(in), DIMENSION(:), POINTER:: proc_darea_sizes

row_p of the DBCSR matrix that the current node possesses after reading the data file col_i of the DBCSR matrix that the current node possesses after reading the data file blk_p of the DBCSR matrix that the current node possesses after reading the data file 1D array holding nblks of those nodes of the mp environment, that created the file, whose contents have been read by the current node of the present mp environment 1D array holding data_area_size of those nodes of the mp environment, that created the file, whose contents have been read by the current node of the present mp environment

type(dbcsr_type), intent(inout) :: new_matrix

redistributed matrix