comms Module


Uses

  • module~~comms~~UsesGraph module~comms comms mpi mpi module~comms->mpi

Used by

  • module~~comms~~UsedByGraph module~comms comms module~game_of_life game_of_life module~game_of_life->module~comms program~main main program~main->module~game_of_life

Derived Types

type, public ::  DomainDecomposition

Type to represent the domain decomposition for parallel processing

Components

Type Visibility Attributes Name Initial
integer, public :: communicator

The ID of the communicator for this domain

integer, public :: dims(2)

The dimensions of the MPI communicators Cartesian grid

integer, public :: neighbours(4)

The ranks of the neighbouring ranks - [down, left, up, right]


Subroutines

public subroutine exchange_boundaries(board, local_nrows, local_ncols, domainDecomp)

Subroutine to exchange boundaries between neighboring ranks

Arguments

Type IntentOptional Attributes Name
integer, intent(inout), dimension(:,:) :: board

The board to be exchanged

integer, intent(in) :: local_nrows

The number of rows in the local board

integer, intent(in) :: local_ncols

The number of columns in the local board

type(DomainDecomposition), intent(in) :: domainDecomp

The domain decomposition object

public subroutine get_local_grid_info(domainDecomp, rank, global_nrows, global_ncols, nrows_per_rank, ncols_per_rank, coords, row_start, col_start, local_nrows, local_ncols)

Subroutine to get local grid information for a rank

Arguments

Type IntentOptional Attributes Name
type(DomainDecomposition), intent(inout) :: domainDecomp

The MPI communication domain decomposition object

integer, intent(in) :: rank

The rank of the current process

integer, intent(in) :: global_nrows

The number of columns in the global board

integer, intent(in) :: global_ncols

The number of rows in the global board

integer, intent(out) :: nrows_per_rank

The number of columns per rank

integer, intent(out) :: ncols_per_rank

The number of rows per rank

integer, intent(out) :: coords(2)

The coordinates of the current rank in the Cartesian grid

integer, intent(out) :: row_start

The starting column index for the local grid

integer, intent(out) :: col_start

The starting row index for the local grid

integer, intent(out) :: local_nrows

The number of columns in the local grid

integer, intent(out) :: local_ncols

The number of rows in the local grid