dune-grid
2.4.1
|
#include <dune/grid/yaspgrid/torus.hh>
Classes | |
class | ProcListIterator |
Public Types | |
typedef Dune::array< int, d > | iTupel |
type used to pass tupels in and out More... | |
Public Member Functions | |
Torus () | |
constructor making uninitialized object More... | |
Torus (CollectiveCommunication comm, int tag, iTupel size, const YLoadBalance< d > *lb) | |
make partitioner from communicator and coarse mesh size More... | |
int | rank () const |
return own rank More... | |
iTupel | coord () const |
return own coordinates More... | |
int | procs () const |
return number of processes More... | |
const iTupel & | dims () const |
return dimensions of torus More... | |
int | dims (int i) const |
return dimensions of torus in direction i More... | |
CollectiveCommunication | comm () const |
return communicator More... | |
int | tag () const |
return tag used by torus More... | |
bool | inside (iTupel c) const |
return true if coordinate is inside torus More... | |
iTupel | rank_to_coord (int rank) const |
map rank to coordinate in torus using lexicographic ordering More... | |
int | coord_to_rank (iTupel coord) const |
map coordinate in torus to rank using lexicographic ordering More... | |
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) More... | |
int | color (const iTupel &coord) const |
assign color to given coordinate More... | |
int | color (int rank) const |
assign color to given rank More... | |
int | neighbors () const |
return the number of neighbors, which is ![]() | |
bool | is_neighbor (iTupel delta, std::bitset< d > periodic) const |
return true if neighbor with given delta is a neighbor under the given periodicity More... | |
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 More... | |
ProcListIterator | sendbegin () const |
first process in send list More... | |
ProcListIterator | sendend () const |
end of send list More... | |
ProcListIterator | recvbegin () const |
first process in receive list More... | |
ProcListIterator | recvend () const |
last process in receive list More... | |
void | send (int rank, void *buffer, int size) const |
store a send request; buffers are sent in order; handles also local requests with memcpy More... | |
void | recv (int rank, void *buffer, int size) const |
store a receive request; buffers are received in order; handles also local requests with memcpy More... | |
void | exchange () const |
exchange messages stored in request buffers; clear request buffers afterwards More... | |
double | global_max (double x) const |
global max More... | |
void | print (std::ostream &s) const |
print contents of torus object More... | |
Torus provides all the functionality to handle a toroidal communication structure:
typedef Dune::array<int, d> Dune::Torus< CollectiveCommunication, d >::iTupel |
type used to pass tupels in and out
|
inline |
constructor making uninitialized object
|
inline |
make partitioner from communicator and coarse mesh size
|
inline |
assign color to given coordinate
Referenced by Dune::Torus< CollectiveCommunicationType, dim >::color().
|
inline |
assign color to given rank
|
inline |
return communicator
|
inline |
return own coordinates
Referenced by Dune::YaspGrid< dim, Coordinates >::intersections(), Dune::Torus< CollectiveCommunicationType, dim >::is_neighbor(), Dune::Torus< CollectiveCommunicationType, dim >::partition(), Dune::Torus< CollectiveCommunicationType, dim >::rank_relative(), and Dune::Torus< CollectiveCommunicationType, dim >::rank_to_coord().
|
inline |
map coordinate in torus to rank using lexicographic ordering
Referenced by Dune::Torus< CollectiveCommunicationType, dim >::rank_relative().
|
inline |
return dimensions of torus
Referenced by Dune::BackupRestoreFacility< Dune::YaspGrid< dim, Coordinates > >::backup(), Dune::BackupRestoreFacility< YaspGrid< dim, TensorProductCoordinates< ctype, dim > > >::backup(), Dune::YaspGrid< dim, Coordinates >::intersections(), and Dune::Torus< CollectiveCommunicationType, dim >::print().
|
inline |
return dimensions of torus in direction i
|
inline |
exchange messages stored in request buffers; clear request buffers afterwards
Referenced by Dune::YaspGrid< dim, Coordinates >::communicateCodim(), and Dune::YaspGrid< dim, Coordinates >::intersections().
|
inline |
global max
|
inline |
return true if coordinate is inside torus
|
inline |
return true if neighbor with given delta is a neighbor under the given periodicity
|
inline |
return the number of neighbors, which is
Referenced by Dune::YaspGrid< dim, Coordinates >::intersections().
|
inline |
partition the given grid onto the torus and return the piece of the process with given rank; returns load imbalance
rank | rank of our processor |
origin_in | global origin |
size_in | global size |
origin_out | origin of this processors interior |
size_out | size of this processors interior |
Referenced by Dune::YaspGrid< dim, Coordinates >::YaspGrid().
|
inline |
print contents of torus object
|
inline |
return number of processes
Referenced by Dune::Torus< CollectiveCommunicationType, dim >::print().
|
inline |
return own rank
Referenced by Dune::Torus< CollectiveCommunicationType, dim >::coord_to_rank(), Dune::Torus< CollectiveCommunicationType, dim >::exchange(), Dune::Torus< CollectiveCommunicationType, dim >::print(), Dune::Torus< CollectiveCommunicationType, dim >::recv(), Dune::Torus< CollectiveCommunicationType, dim >::send(), and Dune::YaspGrid< dim, Coordinates >::YaspGrid().
|
inline |
return rank of process where its coordinate in direction dir has offset cnt (handles periodic case)
|
inline |
map rank to coordinate in torus using lexicographic ordering
Referenced by Dune::Torus< CollectiveCommunicationType, dim >::color(), Dune::Torus< CollectiveCommunicationType, dim >::coord(), Dune::Torus< CollectiveCommunicationType, dim >::is_neighbor(), Dune::Torus< CollectiveCommunicationType, dim >::partition(), and Dune::Torus< CollectiveCommunicationType, dim >::rank_relative().
|
inline |
store a receive request; buffers are received in order; handles also local requests with memcpy
Referenced by Dune::YaspGrid< dim, Coordinates >::communicateCodim(), and Dune::YaspGrid< dim, Coordinates >::intersections().
|
inline |
first process in receive list
Referenced by Dune::YaspGrid< dim, Coordinates >::intersections(), and Dune::Torus< CollectiveCommunicationType, dim >::print().
|
inline |
last process in receive list
Referenced by Dune::YaspGrid< dim, Coordinates >::intersections(), and Dune::Torus< CollectiveCommunicationType, dim >::print().
|
inline |
store a send request; buffers are sent in order; handles also local requests with memcpy
Referenced by Dune::YaspGrid< dim, Coordinates >::communicateCodim(), and Dune::YaspGrid< dim, Coordinates >::intersections().
|
inline |
first process in send list
Referenced by Dune::YaspGrid< dim, Coordinates >::intersections(), and Dune::Torus< CollectiveCommunicationType, dim >::print().
|
inline |
end of send list
Referenced by Dune::YaspGrid< dim, Coordinates >::intersections(), and Dune::Torus< CollectiveCommunicationType, dim >::print().
|
inline |
return tag used by torus