DBCSR sparse matrix utility routines
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=*), | private, | parameter | :: | moduleN | = | 'dbcsr_dist_util' | |
logical, | private, | parameter | :: | bcsr_info | = | .FALSE. | |
logical, | private, | parameter | :: | bcsr_verbose | = | .FALSE. |
The sum of a subset of rows/columns \return sum of sizes of local elements
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | all_offsets |
ordered offsets of all the elements enumerated local elements |
|
integer, | intent(in), | DIMENSION(:) | :: | local_elements |
ordered offsets of all the elements enumerated local elements |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n | |||
integer, | intent(in) | :: | oldsign | |||
logical, | intent(in) | :: | x |
Calculates the checksum of a DBCSR matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | matrix |
matrix |
||
logical, | intent(in), | optional | :: | local |
no global communication position-dependent checksum |
|
logical, | intent(in), | optional | :: | pos |
no global communication position-dependent checksum |
calculated checksum
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ld | |||
integer, | intent(in) | :: | od | |||
real(kind=dp), | intent(in), | DIMENSION(ld, od) | :: | DATA | ||
logical, | intent(in) | :: | tr | |||
integer, | intent(in) | :: | ro | |||
integer, | intent(in) | :: | co |
Finds block to which a full element belongs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | full |
full element |
||
integer, | intent(out) | :: | block |
block to which full belongs |
||
integer, | intent(in) | :: | nblocks | |||
integer, | intent(in), | DIMENSION(1:nblocks + 1) | :: | block_offsets |
starting full elements of blocks |
|
integer, | intent(in) | :: | hint |
where to start looking; ignored if 0 |
Converts sizes to offsets
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | sizes |
array with sizes |
|
integer, | intent(out), | DIMENSION(:) | :: | offsets_start |
offsets of starts |
|
integer, | intent(out), | optional, | DIMENSION(:) | :: | offsets_stop |
offsets of ends |
Converts offsets to sizes If the offsets of ends are not given, then the array of sizes is assumed to be one greater than the desired sizes.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | offsets_start |
offsets of starts |
|
integer, | intent(out), | DIMENSION(:) | :: | sizes |
array with sizes |
|
integer, | intent(in), | optional, | DIMENSION(:) | :: | offsets_stop |
offsets of ends |
Converts global offsets to local
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | global_offsets |
Offsets of elements in the global grid Which elements are local |
|
integer, | intent(in), | DIMENSION(:) | :: | local_elements |
Offsets of elements in the global grid Which elements are local |
|
integer, | intent(out), | DIMENSION(:) | :: | local_offsets |
Offsets of local elements. |
Finds internal offsets For all local blocks in blk_local_els, it calculates its offset in the dense block to which it belongs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | blk_local_els | ||
integer, | intent(in), | DIMENSION(:) | :: | el_map | ||
integer, | intent(in), | DIMENSION(:) | :: | blk_el_offsets | ||
integer, | intent(in), | DIMENSION(:) | :: | dense_el_offsets | ||
integer, | intent(out), | DIMENSION(:) | :: | internal_offsets |
Calculates explicit sizes for all data blocks.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(out), | DIMENSION(*) | :: | sizes |
sizes of all data blocks |
|
integer, | intent(in), | DIMENSION(:) | :: | row_p |
index structure |
|
integer, | intent(in), | DIMENSION(*) | :: | col_i |
index structure row block sizes column block sizes |
|
integer, | intent(in), | DIMENSION(*) | :: | rbs |
index structure row block sizes column block sizes |
|
integer, | intent(in), | DIMENSION(*) | :: | cbs |
index structure row block sizes column block sizes |
Fills meta information from a given distribution_2d
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(out), | DIMENSION(dbcsr_meta_size) | :: | meta |
meta information array to fill |
|
type(dbcsr_distribution_obj), | intent(in) | :: | dist |
processor distribution |
||
integer, | intent(in), | DIMENSION(:), POINTER | :: | row_blk_size |
row block sizes column block sizes |
|
integer, | intent(in), | DIMENSION(:), POINTER | :: | col_blk_size |
row block sizes column block sizes |
Copies metadata into an array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | matrix |
Matrix |
||
integer, | intent(out), | DIMENSION(dbcsr_meta_size) | :: | meta |
Metadata elements |
Sets metadata form an array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
Matrix |
||
integer, | intent(in), | DIMENSION(dbcsr_meta_size) | :: | meta |
Metadata elements |
Verify the correctness of a BCSR matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | m |
bcsr matrix |
||
integer, | intent(in), | optional | :: | verbosity |
how detailed errors are; 0=nothing; 1=summary at end if matrix not consistent; 2=also individual errors; 3=always print info about matrix; >3=even more info |
|
logical, | intent(in), | optional | :: | local |
no global communication |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nelements | |||
integer, | intent(in), | DIMENSION(:) | :: | bins | ||
integer, | intent(in) | :: | nbins | |||
integer, | intent(out), | DIMENSION(1:nbins) | :: | bin_counts |
Makes a lookup table from the most common elements.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | array |
Array for which to find the most common elements. |
|
integer(kind=int_4), | DIMENSION(:), POINTER | :: | most_common_map |
Ranking of the most common elements in array |
||
integer, | intent(in) | :: | nmost_common |
The number of most common elements |
||
integer, | intent(out), | DIMENSION(:) | :: | most_common_elements |
The most common elements in array |
|
integer, | intent(in) | :: | size_limit |
Limit maximum size to this value |
||
integer, | intent(out) | :: | max_val |