Global data (distribution and block sizes) for tall-and-skinny matrices For very sparse matrices with one very large dimension, storing array data of the same size as the matrix dimensions may require too much memory and we need to compute them on the fly for a given row or column. Hence global array data such as distribution and block sizes are specified as function objects, leaving up to the caller how to efficiently store global data.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=*), | private, | parameter | :: | moduleN | = | 'dbcsr_tas_global' |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | split_size | |||
integer, | intent(in) | :: | nprowcol | |||
integer(kind=int_8), | intent(in) | :: | nmrowcol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | dist_vec | ||
integer, | intent(in) | :: | nprowcol | |||
integer(kind=int_8), | intent(in) | :: | nmrowcol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | dist_vec | ||
integer, | intent(in) | :: | nprowcol | |||
integer, | intent(in) | :: | nmrowcol | |||
integer, | intent(in) | :: | n_repl | |||
integer, | intent(in) | :: | dist_size |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | blk_size_vec |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | blk_size_vec | ||
integer, | intent(in) | :: | n_repl |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int_8), | intent(in) | :: | nrowcol |
map matrix rows/cols to distribution rows/cols:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_distribution), | intent(in) | :: | t | |||
integer(kind=int_8), | intent(in) | :: | rowcol |
map distribution rows/cols to matrix rows/cols:
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_distribution), | intent(in) | :: | t | |||
integer, | intent(in) | :: | dist |
integer data for each block row / col
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_rowcol_data), | intent(in) | :: | t | |||
integer(kind=int_8), | intent(in) | :: | rowcol |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | nprowcol | = | -1 | ||
integer(kind=int_8), | public | :: | nmrowcol | = | -1_int_8 |
procedure(rowcol_dist), public, deferred :: dist | |
procedure(dist_rowcols), public, deferred :: rowcols |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | nprowcol | = | -1 | ||
integer(kind=int_8), | public | :: | nmrowcol | = | -1_int_8 | ||
integer, | public | :: | split_size | = | -1 |
private function new_dbcsr_tas_dist_cyclic (split_size, nprowcol, nmrowcol) |
procedure, public :: dist => cyclic_dist | |
procedure, public :: rowcols => cyclic_rowcols |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | nprowcol | = | -1 | ||
integer(kind=int_8), | public | :: | nmrowcol | = | -1_int_8 | ||
integer, | public, | DIMENSION(:), ALLOCATABLE | :: | dist_vec |
private function new_dbcsr_tas_dist_arb (dist_vec, nprowcol, nmrowcol) |
procedure, public :: dist => arb_dist | |
procedure, public :: rowcols => arb_rowcols |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | nprowcol | = | -1 | ||
integer(kind=int_8), | public | :: | nmrowcol | = | -1_int_8 | ||
integer, | public, | DIMENSION(:), ALLOCATABLE | :: | dist_vec | |||
integer, | public | :: | nmrowcol_local | = | -1 | ||
integer, | public | :: | n_repl | = | -1 | ||
integer, | public | :: | dist_size | = | -1 |
private function new_dbcsr_tas_dist_repl (dist_vec, nprowcol, nmrowcol, n_repl, dist_size) |
procedure, public :: dist => repl_dist | |
procedure, public :: rowcols => repl_rowcols |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int_8), | public | :: | nmrowcol | = | -1_int_8 | ||
integer(kind=int_8), | public | :: | nfullrowcol | = | -1_int_8 |
procedure(rowcol_data), public, deferred :: DATA |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int_8), | public | :: | nmrowcol | = | -1_int_8 | ||
integer(kind=int_8), | public | :: | nfullrowcol | = | -1_int_8 | ||
integer, | public, | DIMENSION(:), ALLOCATABLE | :: | blk_size_vec |
private function new_dbcsr_tas_blk_size_arb (blk_size_vec) |
procedure, public :: DATA => blk_size_arb |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int_8), | public | :: | nmrowcol | = | -1_int_8 | ||
integer(kind=int_8), | public | :: | nfullrowcol | = | -1_int_8 | ||
integer, | public, | DIMENSION(:), ALLOCATABLE | :: | blk_size_vec | |||
integer, | public | :: | nmrowcol_local | = | -1 |
private function new_dbcsr_tas_blk_size_repl (blk_size_vec, n_repl) |
procedure, public :: DATA => blk_size_repl |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int_8), | public | :: | nmrowcol | = | -1_int_8 | ||
integer(kind=int_8), | public | :: | nfullrowcol | = | -1_int_8 |
private function new_dbcsr_tas_blk_size_one (nrowcol) |
procedure, public :: DATA => blk_size_one |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_blk_size_arb), | intent(in) | :: | t | |||
integer(kind=int_8), | intent(in) | :: | rowcol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_blk_size_repl), | intent(in) | :: | t | |||
integer(kind=int_8), | intent(in) | :: | rowcol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_blk_size_one), | intent(in) | :: | t | |||
integer(kind=int_8), | intent(in) | :: | rowcol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | blk_size_vec |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | blk_size_vec | ||
integer, | intent(in) | :: | n_repl |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int_8), | intent(in) | :: | nrowcol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_dist_arb), | intent(in) | :: | t | |||
integer(kind=int_8), | intent(in) | :: | rowcol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_dist_repl), | intent(in) | :: | t | |||
integer(kind=int_8), | intent(in) | :: | rowcol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_dist_repl), | intent(in) | :: | t | |||
integer, | intent(in) | :: | dist |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_dist_arb), | intent(in) | :: | t | |||
integer, | intent(in) | :: | dist |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | split_size | |||
integer, | intent(in) | :: | nprowcol | |||
integer(kind=int_8), | intent(in) | :: | nmrowcol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | dist_vec | ||
integer, | intent(in) | :: | nprowcol | |||
integer(kind=int_8), | intent(in) | :: | nmrowcol |
Distribution that is more or less cyclic (round robin) and load balanced with different weights for each element. This is used for creating adhoc distributions whenever matrices are mapped to new grids. Only for small dimensions since distribution is created as an array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | nprowcol | ||||
integer(kind=int_8), | intent(in) | :: | nmrowcol | |||
class(dbcsr_tas_rowcol_data), | intent(in) | :: | block_sizes |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(:) | :: | dist_vec | ||
integer, | intent(in) | :: | nprowcol | |||
integer, | intent(in) | :: | nmrowcol | |||
integer, | intent(in) | :: | n_repl | |||
integer, | intent(in) | :: | dist_size |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_dist_cyclic), | intent(in) | :: | t | |||
integer(kind=int_8), | intent(in) | :: | rowcol |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dbcsr_tas_dist_cyclic), | intent(in) | :: | t | |||
integer, | intent(in) | :: | dist |
get a load-balanced and randomized distribution along one tensor dimension
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nblk |
number of blocks (along one tensor dimension) |
||
integer, | intent(in) | :: | nproc |
number of processes (along one process grid dimension) |
||
integer, | intent(in), | DIMENSION(nblk) | :: | blk_size |
block sizes |
|
integer, | intent(out), | DIMENSION(nblk) | :: | dist |
distribution |
distribute nel
elements with weights weights
over nbin
bins.
load balanced distribution is obtained by using LPT algorithm together with randomization over equivalent bins
(i.e. randomization over all bins with the smallest accumulated weight)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | nel | |||
integer, | intent(in) | :: | nbin | |||
integer, | intent(in), | DIMENSION(nel) | :: | weights | ||
integer, | intent(out), | DIMENSION(nel) | :: | dist |