20 #ifndef MESH_PARTITION_HH_ 21 #define MESH_PARTITION_HH_ 105 inline unsigned int np()
const {
return num_of_procs;}
107 inline unsigned int myp()
const {
return my_proc;}
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()) );}
115 inline unsigned int lsize(
int proc)
const {
return (end(proc)-begin(proc));}
118 inline unsigned int size()
const {
return (starts[np()]);}
120 inline bool is_local(
unsigned int idx)
const {
return ( begin()<=(idx) && (idx)<end() );}
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;
125 const unsigned int * get_lsizes_array();
127 const unsigned int * get_starts_array()
const;
131 void view(std::ostream &stream)
const;
147 { distr.
view(stream);
return stream; }
151 #endif // MESH_PARTITION_HH_ unsigned int size() const
get global size
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
int num_of_procs
number of procs
unsigned int lsize() const
void view(std::ostream &stream) const
distribution view
bool is_local(unsigned int idx) const
identify local index
const MPI_Comm communicator
communicator
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