pc_type Derived Type

type, private :: pc_type

This is the type which controls/organises the parallel data decomposition etc. the local fields. This may impact diagnostics/parallel writing as it means only the processors gf_lo local section of the fields are evolved on this processor.


Contents

Source Code


Components

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


Type-Bound Procedures

procedure, private, :: deallocate => pc_deallocate

  • private subroutine pc_deallocate(self)

    Deallocate storage space

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(inout) :: self

procedure, private, :: allocate => pc_allocate

  • private subroutine pc_allocate(self)

    Allocate storage space

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(inout) :: self

procedure, private, :: debug_print => pc_debug_print

  • private subroutine pc_debug_print(self)

    Debug printing

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(in) :: self

procedure, private, :: current_nresp => pc_current_nresp

  • private function pc_current_nresp(self)

    Return the current number of rows we're responsible for

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(in) :: self

    Return Value integer

procedure, private, :: find_locality => pc_find_locality

  • private subroutine pc_find_locality(self)

    Work out which cells are local

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(inout) :: self

procedure, private, :: count_avail => pc_count_avail

  • private subroutine pc_count_avail(self)

    Work out how many rows are available in each cell

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(inout) :: self

procedure, private, :: has_ik => pc_has_ik

  • private function pc_has_ik(self, ik)

    Determine if we have any cells with passed ik?

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(in) :: self
    integer, intent(in) :: ik

    Return Value logical

procedure, private, :: has_it => pc_has_it

  • private function pc_has_it(self, it)

    Determine if we have any cells with passed it?

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(in) :: self
    integer, intent(in) :: it

    Return Value logical

procedure, private, :: make_decomp => pc_make_decomp

  • private subroutine pc_make_decomp(self)

    A wrapper routine to do the decomposition

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(inout) :: self

procedure, private, :: init => pc_init

  • private subroutine pc_init(self)

    A routine to initialise the object

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(inout) :: self

procedure, private, :: reset => pc_reset

  • private subroutine pc_reset(self)

    A routine to reset the pc object

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(inout) :: self

procedure, private, :: decomp => pc_decomp

  • private subroutine pc_decomp(self)

    The process decomposition works on the gf_lo layout, so if you have a point in gf_lo that is in a supercell you are in that supercell and you own the whole cell associated with that point, otherwise you don't have anything in that supercell, i.e. each cell has a single owner.

    Arguments

    Type IntentOptional Attributes Name
    class(pc_type), intent(inout) :: self

Source Code

  type, private :: 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 gf_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.
   contains
     private
     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 => pc_decomp
  end type pc_type