Flow123d
JS_before_hm-2115-gf629a871a
|
Go to the documentation of this file.
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; }
151 #endif // MESH_PARTITION_HH_
unsigned int np() const
get num of processors
unsigned int lsize() const
unsigned int lsize(int proc) const
get local size
unsigned int myp() const
get my processor
int my_proc
my proc number
DistributionType(int type)
unsigned int size() const
get global size
Distribution(const unsigned int size, MPI_Comm comm)
unsigned int end(int proc) const
get last local index +1
unsigned int * starts
starts[i] index of the first index on the proc i; starts[n_procs]=size of whole array
unsigned int get_proc(unsigned int idx) const
get processor of the given index
int num_of_procs
number of procs
const unsigned int * get_lsizes_array()
get local sizes array
unsigned int * lsizes
local sizes
const unsigned int * get_starts_array() const
get local starts array
const MPI_Comm communicator
communicator
unsigned int begin() const
bool is_on_proc(unsigned int idx, unsigned int proc) const
void view(std::ostream &stream) const
distribution view
std::ostream & operator<<(std::ostream &stream, const Distribution &distr)
MPI_Comm get_comm() const
Returns communicator.
bool is_local(unsigned int idx) const
identify local index
unsigned int begin(int proc) const
get starting local index