From 7b4142e9b6a95151460dcb088bfd5829effeb424 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Mon, 7 Sep 2020 15:05:02 +0200 Subject: [PATCH] adding timing for the well assembly And changes the indentation of the linear solver setup time a little to show it is part of the linear solve time. --- opm/simulators/timestepping/SimulatorReport.cpp | 12 +++++++++++- opm/simulators/timestepping/SimulatorReport.hpp | 1 + opm/simulators/wells/BlackoilWellModel_impl.hpp | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/opm/simulators/timestepping/SimulatorReport.cpp b/opm/simulators/timestepping/SimulatorReport.cpp index 9c73a816a..57c646318 100644 --- a/opm/simulators/timestepping/SimulatorReport.cpp +++ b/opm/simulators/timestepping/SimulatorReport.cpp @@ -35,6 +35,7 @@ namespace Opm total_time(0.0), solver_time(0.0), assemble_time(0.0), + assemble_time_well(0.0), linear_solve_setup_time(0.0), linear_solve_time(0.0), update_time(0.0), @@ -58,6 +59,7 @@ namespace Opm linear_solve_time += sr.linear_solve_time; solver_time += sr.solver_time; assemble_time += sr.assemble_time; + assemble_time_well += sr.assemble_time_well; update_time += sr.update_time; output_write_time += sr.output_write_time; total_time += sr.total_time; @@ -101,6 +103,14 @@ namespace Opm } os << std::endl; + t = assemble_time_well + (failureReport ? failureReport->assemble_time_well : 0.0); + os << " Well assembly time (seconds): " << t; + if (failureReport) { + os << " (Failed: " << failureReport->assemble_time_well << "; " + << 100*failureReport->assemble_time_well/t << "%)"; + } + os << std::endl; + t = linear_solve_time + (failureReport ? failureReport->linear_solve_time : 0.0); os << " Linear solve time (seconds): " << t; if (failureReport) { @@ -110,7 +120,7 @@ namespace Opm os << std::endl; t = linear_solve_setup_time + (failureReport ? failureReport->linear_solve_setup_time : 0.0); - os << " Linear solve setup time (seconds): " << t; + os << " Linear solve setup time (seconds): " << t; if (failureReport) { os << " (Failed: " << failureReport->linear_solve_setup_time << "; " << 100*failureReport->linear_solve_setup_time/t << "%)"; diff --git a/opm/simulators/timestepping/SimulatorReport.hpp b/opm/simulators/timestepping/SimulatorReport.hpp index 46497558d..b505a8fd3 100644 --- a/opm/simulators/timestepping/SimulatorReport.hpp +++ b/opm/simulators/timestepping/SimulatorReport.hpp @@ -34,6 +34,7 @@ namespace Opm double total_time; double solver_time; double assemble_time; + double assemble_time_well; double linear_solve_setup_time; double linear_solve_time; double update_time; diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 8d25e5df1..964bbdd95 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -809,6 +809,8 @@ namespace Opm { { last_report_ = SimulatorReportSingle(); + Dune::Timer perfTimer; + perfTimer.start(); if ( ! wellsActive() ) { return; @@ -857,6 +859,7 @@ namespace Opm { logAndCheckForExceptionsAndThrow(local_deferredLogger, exception_thrown, "assemble() failed.", terminal_output_); last_report_.converged = true; + last_report_.assemble_time_well += perfTimer.stop(); } template