This is the type which controls/organises the parallel data decomposition etc.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | dimension(:,:), allocatable | :: | is_local |
Is the given it,ik on this proc? |
||
type(comm_type), | public, | dimension(:,:), allocatable | :: | itik_subcom |
Cell level sub-communicators |
||
integer, | public, | dimension(:,:), allocatable | :: | nproc_per_cell |
How many procs have this cell |
||
integer, | public, | dimension(:,:), allocatable | :: | nresp_per_cell |
How many rows are we personally responsible for in each cell |
||
integer, | public, | dimension(:,:), allocatable | :: | navail_per_cell |
How many rows could we be responsible for in each cell |
||
integer, | public | :: | nresp_tot |
Total number of rows available/potentially available |
|||
integer, | public | :: | navail_tot |
Total number of rows available/potentially available |
|||
logical, | public | :: | force_local_invert | = | .false. |
If true then we force local inversion |
|
logical, | public | :: | has_to_gather | = | .true. |
If true we have to gather when calling getfieldeq, determined by decomp routine |
|
integer, | public | :: | decomp_type | = | 3 |
This sets what type of decomposition is done |
Deallocate storage space
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self |
Allocate storage space
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self |
Debug printing
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(in) | :: | self |
Return the current number of rows we're responsible for
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(in) | :: | self |
Work out which cells are local
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self |
Work out how many rows are available in each cell
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self | |||
class(fieldmat_type), | intent(in) | :: | fieldmat |
A wrapper routine to do the decomposition
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self | |||
class(fieldmat_type), | intent(inout) | :: | fieldmat |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self | |||
class(fieldmat_type), | intent(in) | :: | fieldmat |
All serial and local || Decomp_type=0
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self | |||
class(fieldmat_type), | intent(inout) | :: | fieldmat |
Serial and local but only for the supercells || Decomp_type=1 for which we have some data
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self | |||
class(fieldmat_type), | intent(inout) | :: | fieldmat |
Serial and local but only for the cells || Decomp_type=2 for which we have some data
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self | |||
class(fieldmat_type), | intent(inout) | :: | fieldmat |
Cells are decomposed based on proc || Decomp_type=3
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pc_type), | intent(inout) | :: | self | |||
class(fieldmat_type), | intent(inout) | :: | fieldmat |
type :: pc_type
integer, dimension(:,:), allocatable :: is_local !< Is the given it,ik on this proc?
!NOTE: We have is_local as integer rather than logical so we can reduce across procs
!to count how many procs have a given cell
type(comm_type), dimension(:,:), allocatable :: itik_subcom !< Cell level sub-communicators
integer, dimension(:,:), allocatable :: nproc_per_cell !< How many procs have this cell
integer, dimension(:,:), allocatable :: nresp_per_cell !< How many rows are we personally responsible for in each cell
integer, dimension(:,:), allocatable :: navail_per_cell !< How many rows could we be responsible for in each cell
integer :: nresp_tot, navail_tot !< Total number of rows available/potentially available
logical :: force_local_invert=.false. !< If true then we force local inversion
!the local fields. This may impact diagnostics/parallel writing as it means only the processors g_lo local section
!of the fields are evolved on this processor.
!NOTE: If we're doing force local invert really when we populate the supercell we should store all of the
!data locally so we don't need to fetch it later.
logical :: has_to_gather=.true. !< If true we have to gather when calling getfieldeq, determined by decomp routine
integer :: decomp_type=3 !< This sets what type of decomposition is done
!By defining your own decomposition routine and associating it with a
!particular value of decomp_type you should be able to easily add in
!new parallel decompositions easily without having to rewrite any other
!routines (although I don't promise this!)
!//List of currently supported decomp_types
!0 : Force everything to be done locally and serially, i.e. every proc has all field mat data
!1 : Force local/serial but only for the supercells we would have anyway
!2 : Force local/serial but only for the cells we would have anyway
!3 : Simple mpi, minimal attempt to load balance or avoid splitting small blocks
!4 : As above but with attempts to avoid splitting small blocks
contains
procedure :: deallocate => pc_deallocate
procedure :: allocate => pc_allocate
procedure :: debug_print => pc_debug_print
procedure :: current_nresp => pc_current_nresp
procedure :: find_locality => pc_find_locality
procedure :: count_avail => pc_count_avail
procedure :: has_ik => pc_has_ik
procedure :: has_it => pc_has_it
procedure :: make_decomp => pc_make_decomp
procedure :: init => pc_init
procedure :: reset => pc_reset
!//The different decomposition routines
procedure :: decomp_all_serial_local => pc_decomp_all_serial_local
procedure :: decomp_own_serial_local => pc_decomp_own_serial_local
procedure :: decomp_owncells_serial_local => pc_decomp_owncells_serial_local
procedure :: decomp_owncells_simplempi => pc_decomp_owncells_simplempi
end type pc_type