`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);

# Implementation

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

class distributor : public Vector<std::allocator<int>::size_type> {
public:
// typedefs:
typedef std::allocator<int>::size_type size_type;
typedef Vector<size_type> _base;
typedef _base::iterator iterator;
typedef _base::const_iterator const_iterator;
typedef int tag_type;
typedef communicator communicator_type;
// constants:
static const size_type decide = size_type(-1);
// allocators/deallocators:
distributor(
size_type dis_size = 0,
const communicator_type& c = communicator_type(),
size_type loc_size = decide);
distributor(const distributor&);
~distributor();
void resize(
size_type dis_size = 0,
const communicator_type& c = communicator_type(),
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 find_owner (size_type dis_i) const;
size_type first_index (size_type iproc) const;
size_type last_index (size_type iproc) const;
size_type size (size_type iproc) const;
size_type first_index () const;
size_type last_index () 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;
static tag_type get_new_tag();
// comparators:
bool operator== (const distributor&) const;
bool operator!= (const distributor&) const;
size_type
field::size_type size_type
Definition: branch.cc:425
rheolef::distributor::last_index
size_type last_index() const
Definition: distributor.h:195
rheolef::distributor::n_process
size_type n_process() const
number of processes
Definition: distributor.h:169
rheolef::distributor::_base
Vector< size_type > _base
Definition: distributor.h:68
rheolef::distributor::find_owner
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
rheolef::distributor::resize
void resize(size_type dis_size=0, const communicator_type &c=communicator_type(), size_type loc_size=decide)
Definition: distributor.cc:30
rheolef::distributor::~distributor
~distributor()
Definition: distributor.cc:102
rheolef::distributor::dis_size
size_type dis_size() const
global and local sizes
Definition: distributor.h:207
rheolef::distributor::communicator_type
communicator communicator_type
Definition: distributor.h:72
rheolef::distributor::get_new_tag
static tag_type get_new_tag()
returns a new tag
Definition: distributor.cc:133
rheolef::distributor::iterator
_base::iterator iterator
Definition: distributor.h:69
rheolef::distributor::process
size_type process() const
current process id
Definition: distributor.h:179
rheolef::distributor::operator!=
bool operator!=(const distributor &) const
Definition: distributor.h:225
rheolef::distributor::first_index
size_type first_index() const
global index range and local size owned by current process
Definition: distributor.h:189
rheolef::distributor::operator==
bool operator==(const distributor &) const
Definition: distributor.h:231
rheolef::distributor::const_iterator
_base::const_iterator const_iterator
Definition: distributor.h:70
rheolef::distributor::size
size_type size() const
Definition: distributor.h:201
rheolef::distributor::is_owned
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:213
rheolef::distributor::decide
static const size_type decide
Definition: distributor.h:76
rheolef::distributor::tag_type
int tag_type
Definition: distributor.h:71
rheolef::distributor::distributor
distributor(size_type dis_size=0, const communicator_type &c=communicator_type(), size_type loc_size=decide)
Definition: distributor.cc:88
rheolef::distributor::size_type
std::allocator< int >::size_type size_type
Definition: distributor.h:67
rheolef::distributor::comm
const communicator_type & comm() const
Definition: distributor.h:145
mkgeo_ball.c
int c
Definition: mkgeo_ball.sh:153
rheolef::Vector::iterator
DATA::iterator iterator
Definition: Vector.h:183
rheolef::Vector::const_iterator
DATA::const_iterator const_iterator
Definition: Vector.h:184
};