Skip to content
Snippets Groups Projects

Feature/amalgamated

Closed Stephan Schulz requested to merge feature/amalgamated into refactor
5 files
+ 19
19
Compare changes
  • Side-by-side
  • Inline

Files

+ 6
5
@@ -288,7 +288,7 @@ public:
@@ -288,7 +288,7 @@ public:
void setup() {
void setup() {
try {
try {
balancer->setup();
balancer->setup();
} catch (CustomException e) {
} catch (CustomException &e) {
std::cout << e.what() << std::endl;
std::cout << e.what() << std::endl;
MPI_Abort(MPI_COMM_WORLD, -1);
MPI_Abort(MPI_COMM_WORLD, -1);
}
}
@@ -299,7 +299,7 @@ public:
@@ -299,7 +299,7 @@ public:
/// @param[in] internal toggles if internal steps are performed, needed
/// @param[in] internal toggles if internal steps are performed, needed
/// for some recursive calls of the routine by some methods
/// for some recursive calls of the routine by some methods
/// @result std::vector<ALL::Point<T>> containing the shifted set of vertices
/// @result std::vector<ALL::Point<T>> containing the shifted set of vertices
std::vector<Point<T>> &balance(const bool internal = false) {
std::vector<Point<T>> &balance() {
try {
try {
nVertices = balancer->getNVertices();
nVertices = balancer->getNVertices();
switch (method) {
switch (method) {
@@ -345,6 +345,7 @@ public:
@@ -345,6 +345,7 @@ public:
d_max = (double)(max_work) * (double)n_ranks / (double)sum_work - 1.0;
d_max = (double)(max_work) * (double)n_ranks / (double)sum_work - 1.0;
 
// internal needs to be readded to argument list const bool internal = false
for (int i = 0; i < estimation_limit && d_max > 0.1 && !internal; ++i)
for (int i = 0; i < estimation_limit && d_max > 0.1 && !internal; ++i)
{
{
balancer->setWork(tmp_work);
balancer->setWork(tmp_work);
@@ -396,7 +397,7 @@ public:
@@ -396,7 +397,7 @@ public:
"Unknown type of loadbalancing passed.");
"Unknown type of loadbalancing passed.");
}
}
loadbalancing_step++;
loadbalancing_step++;
} catch (CustomException e) {
} catch (CustomException &e) {
std::cout << e.what() << std::endl;
std::cout << e.what() << std::endl;
MPI_Abort(MPI_COMM_WORLD, -1);
MPI_Abort(MPI_COMM_WORLD, -1);
}
}
@@ -554,7 +555,7 @@ public:
@@ -554,7 +555,7 @@ public:
void setMinDomainSize(const std::vector<T> &minSize) {
void setMinDomainSize(const std::vector<T> &minSize) {
try {
try {
(balancer.get())->setMinDomainSize(minSize);
(balancer.get())->setMinDomainSize(minSize);
} catch (CustomException e) {
} catch (CustomException &e) {
std::cout << e.what() << std::endl;
std::cout << e.what() << std::endl;
MPI_Abort(MPI_COMM_WORLD, -1);
MPI_Abort(MPI_COMM_WORLD, -1);
}
}
@@ -885,7 +886,7 @@ private:
@@ -885,7 +886,7 @@ private:
}
}
// compare value of each outline point with all vertices to find the
// compare value of each outline point with all vertices to find the
// maximum extend of the domain in each dimension
// maximum extend of the domain in each dimension
for (int i = 1; i < balancer->getVertices().size(); ++i) {
for (int i = 1; i < (int)balancer->getVertices().size(); ++i) {
Point<T> p = balancer->getVertices().at(i);
Point<T> p = balancer->getVertices().at(i);
for (int j = 0; j < balancer->getDimension(); ++j) {
for (int j = 0; j < balancer->getDimension(); ++j) {
outline.at(0)[j] = std::min(outline.at(0)[j], p[j]);
outline.at(0)[j] = std::min(outline.at(0)[j], p[j]);
Loading