DBCSR work matrix utilities
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=*), | private, | parameter | :: | moduleN | = | 'dbcsr_work_operations' | |
logical, | private, | parameter | :: | careful_mod | = | .FALSE. |
Creates a matrix, allocating the essentials.
The matrix itself is allocated, as well as the essential parts of the index. When passed the nze argument, the data is also allocated to that size. see dbcsr_types.F
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
new matrix |
||
character(len=*), | intent(in) | :: | name | |||
type(dbcsr_distribution_obj), | intent(in) | :: | dist |
distribution_2d distribution |
||
character(len=1), | intent(in) | :: | matrix_type |
'N' for normal, 'T' for transposed, 'S' for symmetric, and 'A' for antisymmetric |
||
integer, | intent(inout), | optional, | DIMENSION(:), POINTER, CONTIGUOUS | :: | row_blk_size | |
integer, | intent(inout), | optional, | DIMENSION(:), POINTER, CONTIGUOUS | :: | col_blk_size | |
type(array_i1d_obj), | intent(in), | optional | :: | row_blk_size_obj | ||
type(array_i1d_obj), | intent(in), | optional | :: | col_blk_size_obj | ||
integer, | intent(in), | optional | :: | nze |
number of elements type of data from 'rRcC' for single/double precision real/complex, default is 'R' |
|
integer, | intent(in), | optional | :: | data_type |
number of elements type of data from 'rRcC' for single/double precision real/complex, default is 'R' |
|
type(dbcsr_data_obj), | intent(in), | optional | :: | data_buffer | ||
type(dbcsr_memtype_type), | intent(in), | optional | :: | data_memory_type |
allocate indices and data using special memory allocate indices using special memory |
|
type(dbcsr_memtype_type), | intent(in), | optional | :: | index_memory_type |
allocate indices and data using special memory allocate indices using special memory |
|
integer, | intent(in), | optional | :: | max_rbs | ||
integer, | intent(in), | optional | :: | max_cbs | ||
type(array_i1d_obj), | intent(in), | optional | :: | row_blk_offset | ||
type(array_i1d_obj), | intent(in), | optional | :: | col_blk_offset | ||
type(dbcsr_distribution_obj), | intent(in), | optional | :: | thread_dist | ||
logical, | intent(in), | optional | :: | reuse |
reuses an existing matrix, default is to create a fresh one uses the mutable data for working and not the append-only data; default is append-only |
|
logical, | intent(in), | optional | :: | reuse_arrays |
reuses an existing matrix, default is to create a fresh one uses the mutable data for working and not the append-only data; default is append-only |
|
logical, | intent(in), | optional | :: | mutable_work |
reuses an existing matrix, default is to create a fresh one uses the mutable data for working and not the append-only data; default is append-only |
|
logical, | intent(in), | optional | :: | make_index |
reuses an existing matrix, default is to create a fresh one uses the mutable data for working and not the append-only data; default is append-only |
|
character(len=1), | intent(in), | optional | :: | replication_type |
replication to be used for this matrix; default is dbcsr_repl_none |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix | |||
type(dbcsr_type), | intent(in) | :: | template | |||
character(len=*), | intent(in), | optional | :: | name | ||
type(dbcsr_distribution_obj), | intent(in), | optional | :: | dist | ||
character(len=1), | intent(in), | optional | :: | matrix_type | ||
integer, | intent(inout), | optional, | DIMENSION(:), POINTER, CONTIGUOUS | :: | row_blk_size | |
integer, | intent(inout), | optional, | DIMENSION(:), POINTER, CONTIGUOUS | :: | col_blk_size | |
type(array_i1d_obj), | intent(in), | optional | :: | row_blk_size_obj | ||
type(array_i1d_obj), | intent(in), | optional | :: | col_blk_size_obj | ||
integer, | intent(in), | optional | :: | nze | ||
integer, | intent(in), | optional | :: | data_type | ||
type(dbcsr_data_obj), | intent(in), | optional | :: | data_buffer | ||
type(dbcsr_memtype_type), | intent(in), | optional | :: | data_memory_type | ||
type(dbcsr_memtype_type), | intent(in), | optional | :: | index_memory_type | ||
integer, | intent(in), | optional | :: | max_rbs | ||
integer, | intent(in), | optional | :: | max_cbs | ||
type(array_i1d_obj), | intent(in), | optional | :: | row_blk_offset | ||
type(array_i1d_obj), | intent(in), | optional | :: | col_blk_offset | ||
logical, | intent(in), | optional | :: | reuse_arrays | ||
logical, | intent(in), | optional | :: | mutable_work | ||
logical, | intent(in), | optional | :: | make_index | ||
character(len=1), | intent(in), | optional | :: | replication_type |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | DIMENSION(:), POINTER, CONTIGUOUS | :: | p | => | NULL() |
Checks whether the matrix can be finalized with minimal copying.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(in) | :: | matrix |
matrix to check |
whether matrix can be quickly finalized
Checks whether a point is within bounds \return whether the point is within the bounds
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | row |
point to check point to check |
||
integer, | intent(in) | :: | column |
point to check point to check |
||
integer, | intent(in), | DIMENSION(4) | :: | limits |
limits (low_row, high_row, low_col, high_col) |
Creates a matrix, allocating the essentials.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
new matrix |
||
character(len=*), | intent(in) | :: | name | |||
type(dbcsr_distribution_obj), | intent(in) | :: | dist |
distribution_2d distribution |
||
character(len=1), | intent(in) | :: | matrix_type |
'N' for normal, 'T' for transposed, 'S' for symmetric, and 'A' for antisymmetric |
||
integer, | intent(inout), | optional, | DIMENSION(:), POINTER, CONTIGUOUS | :: | row_blk_size | |
integer, | intent(inout), | optional, | DIMENSION(:), POINTER, CONTIGUOUS | :: | col_blk_size | |
type(array_i1d_obj), | intent(in), | optional | :: | row_blk_size_obj | ||
type(array_i1d_obj), | intent(in), | optional | :: | col_blk_size_obj | ||
integer, | intent(in), | optional | :: | nze |
number of elements type of data from 'rRcC' for single/double precision real/complex, default is 'R' |
|
integer, | intent(in), | optional | :: | data_type |
number of elements type of data from 'rRcC' for single/double precision real/complex, default is 'R' |
|
type(dbcsr_data_obj), | intent(in), | optional | :: | data_buffer | ||
type(dbcsr_memtype_type), | intent(in), | optional | :: | data_memory_type |
allocate indices and data using special memory allocate indices using special memory |
|
type(dbcsr_memtype_type), | intent(in), | optional | :: | index_memory_type |
allocate indices and data using special memory allocate indices using special memory |
|
integer, | intent(in), | optional | :: | max_rbs | ||
integer, | intent(in), | optional | :: | max_cbs | ||
type(array_i1d_obj), | intent(in), | optional | :: | row_blk_offset | ||
type(array_i1d_obj), | intent(in), | optional | :: | col_blk_offset | ||
type(dbcsr_distribution_obj), | intent(in), | optional | :: | thread_dist | ||
logical, | intent(in), | optional | :: | reuse |
reuses an existing matrix, default is to create a fresh one uses the mutable data for working and not the append-only data; default is append-only |
|
logical, | intent(in), | optional | :: | reuse_arrays |
reuses an existing matrix, default is to create a fresh one uses the mutable data for working and not the append-only data; default is append-only |
|
logical, | intent(in), | optional | :: | mutable_work |
reuses an existing matrix, default is to create a fresh one uses the mutable data for working and not the append-only data; default is append-only |
|
logical, | intent(in), | optional | :: | make_index |
reuses an existing matrix, default is to create a fresh one uses the mutable data for working and not the append-only data; default is append-only |
|
character(len=1), | intent(in), | optional | :: | replication_type |
replication to be used for this matrix; default is dbcsr_repl_none |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix | |||
type(dbcsr_type), | intent(in) | :: | template | |||
character(len=*), | intent(in), | optional | :: | name | ||
type(dbcsr_distribution_obj), | intent(in), | optional | :: | dist | ||
character(len=1), | intent(in), | optional | :: | matrix_type | ||
integer, | intent(inout), | optional, | DIMENSION(:), POINTER, CONTIGUOUS | :: | row_blk_size | |
integer, | intent(inout), | optional, | DIMENSION(:), POINTER, CONTIGUOUS | :: | col_blk_size | |
type(array_i1d_obj), | intent(in), | optional | :: | row_blk_size_obj | ||
type(array_i1d_obj), | intent(in), | optional | :: | col_blk_size_obj | ||
integer, | intent(in), | optional | :: | nze | ||
integer, | intent(in), | optional | :: | data_type | ||
type(dbcsr_data_obj), | intent(in), | optional | :: | data_buffer | ||
type(dbcsr_memtype_type), | intent(in), | optional | :: | data_memory_type | ||
type(dbcsr_memtype_type), | intent(in), | optional | :: | index_memory_type | ||
integer, | intent(in), | optional | :: | max_rbs | ||
integer, | intent(in), | optional | :: | max_cbs | ||
type(array_i1d_obj), | intent(in), | optional | :: | row_blk_offset | ||
type(array_i1d_obj), | intent(in), | optional | :: | col_blk_offset | ||
logical, | intent(in), | optional | :: | reuse_arrays | ||
logical, | intent(in), | optional | :: | mutable_work | ||
logical, | intent(in), | optional | :: | make_index | ||
character(len=1), | intent(in), | optional | :: | replication_type |
Initializes one work matrix
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_work_type), | intent(out) | :: | wm |
initialized work matrix |
||
integer, | intent(in) | :: | data_type | |||
integer, | intent(in), | optional | :: | nblks_guess |
estimated number of blocks estimated size of data |
|
integer, | intent(in), | optional | :: | sizedata_guess |
estimated number of blocks estimated size of data |
|
type(dbcsr_memtype_type), | intent(in), | optional | :: | memory_type |
Creates a the working matrix(es) for a DBCSR matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
new matrix |
||
integer, | intent(in), | optional | :: | nblks_guess |
estimated number of blocks estimated size of data number work matrices to create, default is 1 |
|
integer, | intent(in), | optional | :: | sizedata_guess |
estimated number of blocks estimated size of data number work matrices to create, default is 1 |
|
integer, | intent(in), | optional | :: | n |
estimated number of blocks estimated size of data number work matrices to create, default is 1 |
|
logical, | intent(in), | optional | :: | work_mutable |
use mutable work type, default is what was specified in create |
|
type(dbcsr_memtype_type), | intent(in), | optional | :: | memory_type |
Creates the final dbcsr_type matrix from the working matrix. Work matrices (array or tree-based) are merged into the base DBCSR matrix. If a matrix is marked as having a valid index, then nothing is done. Deleted blocks are pruned from the index.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
final matrix |
||
logical, | intent(in), | optional | :: | reshuffle |
whether the data should be reshuffled, default is false |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix | |||
logical, | intent(in), | optional | :: | reshuffle |
Performs quick finalization of matrix The data area from the work matrix is accepted as the new matrix's data area and the index is built from the work matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
matrix to finalize |
Creates a work matrix from the data present in a finalized matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
DBCSR matrix |
||
integer, | intent(in), | optional, | DIMENSION(4) | :: | limits |
the limits to use for copying |
Fills index and data of the work matrix from the previously-finalized one.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_work_type), | intent(inout), | DIMENSION(:) | :: | wm |
the work matrix to fill |
|
type(dbcsr_type), | intent(inout) | :: | matrix |
DBCSR matrix |
||
integer, | intent(in) | :: | size_used | |||
integer, | intent(in), | optional, | DIMENSION(4) | :: | limits |
only fills blocks within this range |
Deallocates and destroys a work matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_work_type), | intent(inout) | :: | wm |
work matrix |
Deallocates and destroys a work matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | m |
Adds a coordinate (or other data) into a work matrix's row_i and col_i arrays and returns its position.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_work_type), | intent(inout) | :: | matrix |
work matrix |
||
integer, | intent(in) | :: | row |
row data to add col data to add |
||
integer, | intent(in) | :: | col |
row data to add col data to add |
||
integer, | intent(in), | optional | :: | blk |
block pointer to add |
|
integer, | intent(out), | optional | :: | index |
saved position |
Merge data from matrix and work matrices into the final matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
matrix to work on |
||
integer, | intent(in), | DIMENSION(*) | :: | old_row_p | ||
integer, | intent(in), | DIMENSION(*) | :: | old_col_i | ||
integer, | intent(in), | DIMENSION(*) | :: | old_blk_p | ||
logical, | intent(in) | :: | sort_data |
whether data will be fully sorted |
Sort data from the WM into the final matrix, based closely on dbcsr_merge_all
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_type), | intent(inout) | :: | matrix |
matrix to work on |
Builds a new index from several work matrices.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(*) | :: | new_row_p | ||
integer, | intent(out), | DIMENSION(*), TARGET | :: | new_col_i | ||
integer, | intent(out), | DIMENSION(*), TARGET | :: | new_blk_p | ||
integer, | intent(in), | DIMENSION(*), TARGET | :: | blk_d | ||
integer, | intent(in), | DIMENSION(*) | :: | old_row_p | ||
integer, | intent(in), | DIMENSION(*) | :: | old_col_i | ||
integer, | intent(in), | DIMENSION(*) | :: | old_blk_p | ||
type(i_array_p), | intent(in), | DIMENSION(*) | :: | all_row_p | ||
type(i_array_p), | intent(in), | DIMENSION(*) | :: | all_col_i | ||
type(i_array_p), | intent(in), | DIMENSION(*) | :: | all_blk_p | ||
integer, | intent(in), | DIMENSION(*) | :: | all_data_offsets | ||
integer, | intent(in) | :: | nwms | |||
integer, | intent(in) | :: | nrows | |||
integer, | intent(in) | :: | max_row_count | |||
logical, | intent(in) | :: | sort_data |
Converts mutable data to linear (array) type.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_work_type), | intent(inout) | :: | wm |
work matrix to convert |
Converts mutable data to linear (array) type.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_work_type), | intent(inout) | :: | wm |
work matrix to convert |
Converts mutable data to linear (array) type.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_work_type), | intent(inout) | :: | wm |
work matrix to convert |
Converts mutable data to linear (array) type.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_work_type), | intent(inout) | :: | wm |
work matrix to convert |