dbcsr_index_operations Module

Operations on the DBCSR index



Variables

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

Interfaces

public interface dbcsr_count_row_index

  • private pure subroutine dbcsr_count_row_index_copy(rows, counts, nrows)

    Counts columns-per-row count from row index array.

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in), DIMENSION(1:nrows + 1) :: rows

    the row_p index (input)

    integer, intent(out), DIMENSION(1:nrows) :: counts

    the count of the number of columns per row

    integer, intent(in) :: nrows

    number of rows

  • private pure subroutine dbcsr_count_row_index_inplace(rows, nrows)

    Counts columns-per-row count from row index array, in-place.

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(inout), DIMENSION(1:nrows + 1) :: rows

    the row_p index (input); the count of the number of columns per row (output)

    integer, intent(in) :: nrows

    number of rows

public interface dbcsr_build_row_index

  • private pure subroutine dbcsr_build_row_index_copy(counts, rows, nrows)

    Builds row index array from a columns-per-row count.

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in), DIMENSION(1:nrows) :: counts

    count of the number of columns per row

    integer, intent(out), DIMENSION(1:nrows + 1) :: rows

    count of the number of columns per row (input); the row_p index (output)

    integer, intent(in) :: nrows

    number of rows

  • private pure subroutine dbcsr_build_row_index_inplace(rows, nrows)

    Builds row index array from a columns-per-row count, in-place.

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(inout), DIMENSION(1:nrows + 1) :: rows

    count of the number of columns per row (input); the row_p index (output)

    integer, intent(in) :: nrows

    number of rows


Functions

public function dbcsr_has_local_row_index(matrix) result(local_indexing)

Arguments

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

Return Value logical


Subroutines

private subroutine make_index_canonical(new_row_p, new_col_i, new_blk_p, old_row_p, old_col_i, old_blk_p, matrix)

Makes a canonical index given the index arrays

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(out), DIMENSION(:) :: new_row_p
integer, intent(out), DIMENSION(:) :: new_col_i
integer, intent(out), DIMENSION(:) :: new_blk_p
integer, intent(in), DIMENSION(:) :: old_row_p
integer, intent(in), DIMENSION(:) :: old_col_i
integer, intent(in), DIMENSION(:) :: old_blk_p
type(dbcsr_type), intent(in) :: matrix

private subroutine make_index_triangular(new_row_p, new_col_i, new_blk_p, old_row_p, old_col_i, old_blk_p, matrix)

Makes a CP2K triangular index given the index arrays

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(out), DIMENSION(:) :: new_row_p
integer, intent(out), DIMENSION(:) :: new_col_i
integer, intent(out), DIMENSION(:) :: new_blk_p
integer, intent(in), DIMENSION(:) :: old_row_p
integer, intent(in), DIMENSION(:) :: old_col_i
integer, intent(in), DIMENSION(:) :: old_blk_p
type(dbcsr_type), intent(in) :: matrix

public subroutine dbcsr_make_dbcsr_index(row_p, row_i, nrows, nblks)

Collapses a row_p index

Arguments

Type IntentOptional Attributes Name
integer, intent(out), DIMENSION(1:nrows + 1) :: row_p
integer, intent(in), DIMENSION(1:nblks) :: row_i
integer, intent(in) :: nrows
integer, intent(in) :: nblks

public pure subroutine dbcsr_expand_row_index(row_p, row_i, nrows, nblks)

Expands a row_p index

Arguments

Type IntentOptional Attributes Name
integer, intent(in), DIMENSION(1:nrows + 1) :: row_p
integer, intent(out), DIMENSION(1:nblks) :: row_i
integer, intent(in) :: nrows
integer, intent(in) :: nblks

private pure subroutine dbcsr_expand_row_index_2d(row_p, row_i, nrows, dst_i)

Expands a row_p index

Arguments

Type IntentOptional Attributes Name
integer, intent(in), DIMENSION(1:nrows + 1) :: row_p
integer, intent(out), DIMENSION(:, :) :: row_i
integer, intent(in) :: nrows
integer, intent(in) :: dst_i

private pure subroutine dbcsr_count_row_index_inplace(rows, nrows)

Counts columns-per-row count from row index array, in-place.

Arguments

Type IntentOptional Attributes Name
integer, intent(inout), DIMENSION(1:nrows + 1) :: rows

the row_p index (input); the count of the number of columns per row (output)

integer, intent(in) :: nrows

number of rows

private pure subroutine dbcsr_count_row_index_copy(rows, counts, nrows)

Counts columns-per-row count from row index array.

Arguments

Type IntentOptional Attributes Name
integer, intent(in), DIMENSION(1:nrows + 1) :: rows

the row_p index (input)

integer, intent(out), DIMENSION(1:nrows) :: counts

the count of the number of columns per row

integer, intent(in) :: nrows

number of rows

private pure subroutine dbcsr_build_row_index_inplace(rows, nrows)

Builds row index array from a columns-per-row count, in-place.

Arguments

Type IntentOptional Attributes Name
integer, intent(inout), DIMENSION(1:nrows + 1) :: rows

count of the number of columns per row (input); the row_p index (output)

integer, intent(in) :: nrows

number of rows

private pure subroutine dbcsr_build_row_index_copy(counts, rows, nrows)

Builds row index array from a columns-per-row count.

Arguments

Type IntentOptional Attributes Name
integer, intent(in), DIMENSION(1:nrows) :: counts

count of the number of columns per row

integer, intent(out), DIMENSION(1:nrows + 1) :: rows

count of the number of columns per row (input); the row_p index (output)

integer, intent(in) :: nrows

number of rows

public subroutine dbcsr_addto_index_array(matrix, slot, DATA, reservation, extra)

Adds data to the index. Increases the index size when necessary.

Arguments

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

bcsr matrix

integer, intent(in) :: slot

which index array to add (e.g., dbcsr_slot_row_blk_sizes)

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

array holding the index data to add to the index array

integer, intent(in), optional :: reservation

only reserve space for subsequent array reserve extra space for later additions

integer, intent(in), optional :: extra

only reserve space for subsequent array reserve extra space for later additions

public subroutine dbcsr_clearfrom_index_array(matrix, slot)

Removes data from the index.

Arguments

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

bcsr matrix

integer, intent(in) :: slot

which index array to remove (e.g., dbcsr_slot_row_blk_sizes)

public subroutine dbcsr_repoint_index(m, slot)

Updates the index pointers of a bcsr matrix

Arguments

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

matrix for which index pointers are updated

integer, intent(in), optional :: slot

only repoint this index

public subroutine dbcsr_make_index_exist(m)

Arguments

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

Create index for this matrix

public subroutine dbcsr_sort_indices(n, row_i, col_i, blk_p, blk_d)

Sorts the rows & columns of a work matrix

Read more…

Arguments

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

number of blocks (elements) to sort

integer, intent(inout), DIMENSION(1:) :: row_i

row indices column indices

integer, intent(inout), DIMENSION(1:) :: col_i

row indices column indices

integer, intent(inout), optional, DIMENSION(1:) :: blk_p

block pointers data storage

integer, intent(inout), optional, DIMENSION(1:) :: blk_d

block pointers data storage

public subroutine dbcsr_index_prune_deleted(matrix)

Removes the deleted blocks from the index.

Read more…

Arguments

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

Prune the index of this matrix.

public subroutine transpose_index_local(new_col_p, new_row_i, old_row_p, old_col_i, new_blk_p, old_blk_p)

Re-indexes row_p and blk_i according to columns.

Read more…

Arguments

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

new column pointer new row index

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

new column pointer new row index

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

old row pointer old column index

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

old row pointer old column index

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

new block pointer

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

old block pointer

public subroutine dbcsr_make_index_canonical(matrix, cp2k)

Makes a canonical index to the distribution.

Read more…

Arguments

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

matrix for which to make canonical index

logical, intent(in), optional :: cp2k

make CP2K triangular index from canonical; default is false

public subroutine make_dense_index(row_p, col_i, blk_p, nblkrows_total, nblkcols_total, myblkrows, myblkcols, row_blk_offsets, col_blk_offsets, meta, make_tr)

Makes the index for a dense matrix

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(out), DIMENSION(1:nblkrows_total + 1) :: row_p

Storage for new index

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

Storage for new index Storage for new index

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

Storage for new index Storage for new index

integer, intent(in) :: nblkrows_total

Total blocked rows

integer, intent(in) :: nblkcols_total

Total blocked columns

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

List of blocked rows in my process row List of blocked columns in my process column

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

List of blocked rows in my process row List of blocked columns in my process column

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

List of blocked rows in my process row List of blocked columns in my process column

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

List of blocked rows in my process row List of blocked columns in my process column

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

Metadata updates for new index

logical, intent(in), optional :: make_tr

Dense blocks are transposed

public subroutine make_undense_index(row_p, col_i, blk_p, distribution, local_row_offsets, local_col_offsets, meta)

Makes a blocked index from a dense matrix

Read more…

Arguments

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

Storage for new index Storage for new index Storage for new index

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

Storage for new index Storage for new index Storage for new index

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

Storage for new index Storage for new index Storage for new index

type(dbcsr_distribution_obj) :: distribution

Blocked distribution

integer, intent(in), DIMENSION(:) :: local_row_offsets
integer, intent(in), DIMENSION(:) :: local_col_offsets
integer, intent(inout), DIMENSION(dbcsr_meta_size) :: meta

Metadata updates for new index

public subroutine merge_index_arrays(new_row_i, new_col_i, new_blk_p, new_size, old_row_i, old_col_i, old_blk_p, old_size, add_ip, add_size, new_blk_d, old_blk_d, added_size_offset, added_sizes, added_size, added_nblks)

Merges two indices

Read more…

Arguments

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

merged result merged result merged result

integer, intent(out), DIMENSION(new_size) :: new_col_i

merged result merged result merged result

integer, intent(out), DIMENSION(new_size) :: new_blk_p

merged result merged result merged result

integer, intent(in) :: new_size

size of merged index

integer, intent(in), DIMENSION(old_size) :: old_row_i

current index current index current index

integer, intent(in), DIMENSION(old_size) :: old_col_i

current index current index current index

integer, intent(in), DIMENSION(old_size) :: old_blk_p

current index current index current index

integer, intent(in) :: old_size

size of current index

integer, intent(in), DIMENSION(3, add_size) :: add_ip

index to add into the current index

integer, intent(in) :: add_size

size of index to add into the current index

integer, intent(out), optional, DIMENSION(new_size) :: new_blk_d
integer, intent(in), optional, DIMENSION(old_size) :: old_blk_d
integer, intent(in), optional :: added_size_offset

specify base of added sizes

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

specify sizes of added blocks

integer, intent(out), optional :: added_size

counts number of sizes of added blocks actual number of new elements

integer, intent(out), optional :: added_nblks

counts number of sizes of added blocks actual number of new elements

public subroutine dbcsr_make_index_local_row(matrix)

Converts BCSR global row index to local row index.

Arguments

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

matrix for which to make canonical index

public subroutine dbcsr_make_index_list(matrix, thread_redist)

Converts BCSR index into list indices (similar to work matrices)

Arguments

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

matrix for which to make canonical index

logical, intent(in) :: thread_redist

make a thread subdistribution

public subroutine dbcsr_index_compact(matrix)

Compacts an index.

Arguments

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

matrix for which to make canonical index

public subroutine dbcsr_index_checksum(matrix, checksum)

Calculates the checksum of an index.

Arguments

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

matrix for which to make canonical index

integer, intent(out) :: checksum