Bridge++  Ver. 2.0.2
Communicator_impl::Layout Class Reference

Layout class for logical organisation of parallel nodes. More...

#include <layout.h>

Static Public Member Functions

static int grid_rank (int *rank, const int *gcoord)
 find rank from grid coordinate. More...
 
static int grid_coord (int *gcoord, const int rank)
 find grid coordinate corresponding to rank. More...
 
static int grid_dims (int *gdims)
 find grid size. More...
 
static int ipe (const int idir)
 grid coordinate along idir direction. More...
 
static int npe (const int idir)
 grid size in idir direction. More...
 
static int tag (int rank, int idir, int ipm)
 generate tag for communication. More...
 
static int layout_setup ()
 initialise layout. More...
 
static int layout_setup (const std::vector< int > &lattice_size, std::vector< int > &grid_size)
 initialise layout. More...
 
static int layout_delete ()
 destroy layout and clean up. More...
 
static int physical_map_setup ()
 
static int physical_map_delete ()
 
static int subgrid_setup ()
 
static int subgrid_delete ()
 
static int grid_rank (int *rank, const int *gcoord)
 find rank from grid coordinate. More...
 
static int grid_coord (int *gcoord, const int rank)
 find grid coordinate corresponding to rank. More...
 
static int grid_dims (int *gdims)
 find grid size. More...
 
static int ipe (const int idir)
 grid coordinate along idir direction. More...
 
static int npe (const int idir)
 grid size in idir direction. More...
 
static int tag (int rank, int idir, int ipm)
 generate tag for communication. More...
 
static int layout_setup ()
 initialise layout. More...
 
static int layout_setup (const std::vector< int > &lattice_size, std::vector< int > &grid_size)
 initialise layout. More...
 
static int layout_delete ()
 destroy layout and clean up. More...
 
static int physical_map_setup ()
 
static int physical_map_delete ()
 
static int subgrid_setup ()
 
static int subgrid_delete ()
 

Static Public Attributes

static int m_ndim = 0
 number of dimensions. More...
 
static int * m_dims = 0
 lattice extent (Lx, Ly, Lz, Lt) More...
 
static int * m_grid_dims = 0
 grid dimensions in directions. More...
 
static int * m_grid_coord = 0
 grid coordinate. More...
 
static int * m_ipe_up = 0
 rank of upward neighbour in directions. More...
 
static int * m_ipe_dn = 0
 rank of downward neighbour in directions. More...
 
static char m_map_grid [16]
 
static int * m_physical_to_logical = 0
 map between physical and logical grid More...
 
static MPI_Comm * m_sub_comm = 0
 subgrid More...
 

Private Member Functions

Layoutoperator= (const Layout &)
 assignment is hidden as private. More...
 
Layoutoperator= (const Layout &)
 assignment is hidden as private. More...
 

Detailed Description

Layout class for logical organisation of parallel nodes.

Layout class inside MPI communicator class describes logical organisation of parallel nodes. not intended for public use.

Definition at line 28 of file layout.h.

Member Function Documentation

◆ grid_coord() [1/2]

int Communicator_impl::Layout::grid_coord ( int *  gcoord,
const int  rank 
)
static

find grid coordinate corresponding to rank.

Definition at line 41 of file physical_map.cpp.

◆ grid_coord() [2/2]

static int Communicator_impl::Layout::grid_coord ( int *  gcoord,
const int  rank 
)
static

find grid coordinate corresponding to rank.

◆ grid_dims() [1/2]

static int Communicator_impl::Layout::grid_dims ( int *  gdims)
static

find grid size.

◆ grid_dims() [2/2]

int Communicator_impl::Layout::grid_dims ( int *  gdims)
static

find grid size.

Definition at line 57 of file layout.cpp.

◆ grid_rank() [1/2]

int Communicator_impl::Layout::grid_rank ( int *  rank,
const int *  gcoord 
)
static

find rank from grid coordinate.

Definition at line 24 of file physical_map.cpp.

◆ grid_rank() [2/2]

static int Communicator_impl::Layout::grid_rank ( int *  rank,
const int *  gcoord 
)
static

find rank from grid coordinate.

◆ ipe() [1/2]

int Communicator_impl::Layout::ipe ( const int  idir)
static

grid coordinate along idir direction.

Definition at line 43 of file layout.cpp.

◆ ipe() [2/2]

static int Communicator_impl::Layout::ipe ( const int  idir)
static

grid coordinate along idir direction.

◆ layout_delete() [1/2]

int Communicator_impl::Layout::layout_delete ( )
static

destroy layout and clean up.

Definition at line 240 of file layout.cpp.

◆ layout_delete() [2/2]

static int Communicator_impl::Layout::layout_delete ( )
static

destroy layout and clean up.

◆ layout_setup() [1/4]

static int Communicator_impl::Layout::layout_setup ( )
static

initialise layout.

◆ layout_setup() [2/4]

int Communicator_impl::Layout::layout_setup ( )
static

initialise layout.

layout_setup() – setup logical layout

layout_setup()

find dimension, global lattice size, local lattice size, grid division from CommonParameters. if grid division or local size is specified, check consistency. otherwise, try to divide so that global lattice size is divisable and the total number of rank is equal to number of processor elements.

N.B. the result should be stored back to communicator for further use from other components.

N.B. initial parameter settings are taken from CommonParameters; should rather be fetched from parameter file or something else?

Definition at line 93 of file layout.cpp.

◆ layout_setup() [3/4]

int Communicator_impl::Layout::layout_setup ( const std::vector< int > &  lattice_size,
std::vector< int > &  grid_size 
)
static

initialise layout.

Definition at line 154 of file layout.cpp.

◆ layout_setup() [4/4]

static int Communicator_impl::Layout::layout_setup ( const std::vector< int > &  lattice_size,
std::vector< int > &  grid_size 
)
static

initialise layout.

◆ npe() [1/2]

static int Communicator_impl::Layout::npe ( const int  idir)
static

grid size in idir direction.

◆ npe() [2/2]

int Communicator_impl::Layout::npe ( const int  idir)
static

grid size in idir direction.

Definition at line 50 of file layout.cpp.

◆ operator=() [1/2]

Layout& Communicator_impl::Layout::operator= ( const Layout )
private

assignment is hidden as private.

◆ operator=() [2/2]

Layout& Communicator_impl::Layout::operator= ( const Layout )
private

assignment is hidden as private.

◆ physical_map_delete() [1/2]

int Communicator_impl::Layout::physical_map_delete ( )
static

Definition at line 76 of file physical_map.cpp.

◆ physical_map_delete() [2/2]

static int Communicator_impl::Layout::physical_map_delete ( )
static

◆ physical_map_setup() [1/2]

int Communicator_impl::Layout::physical_map_setup ( )
static

Definition at line 57 of file physical_map.cpp.

◆ physical_map_setup() [2/2]

static int Communicator_impl::Layout::physical_map_setup ( )
static

◆ subgrid_delete() [1/2]

static int Communicator_impl::Layout::subgrid_delete ( )
static

◆ subgrid_delete() [2/2]

int Communicator_impl::Layout::subgrid_delete ( )
static

Definition at line 299 of file layout.cpp.

◆ subgrid_setup() [1/2]

static int Communicator_impl::Layout::subgrid_setup ( )
static

◆ subgrid_setup() [2/2]

int Communicator_impl::Layout::subgrid_setup ( )
static

Definition at line 258 of file layout.cpp.

◆ tag() [1/2]

static int Communicator_impl::Layout::tag ( int  rank,
int  idir,
int  ipm 
)
static

generate tag for communication.

◆ tag() [2/2]

int Communicator_impl::Layout::tag ( int  rank,
int  idir,
int  ipm 
)
static

generate tag for communication.

Definition at line 68 of file layout.cpp.

Member Data Documentation

◆ m_dims

static int * Communicator_impl::Layout::m_dims = 0
static

lattice extent (Lx, Ly, Lz, Lt)

Definition at line 47 of file layout.h.

◆ m_grid_coord

static int * Communicator_impl::Layout::m_grid_coord = 0
static

grid coordinate.

Definition at line 51 of file layout.h.

◆ m_grid_dims

static int * Communicator_impl::Layout::m_grid_dims = 0
static

grid dimensions in directions.

Definition at line 50 of file layout.h.

◆ m_ipe_dn

static int * Communicator_impl::Layout::m_ipe_dn = 0
static

rank of downward neighbour in directions.

Definition at line 54 of file layout.h.

◆ m_ipe_up

static int * Communicator_impl::Layout::m_ipe_up = 0
static

rank of upward neighbour in directions.

Definition at line 53 of file layout.h.

◆ m_map_grid

static char Communicator_impl::Layout::m_map_grid
static

Definition at line 57 of file layout.h.

◆ m_ndim

static int Communicator_impl::Layout::m_ndim = 0
static

number of dimensions.

Definition at line 46 of file layout.h.

◆ m_physical_to_logical

static int * Communicator_impl::Layout::m_physical_to_logical = 0
static

map between physical and logical grid

Definition at line 58 of file layout.h.

◆ m_sub_comm

static MPI_Comm * Communicator_impl::Layout::m_sub_comm = 0
static

subgrid

Definition at line 64 of file layout.h.


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