dbcsr_dist_util Module

DBCSR sparse matrix utility routines



Contents


Variables

TypeVisibilityAttributesNameInitial
character(len=*), private, parameter:: moduleN ='dbcsr_dist_util'
logical, private, parameter:: bcsr_info =.FALSE.
logical, private, parameter:: bcsr_verbose =.FALSE.

Functions

public pure function nfull_elements(all_offsets, local_elements)

The sum of a subset of rows/columns \return sum of sizes of local elements

Read more…

Arguments

TypeIntentOptionalAttributesName
integer, intent(in), DIMENSION(:):: all_offsets

ordered offsets of all the elements enumerated local elements

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

ordered offsets of all the elements enumerated local elements

Return Value integer

public elemental function sgn(n, oldsign, x) result(val)

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: n
integer, intent(in) :: oldsign
logical, intent(in) :: x

Return Value integer

public function dbcsr_checksum(matrix, local, pos) result(checksum)

Calculates the checksum of a DBCSR matrix.

Arguments

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

matrix

logical, intent(in), optional :: local

no global communication position-dependent checksum

logical, intent(in), optional :: pos

no global communication position-dependent checksum

Return Value real(kind=dp)

calculated checksum

private pure function pd_blk_cs(ld, od, DATA, tr, ro, co) result(pd_cs)

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: ld
integer, intent(in) :: od
real(kind=dp), intent(in), DIMENSION(ld, od):: DATA
logical, intent(in) :: tr
integer, intent(in) :: ro
integer, intent(in) :: co

Return Value real(kind=dp)


Subroutines

public subroutine find_block_of_element(full, block, nblocks, block_offsets, hint)

Finds block to which a full element belongs.

Read more…

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: full

full element

integer, intent(out) :: block

block to which full belongs

integer, intent(in) :: nblocks
integer, intent(in), DIMENSION(1:nblocks + 1):: block_offsets

starting full elements of blocks

integer, intent(in) :: hint

where to start looking; ignored if 0

public pure subroutine convert_sizes_to_offsets(sizes, offsets_start, offsets_stop)

Converts sizes to offsets

Arguments

TypeIntentOptionalAttributesName
integer, intent(in), DIMENSION(:):: sizes

array with sizes

integer, intent(out), DIMENSION(:):: offsets_start

offsets of starts

integer, intent(out), optional DIMENSION(:):: offsets_stop

offsets of ends

public pure subroutine convert_offsets_to_sizes(offsets_start, sizes, offsets_stop)

Converts offsets to sizes If the offsets of ends are not given, then the array of sizes is assumed to be one greater than the desired sizes.

Arguments

TypeIntentOptionalAttributesName
integer, intent(in), DIMENSION(:):: offsets_start

offsets of starts

integer, intent(out), DIMENSION(:):: sizes

array with sizes

integer, intent(in), optional DIMENSION(:):: offsets_stop

offsets of ends

public subroutine global_offsets_to_local(global_offsets, local_elements, local_offsets)

Converts global offsets to local

Read more…

Arguments

TypeIntentOptionalAttributesName
integer, intent(in), DIMENSION(:):: global_offsets

Offsets of elements in the global grid Which elements are local

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

Offsets of elements in the global grid Which elements are local

integer, intent(out), DIMENSION(:):: local_offsets

Offsets of local elements.

public subroutine get_internal_offsets(blk_local_els, el_map, blk_el_offsets, dense_el_offsets, internal_offsets)

Finds internal offsets For all local blocks in blk_local_els, it calculates its offset in the dense block to which it belongs.

Arguments

TypeIntentOptionalAttributesName
integer, intent(in), DIMENSION(:):: blk_local_els
integer, intent(in), DIMENSION(:):: el_map
integer, intent(in), DIMENSION(:):: blk_el_offsets
integer, intent(in), DIMENSION(:):: dense_el_offsets
integer, intent(out), DIMENSION(:):: internal_offsets

public subroutine dbcsr_calc_block_sizes(sizes, row_p, col_i, rbs, cbs)

Calculates explicit sizes for all data blocks.

Arguments

TypeIntentOptionalAttributesName
integer, intent(out), DIMENSION(*):: sizes

sizes of all data blocks

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

index structure

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

index structure row block sizes column block sizes

integer, intent(in), DIMENSION(*):: rbs

index structure row block sizes column block sizes

integer, intent(in), DIMENSION(*):: cbs

index structure row block sizes column block sizes

public subroutine meta_from_dist(meta, dist, row_blk_size, col_blk_size)

Fills meta information from a given distribution_2d

Arguments

TypeIntentOptionalAttributesName
integer, intent(out), DIMENSION(dbcsr_meta_size):: meta

meta information array to fill

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

processor distribution

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

row block sizes column block sizes

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

row block sizes column block sizes

public subroutine dbcsr_pack_meta(matrix, meta)

Copies metadata into an array.

Arguments

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

Matrix

integer, intent(out), DIMENSION(dbcsr_meta_size):: meta

Metadata elements

public subroutine dbcsr_unpack_meta(matrix, meta)

Sets metadata form an array.

Arguments

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

Matrix

integer, intent(in), DIMENSION(dbcsr_meta_size):: meta

Metadata elements

public subroutine dbcsr_verify_matrix(m, verbosity, local)

Verify the correctness of a BCSR matrix.

Arguments

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

bcsr matrix

integer, intent(in), optional :: verbosity

how detailed errors are; 0=nothing; 1=summary at end if matrix not consistent; 2=also individual errors; 3=always print info about matrix; >3=even more info

logical, intent(in), optional :: local

no global communication

public pure subroutine count_bins(nelements, bins, nbins, bin_counts)

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: nelements
integer, intent(in), DIMENSION(:):: bins
integer, intent(in) :: nbins
integer, intent(out), DIMENSION(1:nbins):: bin_counts

public subroutine map_most_common(array, most_common_map, nmost_common, most_common_elements, size_limit, max_val)

Makes a lookup table from the most common elements.

Read more…

Arguments

TypeIntentOptionalAttributesName
integer, intent(in), DIMENSION(:):: array

Array for which to find the most common elements.

integer(kind=int_4), DIMENSION(:), POINTER:: most_common_map

Ranking of the most common elements in array

integer, intent(in) :: nmost_common

The number of most common elements

integer, intent(out), DIMENSION(:):: most_common_elements

The most common elements in array

integer, intent(in) :: size_limit

Limit maximum size to this value

integer, intent(out) :: max_val