Documentation for module dbcsr_index_operations

Operations on the DBCSR index

source: dbcsr_index_operations.F
Loading...

Generic procedures:

dbcsr_build_row_index
dbcsr_count_row_index

public Subroutines/Functions:

Adds data to the index. Incleases the index size when neccessary.
Removes data from the index.
Expands a row_p index
FUNCTION
LOGICAL
dbcsr_has_local_row_index (matrix)
...
Calculates the checksum of an index.
Compacts an index.
Removes the deleted blocks from the index.
Collapses a row_p index
Makes a canonical index to the distribution.
...
Converts BCSR index into list indices (similar to work matrices)
Converts BCSR global row index to local row index.
SUBROUTINE
dbcsr_repoint_index (m, slot)
Updates the index pointers of a bcsr matrix
Sorts the rows & columns of a work matrix
Makes the index for a dense matrix
Makes a blocked index from a dense matrix
Merges two indices
Re-indexes row_p and blk_i according to columns.

Generic procedure dbcsr_build_row_index

...

INTEGER,
INTENT(in)
:: counts(1:nrows) ×
INTEGER,
INTENT(out)
:: rows(1:nrows+1) ×
INTEGER,
INTENT(inout)
:: rows(1:nrows+1) ×
INTEGER,
INTENT(in)
:: nrows × ×

Generic procedure dbcsr_count_row_index

...

INTEGER,
INTENT(in)
:: rows(1:nrows+1) ×
INTEGER,
INTENT(inout)
:: rows(1:nrows+1) ×
INTEGER,
INTENT(out)
:: counts(1:nrows) ×
INTEGER,
INTENT(in)
:: nrows × ×

SUBROUTINEdbcsr_addto_index_array(matrix, slot, data, reservation, extra)

Adds data to the index. Incleases the index size when neccessary.

Arguments:
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
:: data(:) array holding the index data to add to the index array
INTEGER,
INTENT(in),
OPTIONAL
:: reservation only reserve space for subsequent array
INTEGER,
INTENT(in),
OPTIONAL
:: extra reserve extra space for later additions

SUBROUTINEdbcsr_clearfrom_index_array(matrix, slot)

Removes data from the index.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix bcsr matrix
INTEGER,
INTENT(in)
:: slot which index array to remove (e.g., dbcsr_slot_row_blk_sizes)

PURE SUBROUTINEdbcsr_expand_row_index(row_p, row_i, nrows, nblks)

Expands a row_p index

Arguments:
INTEGER,
INTENT(in)
:: row_p(1:nrows+1) ...
INTEGER,
INTENT(out)
:: row_i(1:nblks) ...
INTEGER,
INTENT(in)
:: nrows ...
INTEGER,
INTENT(in)
:: nblks ...

FUNCTIONdbcsr_has_local_row_index(matrix)

...

Return Value ::
LOGICAL
Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix ...

SUBROUTINEdbcsr_index_checksum(matrix, checksum)

Calculates the checksum of an index.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix matrix for which to make canonical index
INTEGER,
INTENT(out)
:: checksum ...

SUBROUTINEdbcsr_index_compact(matrix)

Compacts an index.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix matrix for which to make canonical index

SUBROUTINEdbcsr_index_prune_deleted(matrix)

Removes the deleted blocks from the index.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix Prune the index of this matrix.

SUBROUTINEdbcsr_make_dbcsr_index(row_p, row_i, nrows, nblks)

Collapses a row_p index

Arguments:
INTEGER,
INTENT(out)
:: row_p(1:nrows+1) ...
INTEGER,
INTENT(in)
:: row_i(1:nblks) ...
INTEGER,
INTENT(in)
:: nrows ...
INTEGER,
INTENT(in)
:: nblks ...

SUBROUTINEdbcsr_make_index_canonical(matrix, cp2k)

Makes a canonical index to the distribution.

Arguments:
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

SUBROUTINEdbcsr_make_index_exist(m)

...

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: m Create index for this matrix

SUBROUTINEdbcsr_make_index_list(matrix, thread_redist)

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

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix matrix for which to make canonical index
LOGICAL,
INTENT(in)
:: thread_redist make a thread subdistribution

SUBROUTINEdbcsr_make_index_local_row(matrix)

Converts BCSR global row index to local row index.

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: matrix matrix for which to make canonical index

SUBROUTINEdbcsr_repoint_index(m, slot)

Updates the index pointers of a bcsr matrix

Arguments:
TYPE(dbcsr_type),
INTENT(inout)
:: m matrix for which index pointers are updated
INTEGER,
INTENT(in),
OPTIONAL
:: slot only repoint this index

SUBROUTINEdbcsr_sort_indices(n, row_i, col_i, blk_p, blk_d)

Sorts the rows & columns of a work matrix

Arguments:
INTEGER,
INTENT(in)
:: n number of blocks (elements) to sort
INTEGER,
INTENT(inout)
:: row_i(1:) row indices
INTEGER,
INTENT(inout)
:: col_i(1:) column indices
INTEGER,
INTENT(inout),
OPTIONAL
:: blk_p(1:) block pointers
INTEGER,
INTENT(inout),
OPTIONAL
:: blk_d(1:) data storage

SUBROUTINEmake_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

Arguments:
INTEGER,
INTENT(out)
:: row_p(1:nblkrows_total+1) Storage for new index
INTEGER,
INTENT(out)
:: col_i(:) Storage for new index
INTEGER,
INTENT(out)
:: blk_p(:) Storage for new index
INTEGER,
INTENT(in)
:: nblkrows_total Total blocked rows
INTEGER,
INTENT(in)
:: nblkcols_total Total blocked columns
INTEGER,
INTENT(in)
:: myblkrows(:) List of blocked rows in my process row
INTEGER,
INTENT(in)
:: myblkcols(:) List of blocked columns in my process column
INTEGER,
INTENT(in)
:: row_blk_offsets(:) ...
INTEGER,
INTENT(in)
:: col_blk_offsets(:) ...
INTEGER,
INTENT(inout)
:: meta(dbcsr_meta_size) Metadata updates for new index
LOGICAL,
INTENT(in),
OPTIONAL
:: make_tr Dense blocks are transposed

SUBROUTINEmake_undense_index(row_p, col_i, blk_p, distribution, local_row_offsets, local_col_offsets, meta)

Makes a blocked index from a dense matrix

Arguments:
INTEGER,
INTENT(out)
:: row_p(:) Storage for new index
INTEGER,
INTENT(out)
:: col_i(:) Storage for new index
INTEGER,
INTENT(out)
:: blk_p(:) Storage for new index
:: distribution Blocked distribution
INTEGER,
INTENT(in)
:: local_row_offsets(:) ...
INTEGER,
INTENT(in)
:: local_col_offsets(:) ...
INTEGER,
INTENT(inout)
:: meta(dbcsr_meta_size) Metadata updates for new index

SUBROUTINEmerge_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

Arguments:
INTEGER,
INTENT(out)
:: new_row_i(new_size) merged result
INTEGER,
INTENT(out)
:: new_col_i(new_size) merged result
INTEGER,
INTENT(out)
:: new_blk_p(new_size) merged result
INTEGER,
INTENT(in)
:: new_size size of merged index
INTEGER,
INTENT(in)
:: old_row_i(old_size) current index
INTEGER,
INTENT(in)
:: old_col_i(old_size) current index
INTEGER,
INTENT(in)
:: old_blk_p(old_size) current index
INTEGER,
INTENT(in)
:: old_size size of current index
INTEGER,
INTENT(in)
:: add_ip(3,add_size) 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
:: new_blk_d(new_size) ...
INTEGER,
INTENT(in),
OPTIONAL
:: old_blk_d(old_size) ...
INTEGER,
INTENT(in),
OPTIONAL
:: added_size_offset specify base of added sizes
INTEGER,
INTENT(in),
OPTIONAL
:: added_sizes(:) specify sizes of added blocks
INTEGER,
INTENT(out),
OPTIONAL
:: added_size counts number of sizes of added blocks
INTEGER,
INTENT(out),
OPTIONAL
:: added_nblks actual number of new elements

SUBROUTINEtranspose_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.

Arguments:
INTEGER,
INTENT(out)
:: new_col_p(:) new column pointer
INTEGER,
INTENT(out)
:: new_row_i(:) new row index
INTEGER,
INTENT(in)
:: old_row_p(:) old row pointer
INTEGER,
INTENT(in)
:: old_col_i(:) old column index
INTEGER,
INTENT(out),
OPTIONAL
:: new_blk_p(:) new block pointer
INTEGER,
INTENT(in),
OPTIONAL
:: old_blk_p(:) old block pointer

PURE SUBROUTINEdbcsr_build_row_index_copy(counts, rows, nrows)

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

Arguments:
INTEGER,
INTENT(in)
:: counts(1:nrows) count of the number of colums per row
INTEGER,
INTENT(out)
:: rows(1:nrows+1) count of the number of colums per row (input); the row_p index (output)
INTEGER,
INTENT(in)
:: nrows number of rows

PURE SUBROUTINEdbcsr_build_row_index_inplace(rows, nrows)

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

Arguments:
INTEGER,
INTENT(inout)
:: rows(1:nrows+1) count of the number of colums per row (input); the row_p index (output)
INTEGER,
INTENT(in)
:: nrows number of rows

PURE SUBROUTINEdbcsr_count_row_index_copy(rows, counts, nrows)

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

Arguments:
INTEGER,
INTENT(in)
:: rows(1:nrows+1) the row_p index (input)
INTEGER,
INTENT(out)
:: counts(1:nrows) the count of the number of columns per row
INTEGER,
INTENT(in)
:: nrows number of rows

PURE SUBROUTINEdbcsr_count_row_index_inplace(rows, nrows)

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

Arguments:
INTEGER,
INTENT(inout)
:: rows(1:nrows+1) the row_p index (input); the count of the number of columns per row (output)
INTEGER,
INTENT(in)
:: nrows number of rows