ProcessGridModule Module

A module to manage the process grid.



Contents


Variables

TypeVisibility AttributesNameInitial
type(ProcessGrid_t), public, TARGET:: global_grid

The default process grid.


Interfaces

public interface ConstructProcessGrid

  • private subroutine ConstructProcessGrid_full(world_comm_, process_rows_, process_columns_, process_slices_, be_verbose_in)

    Setup the default process grid.

    Arguments

    Type IntentOptional AttributesName
    integer(kind=c_int), intent(in) :: world_comm_

    A communicator that every process in the grid is a part of.

    integer(kind=c_int), intent(in) :: process_rows_

    The number of grid rows.

    integer(kind=c_int), intent(in) :: process_columns_

    The number of grid columns.

    integer(kind=c_int), intent(in) :: process_slices_

    The number of grid slices.

    logical(kind=c_bool), intent(in), optional :: be_verbose_in

    Set true to print process grid info.

  • private subroutine ConstructProcessGrid_onlyslice(world_comm_, process_slices_in, be_verbose_in)

    Setup a process grid specifying only the slices

    Arguments

    Type IntentOptional AttributesName
    integer(kind=c_int), intent(in) :: world_comm_

    A communicator that every process in the grid is a part of.

    integer(kind=c_int), intent(in), optional :: process_slices_in

    The number of grid slices.

    logical(kind=c_bool), intent(in), optional :: be_verbose_in

    Set true to print process grid info.

public interface ConstructNewProcessGrid

  • private subroutine ConstructNewProcessGrid_full(grid, world_comm_, process_rows_, process_columns_, process_slices_)

    Construct a process grid.

    Arguments

    Type IntentOptional AttributesName
    type(ProcessGrid_t), intent(inout) :: grid

    The grid to construct

    integer(kind=c_int), intent(in) :: world_comm_

    A communicator that every process in the grid is a part of.

    integer(kind=c_int), intent(in) :: process_rows_

    The number of grid rows.

    integer(kind=c_int), intent(in) :: process_columns_

    The number of grid columns.

    integer(kind=c_int), intent(in) :: process_slices_

    The number of grid slices.

  • private subroutine ConstructNewProcessGrid_onlyslice(grid, world_comm_, process_slices)

    Setup a process grid specifying only the slices

    Arguments

    Type IntentOptional AttributesName
    type(ProcessGrid_t), intent(inout) :: grid

    The grid to construct

    integer(kind=c_int), intent(in) :: world_comm_

    A communicator that every process in the grid is a part of.

    integer(kind=c_int), intent(in) :: process_slices

    The number of grid slices.


Derived Types

type, public :: ProcessGrid_t

A datatype which stores a process grid and all its communicators.

Components

TypeVisibility AttributesNameInitial
integer, public :: total_processors

total processors in the grid.

integer, public :: num_process_rows

number of rows in the grid.

integer, public :: num_process_columns

number of columns in the grid.

integer, public :: num_process_slices

number of 2D slices in the grid.

integer, public :: slice_size

the size of a 2D slice.

integer, public :: my_slice

which slice is the current process in.

integer, public :: my_row

which row is the current process in.

integer, public :: my_column

which column is the current process in.

integer, public :: global_rank

current process's rank amongst processes.

integer, public :: within_slice_rank

rank for within slice communication.

integer, public :: between_slice_rank

rank for between slice communication.

integer, public :: column_rank

rank for within column communication.

integer, public :: row_rank

rank for within row communication.

integer, public :: global_comm

communicator with every other process.

integer, public :: row_comm

communicator within a row.

integer, public :: column_comm

communicator within a column.

integer, public :: within_slice_comm

communicator within a slice.

integer, public :: between_slice_comm

communicator between slices.

integer, public :: grid_error

stores errors from MPI calls.

integer, public :: RootID =0

Which rank is root?

integer, public :: block_multiplier

Block scaling factor.

integer, public :: number_of_blocks_columns

number of column blocks.

integer, public :: number_of_blocks_rows

number of row blocks.

integer, public, DIMENSION(:), ALLOCATABLE:: blocked_row_comm

blocked communicator within a row.

integer, public, DIMENSION(:), ALLOCATABLE:: blocked_column_comm

blocked communicator within a column.

integer, public, DIMENSION(:,:), ALLOCATABLE:: blocked_within_slice_comm

blocked communicator within a slice.

integer, public, DIMENSION(:,:), ALLOCATABLE:: blocked_between_slice_comm

blocked communicator between slices.


Functions

public function IsRoot(grid) result(is_root)

Check if the current process is the root process.

Arguments

Type IntentOptional AttributesName
type(ProcessGrid_t), intent(in) :: grid

The process grid.

Return Value logical

True if the current process is root.

public function GetMySlice(grid) result(return_val)

Get the slice of the current process.

Arguments

Type IntentOptional AttributesName
type(ProcessGrid_t), intent(in), optional :: grid

The process grid.

Return Value integer

Slice number of the current process.

public function GetMyColumn(grid) result(return_val)

Get the column of the current process.

Arguments

Type IntentOptional AttributesName
type(ProcessGrid_t), intent(in), optional :: grid

The process grid.

Return Value integer

The column number of the current process.

public function GetMyRow(grid) result(return_val)

Get the row of the current process.

Arguments

Type IntentOptional AttributesName
type(ProcessGrid_t), intent(in), optional :: grid

The process grid.

Return Value integer

The row number of the current process.


Subroutines

public subroutine CopyProcessGrid(old_grid, new_grid)

Copy a process grid.

Arguments

Type IntentOptional AttributesName
type(ProcessGrid_t), intent(in) :: old_grid

The grid to copy.

type(ProcessGrid_t), intent(inout) :: new_grid

New_grid = old_grid

public subroutine DestructProcessGrid(grid_in)

Destruct a process grid.

Arguments

Type IntentOptional AttributesName
type(ProcessGrid_t), intent(inout), optional :: grid_in

The grid to destruct. If none specified this destroys the global grid.

public subroutine SplitProcessGrid(old_grid, new_grid, my_color, split_slice, between_grid_comm)

Given a process grid, this splits it into two grids of even size

Arguments

Type IntentOptional AttributesName
type(ProcessGrid_t), intent(inout) :: old_grid

The old grid to split

type(ProcessGrid_t), intent(inout) :: new_grid

The new grid that we are creating

integer, intent(out) :: my_color

A color value indicating which set this process was split into

logical, intent(out) :: split_slice

True if we were able to split along slices.

integer, intent(out) :: between_grid_comm

A communicator for sending messages between groups.