From 26f14d7dd760d35de3a327f4102cf54685e50d5c Mon Sep 17 00:00:00 2001 From: Daniel Richtmann Date: Thu, 11 Jan 2018 13:36:30 +0100 Subject: [PATCH] Adapt output format of non-herm solvers to the one of VPGCR --- ...cationAvoidingGeneralisedMinimalResidual.h | 19 ++++++++--------- ...cationAvoidingGeneralisedMinimalResidual.h | 21 +++++++++---------- .../FlexibleGeneralisedMinimalResidual.h | 21 +++++++++---------- .../iterative/GeneralisedMinimalResidual.h | 19 ++++++++--------- lib/algorithms/iterative/MinimalResidual.h | 15 +++++++------ 5 files changed, 45 insertions(+), 50 deletions(-) diff --git a/lib/algorithms/iterative/CommunicationAvoidingGeneralisedMinimalResidual.h b/lib/algorithms/iterative/CommunicationAvoidingGeneralisedMinimalResidual.h index 84c00a99..d6a1ca12 100644 --- a/lib/algorithms/iterative/CommunicationAvoidingGeneralisedMinimalResidual.h +++ b/lib/algorithms/iterative/CommunicationAvoidingGeneralisedMinimalResidual.h @@ -113,17 +113,16 @@ class CommunicationAvoidingGeneralisedMinimalResidual : public OperatorFunction< RealD resnorm = sqrt(norm2(r)); RealD true_residual = resnorm / srcnorm; - std::cout << GridLogMessage << "CommunicationAvoidingGeneralisedMinimalResidual: Converged on iteration " << IterationCount << std::endl; - std::cout << GridLogMessage << "\tComputed residual " << sqrt(cp / ssq) << std::endl; - std::cout << GridLogMessage << "\tTrue residual " << true_residual << std::endl; - std::cout << GridLogMessage << "\tTarget " << Tolerance << std::endl; + std::cout << GridLogMessage << "CommunicationAvoidingGeneralisedMinimalResidual: Converged on iteration " << IterationCount + << " computed residual " << sqrt(cp / ssq) + << " true residual " << true_residual + << " target " << Tolerance << std::endl; - std::cout << GridLogMessage << "CommunicationAvoidingGeneralisedMinimalResidual Time breakdown" << std::endl; - std::cout << GridLogMessage << "\tElapsed " << SolverTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tMatrix " << MatrixTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tLinalg " << LinalgTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tQR " << QrTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tCompSol " << CompSolutionTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "CAGMRES Time elapsed: Total " << SolverTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "CAGMRES Time elapsed: Matrix " << MatrixTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "CAGMRES Time elapsed: Linalg " << LinalgTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "CAGMRES Time elapsed: QR " << QrTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "CAGMRES Time elapsed: CompSol " << CompSolutionTimer.Elapsed() << std::endl; return; } } diff --git a/lib/algorithms/iterative/FlexibleCommunicationAvoidingGeneralisedMinimalResidual.h b/lib/algorithms/iterative/FlexibleCommunicationAvoidingGeneralisedMinimalResidual.h index b9a4b475..8c36597b 100644 --- a/lib/algorithms/iterative/FlexibleCommunicationAvoidingGeneralisedMinimalResidual.h +++ b/lib/algorithms/iterative/FlexibleCommunicationAvoidingGeneralisedMinimalResidual.h @@ -119,18 +119,17 @@ class FlexibleCommunicationAvoidingGeneralisedMinimalResidual : public OperatorF RealD resnorm = sqrt(norm2(r)); RealD true_residual = resnorm / srcnorm; - std::cout << GridLogMessage << "FlexibleCommunicationAvoidingGeneralisedMinimalResidual: Converged on iteration " << IterationCount << std::endl; - std::cout << GridLogMessage << "\tComputed residual " << sqrt(cp / ssq) << std::endl; - std::cout << GridLogMessage << "\tTrue residual " << true_residual << std::endl; - std::cout << GridLogMessage << "\tTarget " << Tolerance << std::endl; + std::cout << GridLogMessage << "FlexibleCommunicationAvoidingGeneralisedMinimalResidual: Converged on iteration " << IterationCount + << " computed residual " << sqrt(cp / ssq) + << " true residual " << true_residual + << " target " << Tolerance << std::endl; - std::cout << GridLogMessage << "FlexibleCommunicationAvoidingGeneralisedMinimalResidual Time breakdown" << std::endl; - std::cout << GridLogMessage << "\tElapsed " << SolverTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tPrecon " << PrecTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tMatrix " << MatrixTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tLinalg " << LinalgTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tQR " << QrTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tCompSol " << CompSolutionTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FCAGMRES Time elapsed: Total " << SolverTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FCAGMRES Time elapsed: Precon " << PrecTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FCAGMRES Time elapsed: Matrix " << MatrixTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FCAGMRES Time elapsed: Linalg " << LinalgTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FCAGMRES Time elapsed: QR " << QrTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FCAGMRES Time elapsed: CompSol " << CompSolutionTimer.Elapsed() << std::endl; return; } } diff --git a/lib/algorithms/iterative/FlexibleGeneralisedMinimalResidual.h b/lib/algorithms/iterative/FlexibleGeneralisedMinimalResidual.h index c574d86f..84956aed 100644 --- a/lib/algorithms/iterative/FlexibleGeneralisedMinimalResidual.h +++ b/lib/algorithms/iterative/FlexibleGeneralisedMinimalResidual.h @@ -119,18 +119,17 @@ class FlexibleGeneralisedMinimalResidual : public OperatorFunction { RealD resnorm = sqrt(norm2(r)); RealD true_residual = resnorm / srcnorm; - std::cout << GridLogMessage << "FlexibleGeneralisedMinimalResidual: Converged on iteration " << IterationCount << std::endl; - std::cout << GridLogMessage << "\tComputed residual " << sqrt(cp / ssq) << std::endl; - std::cout << GridLogMessage << "\tTrue residual " << true_residual << std::endl; - std::cout << GridLogMessage << "\tTarget " << Tolerance << std::endl; + std::cout << GridLogMessage << "FlexibleGeneralisedMinimalResidual: Converged on iteration " << IterationCount + << " computed residual " << sqrt(cp / ssq) + << " true residual " << true_residual + << " target " << Tolerance << std::endl; - std::cout << GridLogMessage << "FlexibleGeneralisedMinimalResidual Time breakdown" << std::endl; - std::cout << GridLogMessage << "\tElapsed " << SolverTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tPrecon " << PrecTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tMatrix " << MatrixTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tLinalg " << LinalgTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tQR " << QrTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tCompSol " << CompSolutionTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FGMRES Time elapsed: Total " << SolverTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FGMRES Time elapsed: Precon " << PrecTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FGMRES Time elapsed: Matrix " << MatrixTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FGMRES Time elapsed: Linalg " << LinalgTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FGMRES Time elapsed: QR " << QrTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "FGMRES Time elapsed: CompSol " << CompSolutionTimer.Elapsed() << std::endl; return; } } diff --git a/lib/algorithms/iterative/GeneralisedMinimalResidual.h b/lib/algorithms/iterative/GeneralisedMinimalResidual.h index a6e7aadc..0e6d4be4 100644 --- a/lib/algorithms/iterative/GeneralisedMinimalResidual.h +++ b/lib/algorithms/iterative/GeneralisedMinimalResidual.h @@ -113,17 +113,16 @@ class GeneralisedMinimalResidual : public OperatorFunction { RealD resnorm = sqrt(norm2(r)); RealD true_residual = resnorm / srcnorm; - std::cout << GridLogMessage << "GeneralisedMinimalResidual: Converged on iteration " << IterationCount << std::endl; - std::cout << GridLogMessage << "\tComputed residual " << sqrt(cp / ssq) << std::endl; - std::cout << GridLogMessage << "\tTrue residual " << true_residual << std::endl; - std::cout << GridLogMessage << "\tTarget " << Tolerance << std::endl; + std::cout << GridLogMessage << "GeneralisedMinimalResidual: Converged on iteration " << IterationCount + << " computed residual " << sqrt(cp / ssq) + << " true residual " << true_residual + << " target " << Tolerance << std::endl; - std::cout << GridLogMessage << "GeneralisedMinimalResidual Time breakdown" << std::endl; - std::cout << GridLogMessage << "\tElapsed " << SolverTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tMatrix " << MatrixTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tLinalg " << LinalgTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tQR " << QrTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tCompSol " << CompSolutionTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "GMRES Time elapsed: Total " << SolverTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "GMRES Time elapsed: Matrix " << MatrixTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "GMRES Time elapsed: Linalg " << LinalgTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "GMRES Time elapsed: QR " << QrTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "GMRES Time elapsed: CompSol " << CompSolutionTimer.Elapsed() << std::endl; return; } } diff --git a/lib/algorithms/iterative/MinimalResidual.h b/lib/algorithms/iterative/MinimalResidual.h index b2651285..ee2f208b 100644 --- a/lib/algorithms/iterative/MinimalResidual.h +++ b/lib/algorithms/iterative/MinimalResidual.h @@ -129,15 +129,14 @@ template class MinimalResidual : public OperatorFunction { RealD resnorm = sqrt(norm2(r)); RealD true_residual = resnorm / srcnorm; - std::cout << GridLogMessage << "MinimalResidual Converged on iteration " << k << std::endl; - std::cout << GridLogMessage << "\tComputed residual " << sqrt(cp / ssq) << std::endl; - std::cout << GridLogMessage << "\tTrue residual " << true_residual << std::endl; - std::cout << GridLogMessage << "\tTarget " << Tolerance << std::endl; + std::cout << GridLogMessage << "MinimalResidual Converged on iteration " << k + << " computed residual " << sqrt(cp / ssq) + << " true residual " << true_residual + << " target " << Tolerance << std::endl; - std::cout << GridLogMessage << "Time breakdown " << std::endl; - std::cout << GridLogMessage << "\tElapsed " << SolverTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tMatrix " << MatrixTimer.Elapsed() << std::endl; - std::cout << GridLogMessage << "\tLinalg " << LinalgTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "MR Time elapsed: Total " << SolverTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "MR Time elapsed: Matrix " << MatrixTimer.Elapsed() << std::endl; + std::cout << GridLogMessage << "MR Time elapsed: Linalg " << LinalgTimer.Elapsed() << std::endl; if (ErrorOnNoConverge) assert(true_residual / Tolerance < 10000.0);