aboutsummaryrefslogtreecommitdiff
path: root/ell_grid_solve.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-06-29 11:24:10 +0200
committerAnton Khirnov <anton@khirnov.net>2019-06-29 11:24:10 +0200
commit771217689609c434b69771ecb8ffd7bbeda4153b (patch)
treef35e0304b2c6af442c6e3bf90cc1d65bbe045d86 /ell_grid_solve.c
parent60d1383db4d9f646ce5504edc9b2c437836696db (diff)
egs: sync the residual maximum across components.
Diffstat (limited to 'ell_grid_solve.c')
-rw-r--r--ell_grid_solve.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ell_grid_solve.c b/ell_grid_solve.c
index 97b8688..c3ce3a7 100644
--- a/ell_grid_solve.c
+++ b/ell_grid_solve.c
@@ -186,6 +186,13 @@ static void residual_calc(EGSContext *ctx, int export_res)
mg2di_timer_stop(&ctx->timer_res_calc);
+ if (priv->dg->nb_components > 1) {
+ mg2di_timer_start(&ctx->timer_mpi_sync);
+ MPI_Allreduce(MPI_IN_PLACE, &ctx->residual_max, 1,
+ MPI_DOUBLE, MPI_MAX, priv->comm);
+ mg2di_timer_stop(&ctx->timer_mpi_sync);
+ }
+
priv->reflect_skip = ~0;
}