20 #ifndef MESH_PARTITION_HH_
21 #define MESH_PARTITION_HH_
109 inline unsigned int begin(
int proc)
const {
return (
starts[proc]);}
112 inline unsigned int end(
int proc)
const {
return (
starts[proc+1]);}
113 inline unsigned int end()
const {
return (
end(
myp()) );}
121 inline bool is_on_proc(
unsigned int idx,
unsigned int proc)
const {
return (
begin(proc)<=(idx) && (idx)<
end(proc) );}
123 unsigned int get_proc(
unsigned int idx)
const;
131 void view(std::ostream &stream)
const;
147 { distr.
view(stream);
return stream; }
DistributionType(int type)
const unsigned int * get_lsizes_array()
get local sizes array
bool is_local(unsigned int idx) const
identify local index
unsigned int * starts
starts[i] index of the first index on the proc i; starts[n_procs]=size of whole array
const unsigned int * get_starts_array() const
get local starts array
unsigned int myp() const
get my processor
bool is_on_proc(unsigned int idx, unsigned int proc) const
int num_of_procs
number of procs
Distribution(const unsigned int size, MPI_Comm comm)
unsigned int begin(int proc) const
get starting local index
unsigned int * lsizes
local sizes
unsigned int end(int proc) const
get last local index +1
void view(std::ostream &stream) const
distribution view
unsigned int lsize(int proc) const
get local size
unsigned int get_proc(unsigned int idx) const
get processor of the given index
unsigned int lsize() const
MPI_Comm get_comm() const
Returns communicator.
unsigned int size() const
get global size
unsigned int np() const
get num of processors
int my_proc
my proc number
const MPI_Comm communicator
communicator
unsigned int begin() const
std::ostream & operator<<(std::ostream &stream, const Distribution &distr)