ESyS-Particle  2.3.4
TML_CartComm Class Reference

class for a cartesian communicator More...

#include <cart_comm.h>

Inheritance diagram for TML_CartComm:
Collaboration diagram for TML_CartComm:

Public Member Functions

 TML_CartComm (TML_Comm *comm, vector< unsigned int > dims, vector< bool > circular)
 
 TML_CartComm (TML_Comm *comm, unsigned int ndims, const vector< int > &dims, const vector< bool > &circular)
 
 TML_CartComm (TML_Comm *, unsigned int, int *, int *)
 
vector< int > get_coords (int)
 get coords of a process More...
 
vector< int > get_coords () const
 get own coords More...
 
vector< int > get_all_dims () const
 get size of communicator in all directions More...
 
int get_dim (int)
 get size of communicator in one direction More...
 
int get_ndim () const
 
template<typename T , typename P >
void shift (T, P &, int, int, int=0)
 shift ops More...
 
template<typename T , typename P >
void shift_array (T *, int, P *, int, int, int, int=0)
 
template<typename T , typename P >
void shift_cont (T, P &, int, int, int=0)
 
template<typename T , typename P >
void shift_packed (T, P &, int, int, int=0)
 packed shift ops More...
 
template<typename T , typename P >
void shift_array_packed (T *, int, P *, int, int, int, int=0)
 
template<typename T , typename P >
void shift_cont_packed (T, P &, int, int, int=0)
 
- Public Member Functions inherited from TML_Comm
bool isNull () const
 
int rank () const
 
int size ()
 
MPI_Comm comm () const
 
TML_Commoperator= (const TML_Comm &)
 
void setComm (MPI_Comm)
 
 TML_Comm ()
 
 TML_Comm (MPI_Comm)
 
TML_Comm include (const vector< int > &)
 
TML_Comm exclude (const vector< int > &)
 
template<typename T >
void send (T, int, int=0)
 
template<typename T >
void receive (T &, int, int=MPI_ANY_TAG)
 
template<typename T >
void send_array (T *, int, int, int=0)
 
template<typename T >
void receive_array (T *, int, int, int=MPI_ANY_TAG)
 
template<typename T >
void send_cont (const T &, int, int=0)
 
template<typename T >
void receive_cont (T &, int, int=MPI_ANY_TAG)
 
template<typename T >
void send_cont_packed (T, int, bool, int=0)
 
template<typename T >
void receive_cont_packed (T &, int, bool, int=MPI_ANY_TAG)
 
template<typename T , typename P >
void sendrecv (T, P &, int, int, int=0)
 
template<typename T , typename P >
void sendrecv_array (T *, int, P *, int, int, int, int=0)
 
template<typename T , typename P >
void sendrecv_cont (T, P &, int, int, int=0)
 
template<typename T >
void sendrecv_cont_replace (T &, int, int, int=0)
 
template<typename T , typename P >
void sendrecv_cont_packed (T, P &, int, int, bool, int=0)
 
template<typename T >
void sendrecv_cont_packed_replace (T &, int, int, bool, int=0)
 
template<typename T >
void broadcast (T)
 
template<typename T >
void broadcast_array (T *, int)
 
template<typename T >
void broadcast_cont (const T &)
 
template<typename T >
void broadcast_cont_packed (const T &)
 
template<typename T >
void recv_broadcast (T &, int)
 
template<typename T >
void recv_broadcast_array (T *, int, int)
 
template<typename T >
void recv_broadcast_cont (T &, int)
 
template<typename T >
void recv_broadcast_cont_packed (T &, int)
 
template<typename T >
void scatter (const multimap< int, T >)
 
template<typename T >
void recv_scatter (T &, int)
 
template<typename T >
void gather (multimap< int, T > &)
 
template<typename T >
void send_gather (T &, int)
 
template<typename T >
void gather_debug (multimap< int, T > &)
 
template<typename T >
void send_gather_debug (T &, int)
 
template<typename T >
void scatter_packed (const multimap< int, T >)
 
template<typename T >
void recv_scatter_packed (T &, int)
 
template<typename T >
void gather_packed (multimap< int, T > &)
 
template<typename T >
void send_gather_packed (const T &, int)
 
template<typename T >
sum_all (const T &)
 
void barrier ()
 
void barrier (const string &)
 

Private Attributes

int m_ndims
 
vector< int > m_dims
 

Additional Inherited Members

- Protected Attributes inherited from TML_Comm
MPI_Status m_status
 
MPI_Comm m_comm
 

Detailed Description

class for a cartesian communicator

Author
Steffen Abe $Revision$ $Date$

Constructor & Destructor Documentation

◆ TML_CartComm() [1/3]

TML_CartComm::TML_CartComm ( TML_Comm old_comm,
vector< unsigned int >  dims,
vector< bool >  circular 
)

Constructor, using an STL vector for boundary conditions and optionally prescribing dimensions. Dimensions are choosen according to the size of the communicator via MPI_Create_dims.

Parameters
old_commthe old communicator
dimsthe dimensions
circularcircular boundaries

References TML_Comm::comm(), console, Console::Debug(), TML_Comm::m_comm, m_dims, m_ndims, and TML_Comm::size().

Here is the call graph for this function:

◆ TML_CartComm() [2/3]

TML_CartComm::TML_CartComm ( TML_Comm old_comm,
unsigned int  ndims,
const vector< int > &  dims,
const vector< bool > &  circular 
)

Constructor, using STL vectors for dimensions and boundary conditions

Parameters
old_commthe old communicator
ndimsthe number of dimensions
dimsthe dimensions
circularcircular boundaries

References TML_Comm::comm(), esys::lsm::bpu::iter(), TML_Comm::m_comm, m_dims, m_ndims, and TML_Comm::size().

Here is the call graph for this function:

◆ TML_CartComm() [3/3]

TML_CartComm::TML_CartComm ( TML_Comm old_comm,
unsigned int  ndims,
int *  dims,
int *  circular 
)

Constructor, using C arrays for dimensions and boundary conditions

Parameters
old_commthe old communicator
ndimsthe number of dimensions
dimsthe dimensions
circularcircular boundaries
Warning
no checking of nr. of dims and boundary cond.

References TML_Comm::comm(), TML_Comm::m_comm, m_dims, m_ndims, and TML_Comm::size().

Here is the call graph for this function:

Member Function Documentation

◆ get_all_dims()

vector< int > TML_CartComm::get_all_dims ( ) const

get size of communicator in all directions

Get size of the communicator in all directions

References m_dims, and m_ndims.

◆ get_coords() [1/2]

vector< int > TML_CartComm::get_coords ( ) const

get own coords

Get cartesian coordinates of local process

References TML_Comm::m_comm, m_ndims, and TML_Comm::rank().

Here is the call graph for this function:

◆ get_coords() [2/2]

vector< int > TML_CartComm::get_coords ( int  rank)

get coords of a process

Get cartesian coordinates of a given process in the communicator

Parameters
rankthe rank of the process

References TML_Comm::m_comm, m_ndims, and TML_Comm::rank().

Referenced by test_get_coords().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_dim()

int TML_CartComm::get_dim ( int  i)

get size of communicator in one direction

get size of communicator in direction i

Parameters
ithe number of the direction

References m_dims, and m_ndims.

◆ get_ndim()

int TML_CartComm::get_ndim ( ) const
inline

References m_ndims.

◆ shift()

template<typename T , typename P >
void TML_CartComm::shift ( send_data,
P &  recv_data,
int  dir,
int  dist,
int  tag = 0 
)

shift ops

Shift a single value along a cartesian direction. Gets the source/destination with MPI_Cart_shift and moves the data with sendrecv. If the direction is out of range, nothing is done.

Parameters
send_datadata to be sent
recvdata data to be received
dirdirection
distthe shift distance along dir
tagthe message tag

References TML_Comm::m_comm, m_ndims, and TML_Comm::sendrecv().

Here is the call graph for this function:

◆ shift_array()

template<typename T , typename P >
void TML_CartComm::shift_array ( T *  send_data,
int  send_count,
P *  recv_data,
int  recv_count,
int  dir,
int  dist,
int  tag = 0 
)

Shift C-arrays of known size value along a cartesian direction. Gets the source/destination with MPI_Cart_shift and moves the data with sendrecv. If the direction is out of range, nothing is done.

Parameters
send_datadata to be sent
sizeof arry to be sent
recvdata data to be received
sizeof arry to be received
dirdirection
distthe shift distance along dir
tagthe message tag

References TML_Comm::m_comm, m_ndims, and TML_Comm::sendrecv().

Here is the call graph for this function:

◆ shift_array_packed()

template<typename T , typename P >
void TML_CartComm::shift_array_packed ( T *  send_data,
int  send_count,
P *  recv_data,
int  recv_count,
int  dir,
int  dist,
int  tag = 0 
)

Shift C-arrays of packable objects of known size value along a cartesian direction. Gets the source/destination with MPI_Cart_shift and moves the data with sendrecv. If the direction is out of range, nothing is done.

Parameters
send_datadata to be sent
sizeof arry to be sent
recvdata data to be received
sizeof arry to be received
dirdirection
distthe shift distance along dir
tagthe message tag

References TML_Comm::m_comm, and m_ndims.

◆ shift_cont()

template<typename T , typename P >
void TML_CartComm::shift_cont ( send_data,
P &  recv_data,
int  dir,
int  dist,
int  tag = 0 
)

Shift STL containers along a cartesian direction. Gets the source/destination with MPI_Cart_shift and moves the data with sendrecv. If the direction is out of range, nothing is done.

Parameters
send_datadata to be sent
recvdata data to be received
dirdirection
distthe shift distance along dir
tagthe message tag

References TML_Comm::m_comm, m_ndims, and TML_Comm::sendrecv_cont().

Referenced by main(), and test_shift().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shift_cont_packed()

template<typename T , typename P >
void TML_CartComm::shift_cont_packed ( send_data,
P &  recv_data,
int  dir,
int  dist,
int  tag = 0 
)

Shift STL containers of packable objects along a cartesian direction. Gets the source/destination with MPI_Cart_shift and moves the data with sendrecv. If the direction is out of range, nothing is done.

Parameters
send_datadata to be sent
recvdata data to be received
dirdirection
distthe shift distance along dir
tagthe message tag

References TML_Comm::m_comm, m_ndims, and TML_Comm::sendrecv_cont_packed().

Here is the call graph for this function:

◆ shift_packed()

template<typename T , typename P >
void TML_CartComm::shift_packed ( send_data,
P &  recv_data,
int  dir,
int  dist,
int  tag = 0 
)

packed shift ops

Shift a single packable object along a cartesian direction. Gets the source/destination with MPI_Cart_shift and moves the data with sendrecv. If the direction is out of range, nothing is done.

Parameters
send_datadata to be sent
recvdata data to be received
dirdirection
distthe shift distance along dir
tagthe message tag

References TML_Comm::m_comm, and m_ndims.

Member Data Documentation

◆ m_dims

vector<int> TML_CartComm::m_dims
private

Referenced by get_all_dims(), get_dim(), and TML_CartComm().

◆ m_ndims


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