
Houses object used to interface with MPI outside of PETSc
Getter for worldRank
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(in) | :: | this |
Getter for worldSize
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(in) | :: | this |
Getter for rowRank
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(in) | :: | this |
Getter for rowSize
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(in) | :: | this |
Getter for columnRank
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(in) | :: | this |
Getter for columnSize
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(in) | :: | this |
Getter for xHaloWidth
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(in) | :: | this |
Getter for xHaloWidth
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(in) | :: | this |
Return true if input is true on every processor
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| logical, | intent(inout) | :: | input |
Return min value on all processors
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| real(kind=rk), | intent(inout) | :: | input |
Return max value on all processors
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| real(kind=rk), | intent(inout) | :: | input |
MPI controller initialization routine - initializes communicators used outside of PETSc. Optionally sets up row/column communicators.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| integer(kind=ik), | intent(in), | optional | :: | numProcsX |
Number of processes in the x-direction |
|
| integer(kind=ik), | intent(in), | optional | :: | numProcsH |
Number of processes in the h-direction |
Set up row/column communication in controller
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| integer(kind=ik), | intent(in) | :: | numProcsX |
Number of processes in the x-direction |
||
| integer(kind=ik), | intent(in) | :: | numProcsH |
Number of processes in the h-direction |
Initialize distribution DoF data used in exchanging distribution data in a row
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| type(Partition), | intent(in) | :: | partitionObj |
Partition object used to retrieve DoF information |
||
| integer(kind=ik), | intent(in) | :: | xHaloWidth |
Halo width in x-direction |
||
| integer(kind=ik), | intent(in) | :: | numV |
Number of cells in v-grid |
Initialize neighbour pairs - if periodic in X adds additional pair to handle this
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| logical, | intent(in) | :: | periodic |
Broadcast variable with given name from row rank 0 process to other row processes - to be used only with non-distribution variables
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| type(VariableContainer), | intent(inout) | :: | varContainer |
Variable container in which to broadcasty |
||
| character(len=*), | intent(in) | :: | name |
Name of variable to broadcast |
Exchanges a distribution variable in a processor row
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| type(VariableContainer), | intent(inout) | :: | varContainer |
Variable container in which to broadcast |
||
| character(len=*), | intent(in) | :: | name |
Name of variable to broadcast |
Exchanges a halos in x direction for given variable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| type(VariableContainer), | intent(inout) | :: | varContainer |
Variable container in which to perform halo exchange |
||
| character(len=*), | intent(in) | :: | name |
Name of variable to exchange |
||
| logical, | intent(in) | :: | varIsDist |
Set to true if variable is a distribution |
Gather variable values into global vector for output on rank 0. If globVec in not allocated it will be allocated to the correct size, otherwise it is assumed it is of the correct size.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| real(kind=rk), | intent(in), | dimension(:) | :: | localVec |
Local vector to gather |
|
| real(kind=rk), | intent(inout), | allocatable, dimension(:) | :: | globVec |
Global vector on rank 0 to gather into |
|
| logical, | intent(in) | :: | varIsDist |
Set to true if the gathered variable is a distribution |
Scatter global variable values into local vector from rank 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| real(kind=rk), | intent(inout), | dimension(:) | :: | globVec |
Global vector on rank 0 to scatter from |
|
| real(kind=rk), | intent(inout), | allocatable, dimension(:) | :: | localVec |
Local vector to scatter into |
|
| logical, | intent(in) | :: | varIsDist |
Set to true if the scattered variable is a distribution |
Broadcast real vector from rank rootProc
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| real(kind=rk), | intent(inout), | dimension(:) | :: | vec | ||
| integer(kind=ik), | intent(in), | optional | :: | rootProc |
Broadcast integer vector from rank 0
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| integer(kind=ik), | intent(inout), | dimension(:) | :: | vec |
Broadcast logical vector from rank 0
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| logical, | intent(inout), | dimension(:) | :: | vec |
Broadcast character vector from rank 0
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this | |||
| character(len=:), | intent(inout), | allocatable | :: | vec |
Calls MPI barrier on commWorld
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MPIController), | intent(inout) | :: | this |
Contains lists of variables to broadcast in processor rows and variables participating in halo exchange
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(StringArray), | public, | allocatable, dimension(:) | :: | varsToBroadcast |
Variables to broadcast/exchange in processor row |
||
| type(StringArray), | public, | allocatable, dimension(:) | :: | haloExchangeVars |
Variables that should participate in halo exchange |
||
| type(StringArray), | public, | allocatable, dimension(:) | :: | scalarsToBroadcast |
Scalar variables to broadcast everywhere |
||
| integer(kind=ik), | public, | allocatable, dimension(:) | :: | scalarRoots |
Root processes for each broadcast scalar |
Provides a centralized interface with MPI and various support routines compatible with ReMKiT1D needs
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | userDefined | = | .false. |
True only if user explicitly sets it to true |
|
| type(MPI_Comm), | private | :: | worldComm |
Main MPI_Comm_World |
|||
| type(MPI_Comm), | private | :: | rowComm |
Communicator for processors rows (those with the same x-domain but different h-domains) |
|||
| type(MPI_Comm), | private | :: | colComm |
Communicator for processor columns (those with the same h-domain but different x-domains) |
|||
| integer(kind=ik), | private | :: | worldRank |
Current process' world rank |
|||
| integer(kind=ik), | private | :: | worldSize |
Size of worldComm |
|||
| integer(kind=ik), | private | :: | rowRank |
Current process' row rank |
|||
| integer(kind=ik), | private | :: | rowSize |
Size of rowComm |
|||
| integer(kind=ik), | private | :: | colRank |
Current process' column rank |
|||
| integer(kind=ik), | private | :: | colSize |
Size of colComm |
|||
| integer(kind=ik), | private | :: | rowNumX |
Number of x-grid points in local processor row |
|||
| integer(kind=ik), | private, | allocatable, dimension(:) | :: | colNumX |
Number of x-grid points in each column processor |
||
| integer(kind=ik), | private, | allocatable, dimension(:) | :: | xDispls |
Displacement in x-direction used for MPI gather |
||
| integer(kind=ik), | private | :: | xHaloWidth |
Halo width in x-direction |
|||
| integer(kind=ik), | private | :: | numV |
Number of velocity cells in grid |
|||
| integer(kind=ik), | private | :: | numH |
Number of harmonics in grid |
|||
| integer(kind=ik), | public, | allocatable, dimension(:) | :: | rowNumH |
locNumH for each processor in row |
||
| integer(kind=ik), | public, | allocatable, dimension(:) | :: | rowHOffset |
harmonic offset for each processor in row |
||
| type(RealArray), | public, | allocatable, dimension(:) | :: | distBuffer |
Distribution variable buffer used in halo exchange |
||
| type(IntArray), | public, | allocatable, dimension(:) | :: | neighbourPairs |
Int array for each x-grid neighbour pair with entry of length 2 first element is left neighbour rank, second is right - allows for periodic domain |
||
| logical, | public | :: | rowsSetUp |
True if row data is set up and ready for communication |
| procedure, public :: isDefined => isDefinedObject | |
| procedure, public :: makeDefined => makeDefinedObject | |
| procedure, public :: makeUndefined => makeUndefinedObject | |
| procedure, public :: getWorldRank | |
| procedure, public :: getWorldSize | |
| procedure, public :: getRowRank | |
| procedure, public :: getRowSize | |
| procedure, public :: getColRank | |
| procedure, public :: getColSize | |
| procedure, public :: getXHaloWidth | |
| procedure, public :: getComm | |
| procedure, public :: calculateRowDistData | |
| procedure, public :: initializeNeighbourPairs | |
| procedure, public :: broadcastVarInRow | |
| procedure, public :: exchangeDistVarInRow | |
| procedure, public :: exchangeVarXHalos | |
| procedure, public :: broadcastReal | |
| procedure, public :: broadcastInt | |
| procedure, public :: broadcastLogical | |
| procedure, public :: broadcastCharacter | |
| procedure, public :: barrier | |
| procedure, public :: gatherVar | |
| procedure, public :: scatterVar | |
| procedure, public :: setUpRows | |
| procedure, public :: isTrueEverywhere | |
| procedure, public :: allreduceMax | |
| procedure, public :: allreduceMin | |
| procedure, public :: init => initMPIController |