Commit cad8f18d authored by frey_m's avatar frey_m

use ippl reduce

parent 17f3dd09
...@@ -643,12 +643,12 @@ void MGPoissonSolver::printLoadBalanceStats() { ...@@ -643,12 +643,12 @@ void MGPoissonSolver::printLoadBalanceStats() {
imbalance += (NumPart - myNumPart) / NumPart; imbalance += (NumPart - myNumPart) / NumPart;
double max = 0.0, min = 0.0, avg = 0.0; double max = 0.0, min = 0.0, avg = 0.0;
int minn = 0, maxn = 0; size_t minn = 0, maxn = 0;
MPI_Reduce(&imbalance, &min, 1, MPI_DOUBLE, MPI_MIN, 0, Ippl::getComm()); reduce(imbalance, min, 1, std::less<double>());
MPI_Reduce(&imbalance, &max, 1, MPI_DOUBLE, MPI_MAX, 0, Ippl::getComm()); reduce(imbalance, max, 1, std::greater<double>());
MPI_Reduce(&imbalance, &avg, 1, MPI_DOUBLE, MPI_SUM, 0, Ippl::getComm()); reduce(imbalance, avg, 1, std::plus<double>());
MPI_Reduce(&myNumPart, &minn, 1, MPI_INT, MPI_MIN, 0, Ippl::getComm()); reduce(myNumPart, minn, 1, std::less<size_t>());
MPI_Reduce(&myNumPart, &maxn, 1, MPI_INT, MPI_MAX, 0, Ippl::getComm()); reduce(myNumPart, maxn, 1, std::greater<size_t>());
avg /= comm_mp->getSize(); avg /= comm_mp->getSize();
*gmsg << "LBAL min = " << min << ", max = " << max << ", avg = " << avg << endl; *gmsg << "LBAL min = " << min << ", max = " << max << ", avg = " << avg << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment