DUNE PDELab (git)
torus.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
71 Torus (Communication comm, int tag, iTupel size, int overlap, const Yasp::Partitioning<d>* partitioner)
87 DUNE_THROW(Dune::Exception, "Communicator size and result of the given load balancer do not match!");
239 double partition (int rank, iTupel origin_in, iTupel size_in, iTupel& origin_out, iTupel& size_out) const
392 std::cout << "[" << rank() << "]: ERROR: local sends/receives do not match in exchange!" << std::endl;
399 std::cout << "[" << rank() << "]: ERROR: size in local sends/receive does not match in exchange!" << std::endl;
453 s << "[" << rank() << "]: Torus " << procs() << " processor(s) arranged as " << dims() << std::endl;
helper classes to provide unique types for standard functions
Collective communication interface and sequential default implementation.
Definition: communication.hh:100
int rank() const
Return rank, is between 0 and size()-1.
Definition: communication.hh:114
int size() const
Number of processes in set, is greater than 0.
Definition: communication.hh:126
Definition: torus.hh:276
iTupel delta() const
return distance vector
Definition: torus.hh:291
bool operator==(const ProcListIterator &iter) const
Return true when two iterators point to same member.
Definition: torus.hh:313
bool operator!=(const ProcListIterator &iter) const
Return true when two iterators do not point to same member.
Definition: torus.hh:320
int rank() const
return rank of neighboring process
Definition: torus.hh:285
ProcListIterator(typename std::deque< CommPartner >::const_iterator iter)
make an iterator
Definition: torus.hh:279
ProcListIterator & operator++()
Increment iterator to next cell.
Definition: torus.hh:326
int index() const
return index in proclist
Definition: torus.hh:297
int distance() const
return 1-norm of distance vector
Definition: torus.hh:303
Definition: torus.hh:46
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 ...
Definition: torus.hh:239
int dims(int i) const
return dimensions of torus in direction i
Definition: torus.hh:118
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)
Definition: torus.hh:166
void recv(int rank, void *buffer, int size) const
store a receive request; buffers are received in order; handles also local requests with memcpy
Definition: torus.hh:374
void send(int rank, void *buffer, int size) const
store a send request; buffers are sent in order; handles also local requests with memcpy
Definition: torus.hh:361
Torus(Communication comm, int tag, iTupel size, int overlap, const Yasp::Partitioning< d > *partitioner)
make partitioner from communicator and coarse mesh size
Definition: torus.hh:71
int neighbors() const
return the number of neighbors, which is
Definition: torus.hh:203
void print(std::ostream &s) const
print contents of torus object
Definition: torus.hh:451
int color(const iTupel &coord) const
assign color to given coordinate
Definition: torus.hh:174
ProcListIterator recvend() const
last process in receive list
Definition: torus.hh:355
bool is_neighbor(iTupel delta, std::bitset< d > periodic) const
return true if neighbor with given delta is a neighbor under the given periodicity
Definition: torus.hh:212
iTupel rank_to_coord(int rank) const
map rank to coordinate in torus using lexicographic ordering
Definition: torus.hh:144
std::array< int, d > iTupel
type used to pass tupels in and out
Definition: torus.hh:49
ProcListIterator sendbegin() const
first process in send list
Definition: torus.hh:337
void exchange() const
exchange messages stored in request buffers; clear request buffers afterwards
Definition: torus.hh:387
ProcListIterator recvbegin() const
first process in receive list
Definition: torus.hh:349
int coord_to_rank(iTupel coord) const
map coordinate in torus to rank using lexicographic ordering
Definition: torus.hh:157
bool inside(iTupel c) const
return true if coordinate is inside torus
Definition: torus.hh:136
a base class for the yaspgrid partitioning strategy
Definition: partitioning.hh:38
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
constexpr Base power(Base m, Exponent p)
Power method for integer exponents.
Definition: math.hh:75
This file provides tools to partition YaspGrids. If you want to write your own partitioner,...
Implementation of stream operators for std::array and std::tuple.
|
Legal Statements / Impressum |
Hosted by TU Dresden |
generated with Hugo v0.111.3
(Nov 23, 23:29, 2024)