ESyS-Particle
4.0.1
|
class for a cartesian communicator More...
#include <cart_comm.h>
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 | |
vector< int > | get_coords () const |
get own coords | |
vector< int > | get_all_dims () const |
get size of communicator in all directions | |
int | get_dim (int) |
get size of communicator in one direction | |
int | get_ndim () const |
template<typename T , typename P > | |
void | shift (T, P &, int, int, int=0) |
shift ops | |
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 | |
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) |
class for a cartesian communicator
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.
old_comm | the old communicator |
dims | the dimensions |
circular | circular boundaries |
References BasicCon::Debug().
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
old_comm | the old communicator |
ndims | the number of dimensions |
dims | the dimensions |
circular | circular boundaries |
TML_CartComm::TML_CartComm | ( | TML_Comm * | old_comm, |
unsigned int | ndims, | ||
int * | dims, | ||
int * | circular | ||
) |
Constructor, using C arrays for dimensions and boundary conditions
old_comm | the old communicator |
ndims | the number of dimensions |
dims | the dimensions |
circular | circular boundaries |
vector< int > TML_CartComm::get_all_dims | ( | ) | const |
get size of communicator in all directions
Get size of the communicator in all directions
vector< int > TML_CartComm::get_coords | ( | int | rank | ) |
get coords of a process
Get cartesian coordinates of a given process in the communicator
rank | the rank of the process |
Referenced by ParallelParticleArray< T >::ParallelParticleArray().
vector< int > TML_CartComm::get_coords | ( | ) | const |
get own coords
Get cartesian coordinates of local process
int TML_CartComm::get_dim | ( | int | i | ) |
get size of communicator in one direction
get size of communicator in direction i
i | the number of the direction |
Referenced by ParallelParticleArray< T >::ParallelParticleArray().
void TML_CartComm::shift | ( | T | 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.
send_data | data to be sent |
recv | data data to be received |
dir | direction |
dist | the shift distance along dir |
tag | the message tag |
References TML_Comm::sendrecv().
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.
send_data | data to be sent |
size | of arry to be sent |
recv | data data to be received |
size | of arry to be received |
dir | direction |
dist | the shift distance along dir |
tag | the message tag |
References TML_Comm::sendrecv().
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.
send_data | data to be sent |
size | of arry to be sent |
recv | data data to be received |
size | of arry to be received |
dir | direction |
dist | the shift distance along dir |
tag | the message tag |
void TML_CartComm::shift_cont | ( | T | 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.
send_data | data to be sent |
recv | data data to be received |
dir | direction |
dist | the shift distance along dir |
tag | the message tag |
References TML_Comm::sendrecv_cont().
void TML_CartComm::shift_cont_packed | ( | T | 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.
send_data | data to be sent |
recv | data data to be received |
dir | direction |
dist | the shift distance along dir |
tag | the message tag |
References TML_Comm::sendrecv_cont_packed().
void TML_CartComm::shift_packed | ( | T | 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.
send_data | data to be sent |
recv | data data to be received |
dir | direction |
dist | the shift distance along dir |
tag | the message tag |