dbcsr_mm_dist_operations Module

DBCSR operations on distributions related to matrix multiplication



Variables

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

Subroutines

public subroutine dbcsr_create_image_dist(imgdist, dist, match_row_pdist, match_row_idist, match_row_nbins, match_col_pdist, match_col_idist, match_col_nbins, nimages_rows, nimages_cols)

Creates an image distribution given the other compatibility images

Arguments

Type IntentOptional Attributes Name
type(dbcsr_imagedistribution_obj), intent(out) :: imgdist

distribution repetition

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

distribution for which to form the image distribution

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

match the new row distribution to this row distribution match the row distribution to these row images

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

match the new row distribution to this row distribution match the row distribution to these row images

integer, intent(in) :: match_row_nbins

number of bins in the distribution to match the local rows

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

match the new column distribution to this column distribution match the new column distribution to these column images

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

match the new column distribution to this column distribution match the new column distribution to these column images

integer, intent(in) :: match_col_nbins

number of bins in the distribution to match the local columns

integer, intent(in) :: nimages_rows

number of bins in the distribution to match the local columns

integer, intent(in) :: nimages_cols

number of bins in the distribution to match the local columns

private subroutine dbcsr_new_image_dist(imgdist, dist, template)

Arguments

Type IntentOptional Attributes Name
type(dbcsr_imagedistribution_obj), intent(out) :: imgdist
type(dbcsr_distribution_obj), intent(in) :: dist
type(dbcsr_imagedistribution_obj), intent(in) :: template

public subroutine dbcsr_make_dists_dense(product_dist, left_rdist, right_rdist, dense_product_dist, dense_left_rdist, dense_right_rdist, partial, m_map, k_vmap, n_map, old_m_sizes)

Prepares distributions for making dense matrices.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_distribution_obj), intent(in) :: product_dist
type(dbcsr_imagedistribution_obj), intent(in) :: left_rdist
type(dbcsr_imagedistribution_obj), intent(in) :: right_rdist
type(dbcsr_distribution_obj), intent(out) :: dense_product_dist
type(dbcsr_imagedistribution_obj), intent(out) :: dense_left_rdist
type(dbcsr_imagedistribution_obj), intent(out) :: dense_right_rdist
logical, intent(in) :: partial
type(array_i1d_obj), intent(out) :: m_map
type(array_i1d_obj), intent(out) :: k_vmap
type(array_i1d_obj), intent(out) :: n_map
type(array_i1d_obj), intent(in) :: old_m_sizes

public subroutine dbcsr_reset_locals(matrix)

Resets local rows, columns to the correct arrays and values.

Arguments

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

public subroutine dbcsr_reset_vlocals(matrix, imgdist, do_rows)

Resets local rows, columns to the correct arrays and values for images.

Arguments

Type IntentOptional Attributes Name
type(dbcsr_type), intent(inout) :: matrix
type(dbcsr_imagedistribution_obj), intent(inout) :: imgdist
logical, intent(in), optional :: do_rows

public subroutine dbcsr_get_local_vrows(imgdist, local_vrows, local_vprow)

Determines mapping from local to global virtual process rows

Arguments

Type IntentOptional Attributes Name
type(dbcsr_imagedistribution_obj), intent(inout) :: imgdist

image distribution

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

local rows

integer, intent(in) :: local_vprow

the local virtual process row

public subroutine dbcsr_get_local_vcols(imgdist, local_vcols, local_vpcol)

Determines mapping from local to global virtual process columns

Arguments

Type IntentOptional Attributes Name
type(dbcsr_imagedistribution_obj), intent(inout) :: imgdist

image distribution

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

local columns

integer, intent(in) :: local_vpcol

the local virtual process column

public subroutine image_calculator(image_dist, prow, rowi, pcol, coli, vprow, vpcol, myprow, mypcol, myrowi, mycoli, myvprow, myvpcol, vprow_shift, vpcol_shift, shifting)

Transform between virtual process rows/columns and actual process rows/columns and images therein.

Read more…

Arguments

Type IntentOptional Attributes Name
type(dbcsr_imagedistribution_obj), intent(in) :: image_dist
integer, intent(out), optional :: prow
integer, intent(out), optional :: rowi
integer, intent(out), optional :: pcol
integer, intent(out), optional :: coli
integer, intent(out), optional :: vprow
integer, intent(out), optional :: vpcol
integer, intent(in), optional :: myprow
integer, intent(in), optional :: mypcol
integer, intent(in), optional :: myrowi
integer, intent(in), optional :: mycoli
integer, intent(in), optional :: myvprow
integer, intent(in), optional :: myvpcol
integer, intent(in), optional :: vprow_shift
integer, intent(in), optional :: vpcol_shift
character(len=1), intent(in), optional :: shifting

public subroutine make_sizes_dense(old_sizes, mapping, nel_new, new_sizes)

Matches row/block sizes and offsets to a given distribution

Read more…

Arguments

Type IntentOptional Attributes Name
type(array_i1d_obj), intent(in) :: old_sizes
type(array_i1d_obj), intent(in) :: mapping
integer, intent(in) :: nel_new
type(array_i1d_obj), intent(out) :: new_sizes

private subroutine dbcsr_make_1dist_dense(nbins, old_dist, dense_dist, dist_map, nsubdist, subdist)

Makes a 1-D distribution dense.

Arguments

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

Number of bins in the main distribution

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

Current distribution

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

Dense distribution Map from current to dense distribution

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

Dense distribution Map from current to dense distribution

integer, intent(in) :: nsubdist

Number of bins in the subdistribution

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

Subdistribution

private pure subroutine v_to_p_i_dist(nel, vdist, nim, pdist, idist)

Converts virtual 1-D distribution to process and image

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nel
integer, intent(in), DIMENSION(1:nel) :: vdist
integer, intent(in) :: nim
integer, intent(out), DIMENSION(1:nel) :: pdist
integer, intent(out), DIMENSION(1:nel) :: idist

private subroutine v_to_p_i_dist_o(vdist, nim, pdist, idist)

Arguments

Type IntentOptional Attributes Name
type(array_i1d_obj), intent(in) :: vdist
integer, intent(in) :: nim
type(array_i1d_obj), intent(out) :: pdist
type(array_i1d_obj), intent(out) :: idist

private subroutine dbcsr_get_global_row_map(dist, row_map)

Determines mapping from global to local rows

Arguments

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

mapping for this distribution

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

mapping to local rows

private subroutine dbcsr_get_global_col_map(dist, col_map)

Determines mapping from global to local columns

Arguments

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

mapping for this distribution

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

mapping to local columns

private subroutine dbcsr_get_global_vrow_map(imgdist, vrow_map)

Determines mapping from global to virtual local rows

Arguments

Type IntentOptional Attributes Name
type(dbcsr_imagedistribution_obj), intent(inout) :: imgdist

mapping for this image distribution

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

mapping to local rows

private subroutine dbcsr_get_global_vcol_map(imgdist, vcol_map)

Determines mapping from global to virtual local columns

Arguments

Type IntentOptional Attributes Name
type(dbcsr_imagedistribution_obj), intent(inout) :: imgdist

mapping for this image distribution

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

mapping to local columns

private pure subroutine map_all_local_elements(global_elements, bin_distribution, nbins)

Points to 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
integer, intent(out), DIMENSION(:) :: global_elements

enumerated local elements

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

distribution of elements to bins

integer, intent(in) :: nbins

number of bins

private subroutine reimage_distribution(images, my_bins, nbins, nimages)

Makes new distribution with decimation and multiplicity Multiplicity is being ignored, maybe this is a bug

Read more…

Arguments

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

new image distribution

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

Basis for the new images

integer, intent(in) :: nbins

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

integer, intent(in) :: nimages

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

private pure subroutine make_vdistribution(nelements, vbins, bins, decimation, images)

Makes new virtual distribution of rows/columns.

Arguments

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

number of elements

integer, intent(out), DIMENSION(nelements) :: vbins

virtual bins

integer, intent(in), DIMENSION(nelements) :: bins

bins to which elements belong

integer, intent(in) :: decimation

matching between bins

integer, intent(in), DIMENSION(nelements) :: images

images to which element belong

private subroutine rebin_imaged_distribution(new_bins, images, source_bins, source_images, nbins, multiplicity, nimages)

Makes new distribution with 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(:) :: source_bins

Basis for the new distribution and images Basis for the new distribution and images

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

Basis for the new distribution and images 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