dbcsr_dist_operations Module

DBCSR operations on distributions



Variables

Type Visibility Attributes Name Initial
character(len=*), private, parameter :: moduleN = 'dbcsr_dist_operations'
logical, private, parameter :: careful_mod = .FALSE.
logical, private, parameter :: debug_mod = .FALSE.

Functions

public elemental function checker_tr(row, column) result(transpose)

Determines whether a transpose must be applied

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: row

The absolute matrix row. The absolute matrix column.

integer, intent(in) :: column

The absolute matrix row. The absolute matrix column.

Return Value logical

public pure function checker_square_proc(row, col, pgrid, row_dist, col_dist) result(process)

Determines the home process for a given logical matrix element.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: row

logical row logical column

integer, intent(in) :: col

logical row logical column

integer, intent(in), DIMENSION(0:, 0:) :: pgrid

process grid

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

row distribution column distribution

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

row distribution column distribution

Return Value integer

home process of the given element

private pure function mostly_non_transposed(blk_p)

Determines whether most blocks are stored transposed in normally.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in), DIMENSION(:) :: blk_p

Pointers to blocks

Return Value logical


Subroutines

public pure subroutine dbcsr_get_stored_coordinates(matrix, row, column, processor)

Sets the correct source matrix, row, column and possible data transposition for a given matrix and matrix logical row and column.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_type), intent(in) :: matrix

DBCSR matrix

integer, intent(in) :: row

input is logical row input is logical column

integer, intent(in) :: column

input is logical row input is logical column

integer, intent(out), optional :: processor

returns the processor on which this block resides

public pure subroutine get_stored_canonical(matrix, row, column, transpose, processor)

Canonical logic

Arguments

Type IntentOptional Attributes Name
type(dbcsr_type), intent(in) :: matrix
integer, intent(inout) :: row
integer, intent(inout) :: column
logical, intent(inout) :: transpose
integer, intent(out), optional :: processor

public pure subroutine dbcsr_get_block_index(matrix, row, column, stored_row, stored_column, transpose, found, block_number, data_offset)

Looks up a block's index given logical coordinates.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_type), intent(in) :: matrix

DBCSR matrix

integer, intent(in) :: row

logical row logical column

integer, intent(in) :: column

logical row logical column

integer, intent(out) :: stored_row

row where block is actually stored column where block is actually stored

integer, intent(out) :: stored_column

row where block is actually stored column where block is actually stored

logical, intent(out) :: transpose

whether the data must be transposed whether the block was found

logical, intent(out) :: found

whether the data must be transposed whether the block was found

integer, intent(out) :: block_number

returns the block number of the row and column

integer, intent(out), optional :: data_offset

data offset for the block; 0 if nonexistent

public pure subroutine dbcsr_get_stored_block_info(matrix, row, column, found, block_number, lb_row_col, data_offset, transposed)

Returns the index to a queried block, given a real (stored) row and column

Arguments

Type IntentOptional Attributes Name
type(dbcsr_type), intent(in) :: matrix

bcsr matrix

integer, intent(in) :: row

input is logical row, output is lookup row input is logical column, output is lookup column

integer, intent(in) :: column

input is logical row, output is lookup row input is logical column, output is lookup column

logical, intent(out) :: found

whether the block was found

integer, intent(out) :: block_number

returns the block number of the row and column

integer, intent(inout), optional, DIMENSION(2) :: lb_row_col
integer, intent(out), optional :: data_offset

data offset for the block; 0 if nonexistent

logical, intent(out), optional :: transposed

whether the block is stored transposed according to its position

public subroutine dbcsr_transpose_distribution(dist_tr, dist_normal)

Transposes a distribution

Arguments

Type IntentOptional Attributes Name
type(dbcsr_distribution_obj), intent(out) :: dist_tr

transposed distribution

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

current distribution

public subroutine dbcsr_transpose_dims(dist_tr, dist_normal)

Transposes a distribution but keeps the same mp_env

Arguments

Type IntentOptional Attributes Name
type(dbcsr_distribution_obj), intent(out) :: dist_tr

transposed distribution

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

current distribution

public subroutine rebin_distribution(new_bins, images, source_bins, nbins, multiplicity, nimages)

Makes new distribution with decimation and multiplicity

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(out), DIMENSION(:) :: new_bins

new real distribution new image distribution

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

new real distribution new image distribution

integer, intent(in), DIMENSION(:), CONTIGUOUS :: source_bins

Basis for the new distribution and images

integer, intent(in) :: nbins

number of bins in the new real distribution multiplicity number of images in the new distribution

integer, intent(in) :: multiplicity

number of bins in the new real distribution multiplicity number of images in the new distribution

integer, intent(in) :: nimages

number of bins in the new real distribution multiplicity number of images in the new distribution

public subroutine dbcsr_reblocking_targets(ints, numints, n_src_dsts, src_sizes, dst_sizes)

Calculates the intersections of blocks

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(out), DIMENSION(4, numints) :: ints

intersections of blocks

integer, intent(inout) :: numints

maximum number of expected intersections

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

offset and number intersections belonging to source blocks

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

sizes of source blocks sizes of target blocks

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

sizes of source blocks sizes of target blocks

public pure subroutine dbcsr_find_column(find_col, frst_blk, last_blk, col_i, blk_p, blk, found)

Finds the block that has the given column. If the block having the queried column is found, the blk parameter is set to this block number and the found parameter is true. Otherwise found is false and the block number is invalid.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: find_col

column to find first block number in row last block number in row

integer, intent(in) :: frst_blk

column to find first block number in row last block number in row

integer, intent(in) :: last_blk

column to find first block number in row last block number in row

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

col indices block pointers

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

col indices block pointers

integer, intent(out) :: blk

block number with searched-for column

logical, intent(out) :: found

flag specified whether a block that has the correct column was found

public subroutine find_all_local_elements(local_elements, bin_distribution, nbins)

Finds the local virtual elements All elements are mapped at once. Therefore an entry in the resulting array can be used as a lookup index for any of the local element arrays. The distribution itself tells into which array to look.

Arguments

Type IntentOptional Attributes Name
type(array_i1d_obj), intent(inout), DIMENSION(0:nbins - 1) :: local_elements

local virtual elements

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

distribution of elements to bins

integer, intent(in) :: nbins

number of bins

public subroutine dbcsr_get_local_rows(dist, local_rows, local_prow)

Determines mapping from local to global rows

Arguments

Type IntentOptional Attributes Name
type(dbcsr_distribution_obj), intent(inout) :: dist

mapping for this distribution

type(array_i1d_obj), intent(out) :: local_rows

local elements for specified row

integer, intent(in) :: local_prow

find local elements for this local row

public subroutine dbcsr_get_local_cols(dist, local_cols, local_pcol)

Determines mapping from local to global columns

Arguments

Type IntentOptional Attributes Name
type(dbcsr_distribution_obj), intent(inout) :: dist

mapping for this distribution

type(array_i1d_obj), intent(out) :: local_cols

local elements for specified column

integer, intent(in) :: local_pcol

find local elements for this local column

public subroutine dbcsr_dist_bin(bin_dist, nelements, nbins, element_sizes)

Creates a sane 1-D distribution

Arguments

Type IntentOptional Attributes Name
integer, intent(out), DIMENSION(:), POINTER :: bin_dist

Distribution of elements to bins

integer, intent(in) :: nelements

Number of elements Number of bins

integer, intent(in) :: nbins

Number of elements Number of bins

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

sizes of elements