Operations on the DBCSR index
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. |
Counts columns-per-row count from row index array.
Type | Intent | Optional | 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 |
Counts columns-per-row count from row index array, in-place.
Type | Intent | Optional | 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 |
Builds row index array from a columns-per-row count.
Type | Intent | Optional | 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 |
Builds row index array from a columns-per-row count, in-place.
Type | Intent | Optional | 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 |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
Makes a canonical index given the index arrays
Type | Intent | Optional | 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 |
Makes a CP2K triangular index given the index arrays
Type | Intent | Optional | 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 |
Collapses a row_p index
Type | Intent | Optional | 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 |
Expands a row_p index
Type | Intent | Optional | 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 |
Expands a row_p index
Type | Intent | Optional | 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 |
Counts columns-per-row count from row index array, in-place.
Type | Intent | Optional | 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 |
Counts columns-per-row count from row index array.
Type | Intent | Optional | 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 |
Builds row index array from a columns-per-row count, in-place.
Type | Intent | Optional | 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 |
Builds row index array from a columns-per-row count.
Type | Intent | Optional | 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 |
Adds data to the index. Increases the index size when necessary.
Type | Intent | Optional | 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 |
Removes data from the index.
Type | Intent | Optional | 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) |
Updates the index pointers of a bcsr matrix
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | m |
matrix for which index pointers are updated |
||
integer, | intent(in), | optional | :: | slot |
only repoint this index |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | m |
Create index for this matrix |
Sorts the rows & columns of a work matrix
Type | Intent | Optional | 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 |
Removes the deleted blocks from the index.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
Prune the index of this matrix. |
Re-indexes row_p and blk_i according to columns.
Type | Intent | Optional | 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 |
Makes a canonical index to the distribution.
Type | Intent | Optional | 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 |
Makes the index for a dense matrix
Type | Intent | Optional | 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 |
Makes a blocked index from a dense matrix
Type | Intent | Optional | 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 |
Merges two indices
Type | Intent | Optional | 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 |
Converts BCSR global row index to local row index.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
matrix for which to make canonical index |
Converts BCSR index into list indices (similar to work matrices)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
matrix for which to make canonical index |
||
logical, | intent(in) | :: | thread_redist |
make a thread subdistribution |
Compacts an index.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
matrix for which to make canonical index |
Calculates the checksum of an index.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
matrix for which to make canonical index |
||
integer, | intent(out) | :: | checksum |