| 113 |
|
|
| 114 |
|
myComm.Allgather(&planSize_, 1, MPI::INT, &counts[0], 1, MPI::INT); |
| 115 |
|
|
| 116 |
+ |
|
| 117 |
|
displacements[0] = 0; |
| 118 |
|
for (int i = 1; i < nCommProcs; i++) { |
| 119 |
|
displacements[i] = displacements[i-1] + counts[i-1]; |
| 120 |
< |
} |
| 120 |
> |
size_ += count[i-1]; |
| 121 |
> |
} |
| 122 |
> |
|
| 123 |
> |
size_ = 0; |
| 124 |
> |
for (int i = 0; i < nCommProcs; i++) { |
| 125 |
> |
size_ += counts[i]; |
| 126 |
> |
} |
| 127 |
|
} |
| 128 |
|
|
| 129 |
|
|
| 145 |
|
myComm.Reduce_scatter(&v1[0], &v2[0], &counts[0], |
| 146 |
|
MPITraits<T>::datatype, MPI::SUM); |
| 147 |
|
} |
| 148 |
+ |
|
| 149 |
+ |
int getSize() { |
| 150 |
+ |
return size_; |
| 151 |
+ |
} |
| 152 |
|
|
| 153 |
|
private: |
| 154 |
|
int planSize_; ///< how many are on local proc |
| 155 |
|
int rowIndex_; |
| 156 |
|
int columnIndex_; |
| 157 |
+ |
int size_; |
| 158 |
|
std::vector<int> counts; |
| 159 |
|
std::vector<int> displacements; |
| 160 |
|
MPI::Intracomm myComm; |