diff --git a/include/ALL_Histogram.hpp b/include/ALL_Histogram.hpp index 82772601a325eb8d939c7ec9d45d2f7e2690fd52..0df5d17e25bfaa374215df01f2263622444122df 100644 --- a/include/ALL_Histogram.hpp +++ b/include/ALL_Histogram.hpp @@ -330,7 +330,7 @@ template <class T, class W> void Histogram_LB<T, W>::balance(int step) { int current_slice = 0; // size of one bin - T size = this->sysSize[2 * i + 1] / (T)work_collection.size(); + T size = (this->sysSize[2 * i + 1] - this->sysSize[2 * i]) / (T)work_collection.size(); // minimum size of one slice due to minimum domain width int minBinsPerSlice = ceil(this->minSize[i]/size); @@ -389,8 +389,8 @@ template <class T, class W> void Histogram_LB<T, W>::balance(int step) { this->prevVertices = this->vertices; - this->vertices.at(0)[i] = (T)down * size; - this->vertices.at(1)[i] = (T)up * size; + this->vertices.at(0)[i] = (T)down * size + this->sysSize[2 * i]; + this->vertices.at(1)[i] = (T)up * size + this->sysSize[2 * i]; // compute min / max work in current dimension MPI_Allreduce(work_new_dimension.data() + this->local_coords.at(i),