Documentation for module dbcsr_dist_operations

DBCSR operations on distributions

source: dbcsr_dist_operations.F
Loading...

public Subroutines/Functions:

FUNCTION
INTEGER PURE
checker_square_proc (row, col, pgrid, row_dist, col_dist)
Determines the home process for a given logical matrix element.
FUNCTION
LOGICAL ELEMENTAL
checker_tr (row, column)
Determines whether a transpose must be applied
Creates a sane 1-D distribution
Finds the block that has the given column.
Looks up a block's index given logical coordinates.
Determines mapping from local to global columnss
Determines mapping from local to global rows
Returns the index to a queried block, given a real (stored) row and column
Sets the correct source matrix, row, column and possible data transposition for a given matrix and matrix logical row and column.
Calculates the intersections of blocks
Transposes a distribution but keeps the same mp_env
Transposes a distribution
Finds the local virtual elements
Canonical logic
Makes new distribution with decimation and multiplicity

PURE FUNCTIONchecker_square_proc(row, col, pgrid, row_dist, col_dist)

Determines the home process for a given logical matrix element.

Return Value ::
INTEGER
home process of the given element
Arguments:
INTEGER,
INTENT(in)
:: row logical row
INTEGER,
INTENT(in)
:: col logical column
INTEGER,
INTENT(in)
:: pgrid(0:,0:) process grid
INTEGER,
INTENT(in)
:: row_dist(:) row distribution
INTEGER,
INTENT(in)
:: col_dist(:) column distribution

ELEMENTAL FUNCTIONchecker_tr(row, column)

Determines whether a transpose must be applied

Return Value ::
LOGICAL
Arguments:
INTEGER,
INTENT(in)
:: row The absolute matrix row.
INTEGER,
INTENT(in)
:: column The absolute matrix column.

SUBROUTINEdbcsr_dist_bin(bin_dist, nelements, nbins, element_sizes)

Creates a sane 1-D distribution

Arguments:
INTEGER,
INTENT(out),
POINTER
:: bin_dist(:) Distribution of elements to bins
INTEGER,
INTENT(in)
:: nelements Number of elements
INTEGER,
INTENT(in)
:: nbins Number of bins
INTEGER,
INTENT(in),
OPTIONAL
:: element_sizes(:) sizes of elements

PURE SUBROUTINEdbcsr_find_column(find_col, frst_blk, last_blk, col_i, blk_p, blk, found)

Finds the block that has the given column.

Arguments:
INTEGER,
INTENT(in)
:: find_col column to find
INTEGER,
INTENT(in)
:: frst_blk first block number in row
INTEGER,
INTENT(in)
:: last_blk last block number in row
INTEGER,
INTENT(in)
:: col_i(:) col indices
INTEGER,
INTENT(in)
:: blk_p(:) 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

PURE SUBROUTINEdbcsr_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(dbcsr_type),
INTENT(in)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row logical row
INTEGER,
INTENT(in)
:: column logical column
INTEGER,
INTENT(out)
:: stored_row row where block is actually stored
INTEGER,
INTENT(out)
:: stored_column column where block is actually stored
LOGICAL,
INTENT(out)
:: transpose whether the data must be transposed
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(out),
OPTIONAL
:: data_offset data offset for the block; 0 if nonexistent

SUBROUTINEdbcsr_get_local_cols(dist, local_cols, local_pcol)

Determines mapping from local to global columnss

Arguments:
INTENT(inout)
:: dist mapping for this distribution
INTENT(out)
:: local_cols local elements for specified column
INTEGER,
INTENT(in)
:: local_pcol find local elemnts for this local column

SUBROUTINEdbcsr_get_local_rows(dist, local_rows, local_prow)

Determines mapping from local to global rows

Arguments:
INTENT(inout)
:: dist mapping for this distribution
INTENT(out)
:: local_rows local elements for specified row
INTEGER,
INTENT(in)
:: local_prow find local elemnts for this local row

PURE SUBROUTINEdbcsr_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(dbcsr_type),
INTENT(in)
:: matrix bcsr matrix
INTEGER,
INTENT(in)
:: row input is logical row, output is lookup row
INTEGER,
INTENT(in)
:: column 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
:: lb_row_col(2) ...
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

PURE SUBROUTINEdbcsr_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(dbcsr_type),
INTENT(in)
:: matrix DBCSR matrix
INTEGER,
INTENT(in)
:: row input is logical row
INTEGER,
INTENT(in)
:: column input is logical column
INTEGER,
INTENT(out),
OPTIONAL
:: processor returns the processor on which this block resides

SUBROUTINEdbcsr_reblocking_targets(ints, numints, n_src_dsts, src_sizes, dst_sizes)

Calculates the intersections of blocks

Arguments:
INTEGER,
INTENT(out)
:: ints(4,numints) intersections of blocks
INTEGER,
INTENT(inout)
:: numints maximum number of expected intersections
INTEGER,
INTENT(out)
:: n_src_dsts(:,:) offset and number intersections belonging to source blocks
INTEGER,
INTENT(in)
:: src_sizes(:) sizes of source blocks
INTEGER,
INTENT(in)
:: dst_sizes(:) sizes of target blocks

SUBROUTINEdbcsr_transpose_dims(dist_tr, dist_normal)

Transposes a distribution but keeps the same mp_env

Arguments:
INTENT(out)
:: dist_tr transposed distribution
INTENT(in)
:: dist_normal current distribution

SUBROUTINEdbcsr_transpose_distribution(dist_tr, dist_normal)

Transposes a distribution

Arguments:
INTENT(out)
:: dist_tr transposed distribution
INTENT(in)
:: dist_normal current distribution

SUBROUTINEfind_all_local_elements(local_elements, bin_distribution, nbins)

Finds the local virtual elements

Arguments:
INTENT(inout)
:: local_elements(0:nbins-1) local virtual elements
INTEGER,
INTENT(in)
:: bin_distribution(:) distribution of elements to bins
INTEGER,
INTENT(in)
:: nbins number of bins

PURE SUBROUTINEget_stored_canonical(matrix, row, column, transpose, processor)

Canonical logic

Arguments:
TYPE(dbcsr_type),
INTENT(in)
:: matrix ...
INTEGER,
INTENT(inout)
:: row ...
INTEGER,
INTENT(inout)
:: column ...
LOGICAL,
INTENT(inout)
:: transpose ...
INTEGER,
INTENT(out),
OPTIONAL
:: processor ...

SUBROUTINErebin_distribution(new_bins, images, source_bins, nbins, multiplicity, nimages)

Makes new distribution with decimation and multiplicity

Arguments:
INTEGER,
INTENT(out)
:: new_bins(:) new real distribution
INTEGER,
INTENT(out)
:: images(:) new image distribution
INTEGER,
INTENT(in)
:: source_bins(:) Basis for the new distribution and images
INTEGER,
INTENT(in)
:: nbins number of bins in the new real distribution
INTEGER,
INTENT(in)
:: multiplicity multiplicity
INTEGER,
INTENT(in)
:: nimages number of images in the new distribution