From 2a63f5e49f9a2d3f64550ac425e401e8bf901a85 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Tue, 13 May 2014 18:45:37 +0000 Subject: [PATCH] Distribute energy and model decrease over all processors [[Imported from SVN: r9723]] --- dune/gfe/riemanniantrsolver.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dune/gfe/riemanniantrsolver.cc b/dune/gfe/riemanniantrsolver.cc index 3853e7eb..ccfffd74 100644 --- a/dune/gfe/riemanniantrsolver.cc +++ b/dune/gfe/riemanniantrsolver.cc @@ -405,6 +405,7 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve() newIterate[j] = TargetSpace::exp(newIterate[j], corr[j]); double energy = assembler_->computeEnergy(newIterate); + energy = mpiHelper.getCollectiveCommunication().sum(energy); // compute the model decrease // It is $ m(x) - m(x+s) = -<g,s> - 0.5 <s, Hs> @@ -413,6 +414,7 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve() tmp = 0; hessianMatrix_->umv(corr, tmp); double modelDecrease = (rhs*corr) - 0.5 * (corr*tmp); + modelDecrease = mpiHelper.getCollectiveCommunication().sum(modelDecrease); double relativeModelDecrease = modelDecrease / std::fabs(energy); -- GitLab