METHOD
ParallelEnv Class Reference

#include <parallelEnv.h>

Inheritance diagram for ParallelEnv:
Collaboration diagram for ParallelEnv:

Public Member Functions

 ParallelEnv (int *argcP, char **argvP[], int nxRanks, int nyRanks, int nzRanks, int testing=0)
 
virtual ~ParallelEnv ()
 
int isNeighbourExternal (int dimension, int direction)
 
void setParallelDecomposition (int xPeriodic, int yPeriodic, int zPeriodic)
 
- Public Member Functions inherited from PlatformEnv
 PlatformEnv (int testing=0)
 
virtual ~PlatformEnv ()
 

Public Attributes

MPI_Comm mpiCartesianComm
 
MPI_Info mpiInfo
 
- Public Attributes inherited from PlatformEnv
int nProc
 
int rank
 
int testing
 
int nxRanks
 
int nyRanks
 
int nzRanks
 
int xRankId
 
int yRankId
 
int zRankId
 
int leftXNeighbourRank
 
int rightXNeighbourRank
 
int leftYNeighbourRank
 
int rightYNeighbourRank
 
int leftZNeighbourRank
 
int rightZNeighbourRank
 

Detailed Description

ParallelEnv

For keeping track of parameters related to the platform that the code is running on – currently serial on a single core or multi-core using MPI. For the MPI version, processes are mapped onto a cartesian grid with the number of processes in each dimension specified by the user.

For a 2D problem, specify nzRanks = 1 For a 1D problem, specify nzRanks = 1, nyRanks = 1

The number of ranks in each dimension must be a factor of the number of cells in the dimension

Definition at line 19 of file parallelEnv.h.

Constructor & Destructor Documentation

◆ ParallelEnv()

ParallelEnv::ParallelEnv ( int *  argcP,
char **  argvP[],
int  nxRanks,
int  nyRanks,
int  nzRanks,
int  testing = 0 
)

Constructor – Initialize global MPI communicator.

◆ ~ParallelEnv()

virtual ParallelEnv::~ParallelEnv ( )
virtual

Destructor.

Member Function Documentation

◆ isNeighbourExternal()

int ParallelEnv::isNeighbourExternal ( int  dimension,
int  direction 
)

Check for external boundary.

Returns true if a subdomain is on the external boundary of the simulation grid in a particular direction
Parameters
[in]dimension{x=0, y=1, z=2}
[in]directiondirection to look for the external boundary in a particular direction {low=0, high=1}

◆ setParallelDecomposition()

void ParallelEnv::setParallelDecomposition ( int  xPeriodic,
int  yPeriodic,
int  zPeriodic 
)

Create cartesian grid of processes and calculate neighbours along that grid for each process.

Creates the cartesian grid of processes that are responsible for the corresponding subdomains in the simulation grid
Parameters
[in]xPeriodicwhether the x dimension has periodic boundary conditions
[in]yPeriodicwhether the y dimension has periodic boundary conditions
[in]zPeriodicwhether the z dimension has periodic boundary conditions

Member Data Documentation

◆ mpiCartesianComm

MPI_Comm ParallelEnv::mpiCartesianComm

Cartesian MPI communicator that maps processes to the simulation grid.

Definition at line 22 of file parallelEnv.h.

◆ mpiInfo

MPI_Info ParallelEnv::mpiInfo

MPI information channel.

Definition at line 23 of file parallelEnv.h.


The documentation for this class was generated from the following file: