Dune::Torus< d > Class Template Reference
#include <grids.hh>
Detailed Description
template<int d>
class Dune::Torus< d >
Torus provides all the functionality to handle a toroidal communication structure:
- Map a set of processes (given by an MPI communicator) to a torus of dimension d. The "optimal" torus dimensions are determined by a coarse mesh. The maximum side length is minimized.
- Provide lists of neighboring processes and a method for nearest neighbor exchange using asynchronous communication with MPI. The periodic case is handled where one process might have to exchange several messages with the same process. (Logically, a process has always
neighbors, but several of these logical neighbors might be identical)
- Provide means to partition a grid to the torus.
Public Types | |
typedef FieldVector< int, d > | iTupel |
type used to pass tupels in and out | |
Public Member Functions | |
Torus () | |
constructor making uninitialized object | |
Torus (MPI_Comm comm, int tag, iTupel size) | |
make partitioner from communicator and coarse mesh size | |
int | rank () const |
return own rank | |
iTupel | coord () const |
return own coordinates | |
int | procs () const |
return number of processes | |
const iTupel & | dims () const |
return dimensions of torus | |
int | dims (int i) const |
return dimensions of torus in direction i | |
MPI_Comm | comm () const |
return MPI communicator | |
int | tag () const |
return tag used by torus | |
bool | inside (iTupel c) const |
return true if coordinate is inside torus | |
iTupel | rank_to_coord (int rank) const |
map rank to coordinate in torus using lexicographic ordering | |
int | coord_to_rank (iTupel coord) const |
map coordinate in torus to rank using lexicographic ordering | |
int | rank_relative (int rank, int dir, int cnt) const |
return rank of process where its coordinate in direction dir has offset cnt (handles periodic case) | |
int | color (const iTupel &coord) const |
assign color to given coordinate | |
int | color (int rank) const |
assign color to given rank | |
int | neighbors () const |
return the number of neighbors, which is ![]() | |
bool | is_neighbor (iTupel delta, bTupel periodic) const |
return true if neighbor with given delta is a neighbor under the given periodicity | |
double | partition (int rank, iTupel origin_in, iTupel size_in, iTupel &origin_out, iTupel &size_out) const |
partition the given grid onto the torus and return the piece of the process with given rank; returns load imbalance | |
ProcListIterator | sendbegin () const |
first process in send list | |
ProcListIterator | sendend () const |
end of send list | |
ProcListIterator | recvbegin () const |
first process in receive list | |
ProcListIterator | recvend () const |
last process in receive list | |
void | send (int rank, void *buffer, int size) const |
store a send request; buffers are sent in order; handles also local requests with memcpy | |
void | recv (int rank, void *buffer, int size) const |
store a receive request; buffers are received in order; handles also local requests with memcpy | |
void | exchange () const |
exchange messages stored in request buffers; clear request buffers afterwards | |
double | global_sum (double x) const |
global sum | |
double | global_max (double x) const |
global max | |
double | global_min (double x) const |
global min | |
void | print (std::ostream &s) const |
print contents of torus object | |
Classes | |
class | ProcListIterator |
The documentation for this class was generated from the following file: