31#ifndef BITMAPCAROUSEL_H
32#define BITMAPCAROUSEL_H
41template <
class IT,
class NT>
48 my_procrow = commGrid->GetRankInProcCol();
49 my_proccol = commGrid->GetRankInProcRow();
50 procrows = commGrid->GetGridRows();
51 proccols = commGrid->GetGridCols();
58 sub_disps =
new int[proccols];
59 sub_disps[my_proccol] = local_subword_disp;
61 curr_subword_disp = local_subword_disp;
82 return rotlenuntil + local_size;
90 return bm->
get_bit(index - rotlenuntil + curr_subword_disp);
94 bm->
set_bit(index - rotlenuntil + curr_subword_disp);
100 local_size =
x.LocArrSize();
102 if (
it.GetValue() != -1)
103 bm->
set_bit(
it.GetLocIndex() + curr_subword_disp);
107 int curr_col = (my_proccol + rotation_index) % proccols;
114 if(my_procrow == procrows-1)
119 return ((
n_perprocrow * my_procrow)+(n_perproc*my_proccol));
123 int curr_col = (my_proccol + rotation_index) % proccols;
129 if (my_proccol == (proccols-1)) {
130 if (my_procrow == (procrows-1)) {
142 int source = (my_proccol+1) % proccols;
143 int dest = (my_proccol+(proccols-1)) % proccols;
144 rotation_index = (rotation_index + 1) % proccols;
145 long send_words = (local_size + 63 + curr_subword_disp)>>6;
155 std::swap(bm, recv_buff);
156 curr_subword_disp = sub_disps[(my_proccol+rotation_index)%proccols];
163 IT num_words = (local_size + 63 + curr_subword_disp) / 64;
174 std::shared_ptr<CommGrid> commGrid;
180 int curr_subword_disp;
IT SizeOfChunk(int my_procrow, int my_proccol) const
IT GetGlobalEndOfLocal(int col) const
IT GetGlobalStartOfLocal() const
IT GetGlobalStartOfLocal(int col) const
BitMapCarousel(std::shared_ptr< CommGrid > grid, IT glen, int local_subword_disp)
bool GetBit(IT index) const
IT RotLengthUntil(int my_procrow, int my_proccol) const
void UpdateFringe(BitMapFringe< IT, NT > &bm_fringe)
void LoadVec(FullyDistVec< IT, NT1 > &x)
IT GetGlobalEndOfLocal() const
bool get_bit(uint64_t pos)
void set_bit(uint64_t pos)
void copy_from(const BitMap *other)