methods to split tall-and-skinny matrices along longest dimension. Basically, we are splitting process grid and each subgrid holds its own DBCSR matrix.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=*), | private, | parameter | :: | moduleN | = | 'dbcsr_tas_split' | |
integer, | public, | parameter | :: | rowsplit | = | 1 | |
integer, | public, | parameter | :: | colsplit | = | 2 | |
real(kind=real_8), | public, | parameter | :: | default_pdims_accept_ratio | = | 1.2_real_8 | |
real(kind=real_8), | public, | parameter | :: | default_nsplit_accept_ratio | = | 3.0_real_8 |
Derive optimal cartesian process grid from matrix sizes. This ensures optimality for dense matrices only
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mp_comm_type), | intent(in) | :: | mp_comm | |||
integer(kind=int_8), | intent(in) | :: | nblkrows |
total number of block rows total number of block columns |
||
integer(kind=int_8), | intent(in) | :: | nblkcols |
total number of block rows total number of block columns |
MPI communicator
Create default cartesian process grid that is consistent with default split heuristic of dbcsr_tas_create_split \return new communicator
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mp_comm_type), | intent(in) | :: | mp_comm | |||
integer, | intent(in) | :: | split_rowcol | |||
integer, | intent(in) | :: | nsplit |
Get optimal process grid dimensions consistent with dbcsr_tas_create_split
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | numproc | |||
integer, | intent(in) | :: | split_rowcol | |||
integer, | intent(in) | :: | nsplit |
Heuristic to get good split factor for a given process grid OR a given number of processes \return split factor consistent with process grid or number of processes
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | numproc |
total number of processes or (if split_pgrid) process grid dimension to split Desired split factor |
||
integer, | intent(in) | :: | nsplit |
total number of processes or (if split_pgrid) process grid dimension to split Desired split factor |
||
logical, | intent(in) | :: | split_pgrid |
whether to split process grid |
||
integer, | intent(in), | optional | :: | pdim_nonsplit |
if split_pgrid: other process grid dimension |
Derive optimal cartesian process grid from matrix sizes. This ensures optimality for dense matrices only
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(mp_comm_type), | intent(in) | :: | mp_comm | |||
integer(kind=int_8), | intent(in) | :: | nblkrows |
total number of block rows total number of block columns |
||
integer(kind=int_8), | intent(in) | :: | nblkcols |
total number of block rows total number of block columns |
MPI communicator
Whether to accept proposed process grid dimensions (based on ratio of dimensions)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | DIMENSION(2) | :: | dims | ||
logical, | intent(in) | :: | relative |
binary search for 8-byte integers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int_8), | intent(in) | :: | array(:) | |||
integer(kind=int_8), | intent(in) | :: | el | |||
integer, | intent(in), | optional | :: | l_index | ||
integer, | intent(in), | optional | :: | u_index |
split mpi grid by rows or columns
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_tas_split_info), | intent(out) | :: | split_info | |||
type(mp_comm_type), | intent(in) | :: | mp_comm |
global mpi communicator with a 2d cartesian grid |
||
integer, | intent(inout) | :: | ngroup |
number of groups |
||
integer, | intent(in) | :: | igroup |
my group ID split rows or columns |
||
integer, | intent(in) | :: | split_rowcol |
my group ID split rows or columns |
||
logical, | intent(in), | optional | :: | own_comm |
Whether split_info should own communicator |
Split Cartesian process grid using a default split heuristic.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_tas_split_info), | intent(out) | :: | split_info |
object storing all data corresponding to split, submatrices and parallelization |
||
type(mp_comm_type), | intent(in) | :: | mp_comm |
MPI communicator with associated cartesian grid |
||
integer, | intent(in) | :: | split_rowcol |
split rows or columns |
||
integer, | intent(in) | :: | nsplit |
desired split factor, set to 0 if split factor of exactly 1 is required |
||
logical, | intent(in), | optional | :: | own_comm |
whether split_info should own communicator |
|
logical, | intent(in), | optional | :: | opt_nsplit |
whether nsplit should be optimized to process grid |
Get info on split
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_tas_split_info), | intent(in) | :: | info | |||
type(mp_comm_type), | intent(out), | optional | :: | mp_comm | ||
integer, | intent(out), | optional | :: | nsplit |
communicator (global process grid) split factor which group do I belong to subgroup communicator (group-local process grid) split rows or columns |
|
integer, | intent(out), | optional | :: | igroup |
communicator (global process grid) split factor which group do I belong to subgroup communicator (group-local process grid) split rows or columns |
|
type(mp_comm_type), | intent(out), | optional | :: | mp_comm_group | ||
integer, | intent(out), | optional | :: | split_rowcol |
communicator (global process grid) split factor which group do I belong to subgroup communicator (group-local process grid) split rows or columns |
|
integer, | intent(out), | optional, | DIMENSION(2) | :: | pgrid_offset |
group-local offset in process grid |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_tas_split_info), | intent(inout) | :: | split_info |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_tas_split_info), | intent(in) | :: | split_info |
map global process info to group
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iproc |
global process ID |
||
integer, | intent(in), | DIMENSION(2) | :: | pdims |
global process dimensions |
|
integer, | intent(in) | :: | split_rowcol |
split rows or column how many process rows/cols per group |
||
integer, | intent(in) | :: | pgrid_split_size |
split rows or column how many process rows/cols per group |
||
integer, | intent(out) | :: | igroup |
group ID |
||
integer, | intent(out), | optional, | DIMENSION(2) | :: | pdims_group |
local process grid dimensions |
integer, | intent(out), | optional | :: | iproc_group |
group local process ID |
map local process info to global info
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(out) | :: | iproc |
global process id |
||
integer, | intent(in), | DIMENSION(2) | :: | pdims |
global process grid dimensions |
|
integer, | intent(in) | :: | split_rowcol |
split rows or column how many process rows/cols per group group ID local process ID |
||
integer, | intent(in) | :: | pgrid_split_size |
split rows or column how many process rows/cols per group group ID local process ID |
||
integer, | intent(in) | :: | igroup |
split rows or column how many process rows/cols per group group ID local process ID |
||
integer, | intent(in) | :: | iproc_group |
split rows or column how many process rows/cols per group group ID local process ID |
map group local block index to global matrix index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_tas_split_info), | intent(in) | :: | info | |||
type(dbcsr_tas_distribution_type), | intent(in) | :: | dist | |||
integer, | intent(in), | optional | :: | row_group |
group local row block index group local column block index |
|
integer, | intent(in), | optional | :: | column_group |
group local row block index group local column block index |
|
integer(kind=int_8), | intent(out), | optional | :: | row |
global block row global block column |
|
integer(kind=int_8), | intent(out), | optional | :: | column |
global block row global block column |
map global block index to group local index
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_tas_split_info), | intent(in) | :: | info | |||
type(dbcsr_tas_distribution_type), | intent(in) | :: | dist | |||
integer(kind=int_8), | intent(in), | optional | :: | row | ||
integer(kind=int_8), | intent(in), | optional | :: | column | ||
integer, | intent(out), | optional | :: | row_group | ||
integer, | intent(out), | optional | :: | column_group |
maps a process subgroup to matrix rows/columns
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_tas_split_info), | intent(in) | :: | info | |||
class(dbcsr_tas_distribution), | intent(in) | :: | rowcol_dist | |||
integer, | intent(in) | :: | igroup |
group ID |
||
integer(kind=int_8), | intent(out), | DIMENSION(:), ALLOCATABLE | :: | rowcols |
rows/ columns on this group |
freeze current split factor such that it is never changed during multiplication
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dbcsr_tas_split_info), | intent(inout) | :: | info |