diff --git a/AMDiS/src/AdaptInfo.h b/AMDiS/src/AdaptInfo.h index eb095322a6f8b07ca610f75b554f81092986faea..66bc9339a9476f3cb49f355940694f8af1078b5e 100644 --- a/AMDiS/src/AdaptInfo.h +++ b/AMDiS/src/AdaptInfo.h @@ -389,12 +389,24 @@ namespace AMDiS { /// Sets \ref est_sum. inline void setEstSum(double e, int index) { +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS + double send_est_sum = e; + double est_sum = 0.0; + MPI::COMM_WORLD.Allreduce(&send_est_sum, &est_sum, 1, MPI_DOUBLE, MPI_SUM); + e = est_sum; +#endif scalContents[index]->est_sum = e; } /// Sets \ref est_max. inline void setEstMax(double e, int index) { +#ifdef HAVE_PARALLEL_DOMAIN_AMDIS + double send_est_max = e; + double est_max = 0.0; + MPI::COMM_WORLD.Allreduce(&send_est_max, &est_max, 1, MPI_DOUBLE, MPI_MAX); + e = est_max; +#endif scalContents[index]->est_max = e; }