Skip to content
Snippets Groups Projects
Verified Commit fdee4ba2 authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

use `getCommunication()` instead of `getCollectiveCommunication()`

parent 85d9e20b
No related branches found
No related tags found
1 merge request!104use `getCommunication()` instead of `getCollectiveCommunication()`
......@@ -86,7 +86,7 @@ energy(const typename Basis::LocalView& localView,
const std::vector<TargetSpace0>& localConfiguration0,
const std::vector<TargetSpace1>& localConfiguration1) const
{
int rank = Dune::MPIHelper::getCollectiveCommunication().rank();
int rank = Dune::MPIHelper::getCommunication().rank();
double pureEnergy;
std::vector<ATargetSpace0> localAConfiguration0(localConfiguration0.size());
......@@ -202,7 +202,7 @@ assembleGradientAndHessian(const typename Basis::LocalView& localView,
std::vector<typename TargetSpace0::TangentVector>& localGradient0,
std::vector<typename TargetSpace1::TangentVector>& localGradient1)
{
int rank = Dune::MPIHelper::getCollectiveCommunication().rank();
int rank = Dune::MPIHelper::getCommunication().rank();
// Tape energy computation. We may not have to do this every time, but it's comparatively cheap.
energy(localView, localConfiguration0, localConfiguration1);
......
......@@ -317,7 +317,7 @@ void MixedRiemannianTrustRegionSolver<GridType,Basis,Basis0,TargetSpace0,Basis1,
using namespace Dune::TypeTree::Indices;
double oldEnergy = assembler_->computeEnergy(x_[_0], x_[_1]);
oldEnergy = mpiHelper.getCollectiveCommunication().sum(oldEnergy);
oldEnergy = mpiHelper.getCommunication().sum(oldEnergy);
bool recomputeGradientHessian = true;
CorrectionType rhs;
......@@ -498,7 +498,7 @@ void MixedRiemannianTrustRegionSolver<GridType,Basis,Basis0,TargetSpace0,Basis1,
}
if (solvedByInnerSolver) {
energy = mpiHelper.getCollectiveCommunication().sum(energy);
energy = mpiHelper.getCommunication().sum(energy);
// compute the model decrease
// It is $ m(x) - m(x+s) = -<g,s> - 0.5 <s, Hs>
......@@ -506,7 +506,7 @@ void MixedRiemannianTrustRegionSolver<GridType,Basis,Basis0,TargetSpace0,Basis1,
CorrectionType tmp(corr);
hessianMatrix_->mv(corr,tmp);
modelDecrease = rhs*corr - 0.5 * (corr*tmp);
modelDecrease = mpiHelper.getCollectiveCommunication().sum(modelDecrease);
modelDecrease = mpiHelper.getCommunication().sum(modelDecrease);
double relativeModelDecrease = modelDecrease / std::fabs(energy);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment