Rheolef  7.2
an efficient C++ finite element environment
distributor

memory distribution table

Description

Given an array size, this class decides which process will own which part of a distributed memory array such as disarray.

Example

    distributor ownership (100);

TODO

Ambiguous use of size() and dis_size(). Here size() refers to n_process(), while size(iproc) and dis_size() refer to the size of the index ranges. Then, size() should be avoided, and we should use n_process() instead.

Implementation

This documentation has been generated from file linalg/lib/distributor.h

class distributor : public Vector<std::allocator<int>::size_type> {
public:
// typedefs:
typedef Vector<size_type> _base;
typedef int tag_type;
// constants:
static const size_type decide = size_type(-1);
// allocators/deallocators:
size_type loc_size = decide);
void resize(
size_type loc_size = decide);
// accessors:
const communicator_type& comm() const;
size_type dis_size () const;
size_type process () const;
size_type n_process () const;
size_type size (size_type iproc) const;
size_type size () const;
bool is_owned (size_type dis_i, size_type iproc) const;
// the same with ip=current process
bool is_owned (size_type dis_i) const;
// comparators:
bool operator== (const distributor&) const;
bool operator!= (const distributor&) const;
field::size_type size_type
Definition: branch.cc:430
see the communicator page for the full documentation
size_type last_index() const
Definition: distributor.h:202
size_type n_process() const
number of processes
Definition: distributor.h:176
Vector< size_type > _base
Definition: distributor.h:75
size_type find_owner(size_type dis_i) const
find iproc associated to a global index dis_i: CPU=log(nproc)
Definition: distributor.cc:106
void resize(size_type dis_size=0, const communicator_type &c=communicator_type(), size_type loc_size=decide)
Definition: distributor.cc:30
size_type dis_size() const
global and local sizes
Definition: distributor.h:214
communicator communicator_type
Definition: distributor.h:79
static tag_type get_new_tag()
returns a new tag
Definition: distributor.cc:133
_base::iterator iterator
Definition: distributor.h:76
size_type process() const
current process id
Definition: distributor.h:186
bool operator!=(const distributor &) const
Definition: distributor.h:232
size_type first_index() const
global index range and local size owned by current process
Definition: distributor.h:196
bool operator==(const distributor &) const
Definition: distributor.h:238
_base::const_iterator const_iterator
Definition: distributor.h:77
size_type size() const
Definition: distributor.h:208
bool is_owned(size_type dis_i, size_type iproc) const
true when dis_i in [first_index(iproc):last_index(iproc)[
Definition: distributor.h:220
static const size_type decide
Definition: distributor.h:83
distributor(size_type dis_size=0, const communicator_type &c=communicator_type(), size_type loc_size=decide)
Definition: distributor.cc:88
std::allocator< int >::size_type size_type
Definition: distributor.h:74
const communicator_type & comm() const
Definition: distributor.h:152
DATA::iterator iterator
Definition: Vector.h:183
DATA::const_iterator const_iterator
Definition: Vector.h:184
};