Skip to content
Snippets Groups Projects
Commit 15657dd7 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

[bugfix] Distribute norm of correction to all processors for the stopping criterion

[[Imported from SVN: r9881]]
parent 4256f923
No related branches found
No related tags found
No related merge requests found
...@@ -378,6 +378,10 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve() ...@@ -378,6 +378,10 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
corr = vectorComm.scatter(corr_global); corr = vectorComm.scatter(corr_global);
// Make infinity norm of corr_global known on all processors
double corrNorm = corr.infinity_norm();
double corrGlobalInfinityNorm = mpiHelper.getCollectiveCommunication().max(corrNorm);
if (instrumented_) { if (instrumented_) {
fprintf(fp, "Trust-region step: %d, trust-region radius: %g\n", fprintf(fp, "Trust-region step: %d, trust-region radius: %g\n",
...@@ -449,7 +453,7 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve() ...@@ -449,7 +453,7 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
if (this->verbosity_ == NumProc::FULL) if (this->verbosity_ == NumProc::FULL)
std::cout << "Infinity norm of the correction: " << corr.infinity_norm() << std::endl; std::cout << "Infinity norm of the correction: " << corr.infinity_norm() << std::endl;
if (corr_global.infinity_norm() < this->tolerance_) { if (corrGlobalInfinityNorm < this->tolerance_) {
if (this->verbosity_ == NumProc::FULL and rank==0) if (this->verbosity_ == NumProc::FULL and rank==0)
std::cout << "CORRECTION IS SMALL ENOUGH" << std::endl; std::cout << "CORRECTION IS SMALL ENOUGH" << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment