A module to manage the process grid.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(ProcessGrid_t), | public, | TARGET, SAVE | :: | global_grid |
The default process grid. |
Setup the default process grid.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | world_comm |
A communicator that every process in the grid is a part of. |
||
integer, | intent(in) | :: | process_rows |
The number of grid rows. |
||
integer, | intent(in) | :: | process_columns |
The number of grid columns. |
||
integer, | intent(in) | :: | process_slices |
The number of grid slices. |
||
logical, | intent(in), | optional | :: | be_verbose_in |
Set true to print process grid info. |
Setup a process grid specifying only the slices
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | world_comm |
A communicator that every process in the grid is a part of. |
||
integer, | intent(in), | optional | :: | process_slices_in |
The number of grid slices. |
|
logical, | intent(in), | optional | :: | be_verbose_in |
Set true to print process grid info. |
Construct a process grid.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ProcessGrid_t), | intent(inout) | :: | grid |
The grid to construct |
||
integer, | intent(in) | :: | world_comm |
A communicator that every process in the grid is a part of. |
||
integer, | intent(in) | :: | process_rows |
The number of grid rows. |
||
integer, | intent(in) | :: | process_columns |
The number of grid columns. |
||
integer, | intent(in) | :: | process_slices |
The number of grid slices. |
Setup a process grid specifying only the slices
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ProcessGrid_t), | intent(inout) | :: | grid |
The grid to construct |
||
integer, | intent(in) | :: | world_comm |
A communicator that every process in the grid is a part of. |
||
integer, | intent(in), | optional | :: | process_slices_in |
The number of grid slices. |
A datatype which stores a process grid and all its communicators.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
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 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. |
||
integer, | public | :: | omp_max_threads |
The maximum number of openmp threads. |
Check if the current process is the root process.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ProcessGrid_t), | intent(in), | optional | :: | grid_in |
The process grid. |
True if the current process is root.
Get the slice of the current process.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ProcessGrid_t), | intent(in), | optional | :: | grid |
The process grid. |
Slice number of the current process.
Get the column of the current process.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ProcessGrid_t), | intent(in), | optional | :: | grid |
The process grid. |
The column number of the current process.
Get the row of the current process.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ProcessGrid_t), | intent(in), | optional | :: | grid |
The process grid. |
The row number of the current process.
Copy a process grid. Note that this makes a complete and independent copy of the process grid. Which of course means that whatever is currently stored in new_grid will be destroyed, so do not leave any matrices pointing to it.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ProcessGrid_t), | intent(in) | :: | old_grid |
The grid to copy. |
||
type(ProcessGrid_t), | intent(inout) | :: | new_grid |
New_grid = old_grid |
Destruct a process grid. Be careful about doing this. Matrices have pointers to process grids. If you destruct a process grid without destructing the matrices pointing to it, they will become unusable.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ProcessGrid_t), | intent(inout), | optional | :: | grid_in |
The grid to destruct. If none specified this destroys the global grid. |
Given a process grid, this splits it into two grids of even size
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
Sometimes we only want to specify for a process grid the number of slices and then automatically compute the right number of rows and columns.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | total_processors |
Total processors in the grid |
||
integer, | intent(in) | :: | set_slices |
Desired number of slices |
||
integer, | intent(out) | :: | rows |
Computed number of rows |
||
integer, | intent(out) | :: | columns |
Computed number of columns |
Write out some basic information about this process grid to the log.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ProcessGrid_t), | intent(in), | optional | :: | this |
The grid to print about. If not specified, global information printed. |