mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-01 21:39:09 -06:00
Added timing of prepare call for linear solvers
This commit is contained in:
parent
ed24b3fcad
commit
4f1603407d
@ -297,13 +297,15 @@ namespace Opm {
|
||||
// equations
|
||||
wellModel().linearize(ebosSimulator().model().linearizer().jacobian(),
|
||||
ebosSimulator().model().linearizer().residual());
|
||||
|
||||
linear_solve_setup_time_ = 0.0;
|
||||
try {
|
||||
solveJacobianSystem(x);
|
||||
report.linear_solve_setup_time += linear_solve_setup_time_;
|
||||
report.linear_solve_time += perfTimer.stop();
|
||||
report.total_linear_iterations += linearIterationsLastSolve();
|
||||
}
|
||||
catch (...) {
|
||||
report.linear_solve_setup_time += linear_solve_setup_time_;
|
||||
report.linear_solve_time += perfTimer.stop();
|
||||
report.total_linear_iterations += linearIterationsLastSolve();
|
||||
|
||||
@ -473,7 +475,10 @@ namespace Opm {
|
||||
x = 0.0;
|
||||
|
||||
auto& ebosSolver = ebosSimulator_.model().newtonMethod().linearSolver();
|
||||
Dune::Timer perfTimer;
|
||||
perfTimer.start();
|
||||
ebosSolver.prepare(ebosJac, ebosResid);
|
||||
linear_solve_setup_time_ = perfTimer.stop();
|
||||
ebosSolver.setResidual(ebosResid);
|
||||
// actually, the error needs to be calculated after setResidual in order to
|
||||
// account for parallelization properly. since the residual of ECFV
|
||||
@ -906,7 +911,7 @@ namespace Opm {
|
||||
double dsMax() const { return param_.ds_max_; }
|
||||
double drMaxRel() const { return param_.dr_max_rel_; }
|
||||
double maxResidualAllowed() const { return param_.max_residual_allowed_; }
|
||||
|
||||
double linear_solve_setup_time_;
|
||||
public:
|
||||
std::vector<bool> wasSwitched_;
|
||||
};
|
||||
|
@ -33,6 +33,7 @@ namespace Opm
|
||||
total_time(0.0),
|
||||
solver_time(0.0),
|
||||
assemble_time(0.0),
|
||||
linear_solve_setup_time(0.0),
|
||||
linear_solve_time(0.0),
|
||||
update_time(0.0),
|
||||
output_write_time(0.0),
|
||||
@ -49,6 +50,7 @@ namespace Opm
|
||||
{
|
||||
pressure_time += sr.pressure_time;
|
||||
transport_time += sr.transport_time;
|
||||
linear_solve_setup_time += sr.linear_solve_setup_time;
|
||||
linear_solve_time += sr.linear_solve_time;
|
||||
solver_time += sr.solver_time;
|
||||
assemble_time += sr.assemble_time;
|
||||
@ -119,6 +121,14 @@ 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;
|
||||
if (failureReport) {
|
||||
os << " (Failed: " << failureReport->linear_solve_setup_time << "; "
|
||||
<< 100*failureReport->linear_solve_setup_time/t << "%)";
|
||||
}
|
||||
os << std::endl;
|
||||
|
||||
t = update_time + (failureReport ? failureReport->update_time : 0.0);
|
||||
os << " Update time (seconds): " << t;
|
||||
if (failureReport) {
|
||||
|
@ -33,6 +33,7 @@ namespace Opm
|
||||
double total_time;
|
||||
double solver_time;
|
||||
double assemble_time;
|
||||
double linear_solve_setup_time;
|
||||
double linear_solve_time;
|
||||
double update_time;
|
||||
double output_write_time;
|
||||
|
Loading…
Reference in New Issue
Block a user