31#include "../parallelization/mpi_structure.hpp"
72 void Initialize(
unsigned long global_count,
unsigned long offset,
bool isDisjoint =
false);
Helper class that provides the counts for each rank in a linear partitioning given the global count a...
Definition CLinearPartitioner.hpp:43
unsigned long GetCumulativeSizeBeforeRank(int rank) const
Get the cumulative size of all linear partitions before the current rank.
Definition CLinearPartitioner.hpp:107
unsigned long GetRankContainingIndex(unsigned long index) const
Get the rank that owns the index based on the linear partitioning.
Definition CLinearPartitioner.cpp:73
unsigned long GetLastIndexOnRank(int rank) const
Get the last index of the current rank's linear partition.
Definition CLinearPartitioner.hpp:93
void Initialize(unsigned long global_count, unsigned long offset, bool isDisjoint=false)
Initialize the CLinearPartitioner class.
Definition CLinearPartitioner.cpp:31
bool IndexBelongsToRank(unsigned long index, int rank) const
Checks if an index belongs to a rank.
Definition CLinearPartitioner.hpp:115
vector< unsigned long > firstIndex
Vector containing the first index on each rank due to a linear partitioning by global count.
Definition CLinearPartitioner.hpp:47
unsigned long GetFirstIndexOnRank(int rank) const
Get the first index of the current rank's linear partition.
Definition CLinearPartitioner.hpp:86
vector< unsigned long > cumulativeSizeBeforeRank
Vector containing the cumulative size of all linear partitions before the current rank.
Definition CLinearPartitioner.hpp:53
vector< unsigned long > sizeOnRank
Vector containing the total size of the current rank's linear partition.
Definition CLinearPartitioner.hpp:52
CLinearPartitioner(unsigned long global_count, unsigned long offset, bool isDisjoint=false)
Constructor of the CLinearPartitioner class, see Initialize.
Definition CLinearPartitioner.hpp:62
unsigned long GetSizeOnRank(int rank) const
Get the total size of the current rank's linear partition.
Definition CLinearPartitioner.hpp:100
CLinearPartitioner()=default
int size
MPI Size.
Definition CLinearPartitioner.hpp:45
vector< unsigned long > lastIndex
Vector containing the last index on each rank due to a linear partitioning by global count.
Definition CLinearPartitioner.hpp:49