Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 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

 Layout ()
 constructor is hidden as private; no instantiation. More...
 
 Layout (const Layout &)
 copy constructor is hidden as private; no instantiation. 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.

Constructor & Destructor Documentation

Communicator_impl::Layout::Layout ( )
inlineprivate

constructor is hidden as private; no instantiation.

Definition at line 70 of file layout.h.

Communicator_impl::Layout::Layout ( const Layout )
inlineprivate

copy constructor is hidden as private; no instantiation.

Definition at line 71 of file layout.h.

Member Function Documentation

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.

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

find grid size.

Definition at line 57 of file layout.cpp.

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.

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

grid coordinate along idir direction.

Definition at line 43 of file layout.cpp.

int Communicator_impl::Layout::layout_delete ( )
static

destroy layout and clean up.

Definition at line 240 of file layout.cpp.

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.

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.

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

grid size in idir direction.

Definition at line 50 of file layout.cpp.

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

assignment is hidden as private.

int Communicator_impl::Layout::physical_map_delete ( )
static

Definition at line 76 of file physical_map.cpp.

int Communicator_impl::Layout::physical_map_setup ( )
static

Definition at line 57 of file physical_map.cpp.

int Communicator_impl::Layout::subgrid_delete ( )
static

Definition at line 297 of file layout.cpp.

int Communicator_impl::Layout::subgrid_setup ( )
static

Definition at line 258 of file layout.cpp.

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

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

lattice extent (Lx, Ly, Lz, Lt)

Definition at line 47 of file layout.h.

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

grid coordinate.

Definition at line 51 of file layout.h.

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

grid dimensions in directions.

Definition at line 50 of file layout.h.

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

rank of downward neighbour in directions.

Definition at line 54 of file layout.h.

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

rank of upward neighbour in directions.

Definition at line 53 of file layout.h.

char Communicator_impl::Layout::m_map_grid
static

Definition at line 57 of file layout.h.

int Communicator_impl::Layout::m_ndim = 0
static

number of dimensions.

Definition at line 46 of file layout.h.

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

map between physical and logical grid

Definition at line 58 of file layout.h.

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: