22# include "rheolef/distributor.h"
42 check_macro (loc_size1 !=
decide,
"both dis_size and local size are indetermined");
43#ifndef _RHEOLEF_HAVE_MPI
44 dis_size1 = loc_size1;
46 dis_size1 = mpi::all_reduce (
_comm, loc_size1, std::plus<size_type>());
51#ifndef _RHEOLEF_HAVE_MPI
71 check_macro (dis_size1 !=
decide,
"both dis_size and local size are indetermined");
81 mpi::all_gather (comm1, loc_size1,
begin().operator->()+1);
95 resize(dis_size1, comm1, loc_size1);
99 _comm(ownership.comm())
110 if (
is_owned (dis_i, iproc))
return iproc;
116 iproc = (
operator[] (iproc1) == dis_i) ? iproc1 : iproc1 - 1;
131#ifdef _RHEOLEF_HAVE_MPI
135 static const int min_tag = 0;
136 static const int max_tag = mpi::environment::max_tag();
137 static int cur_tag = min_tag;
139 if (cur_tag > max_tag) cur_tag = min_tag;
see the distributor page for the full documentation
size_type last_index() const
size_type n_process() const
number of processes
size_type find_owner(size_type dis_i) const
find iproc associated to a global index dis_i: CPU=log(nproc)
void resize(size_type dis_size=0, const communicator_type &c=communicator_type(), size_type loc_size=decide)
size_type dis_size() const
global and local sizes
communicator communicator_type
static tag_type get_new_tag()
returns a new tag
size_type first_index() const
global index range and local size owned by current process
_base::const_iterator const_iterator
bool is_owned(size_type dis_i, size_type iproc) const
true when dis_i in [first_index(iproc):last_index(iproc)[
static const size_type decide
distributor(size_type dis_size=0, const communicator_type &c=communicator_type(), size_type loc_size=decide)
std::allocator< int >::size_type size_type
const communicator_type & comm() const
#define error_macro(message)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
const_reference at(size_type n) const
const_reference operator[](size_type n) const
void resize(size_type sz, T v=T())