From 771217689609c434b69771ecb8ffd7bbeda4153b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 29 Jun 2019 11:24:10 +0200 Subject: egs: sync the residual maximum across components. --- ell_grid_solve.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ell_grid_solve.c') 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; } -- cgit v1.2.3