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