Skip to content
Snippets Groups Projects
Commit 0058a250 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Added missing timers to tnlSemiImplicitTimeStepper

parent 9d271153
No related branches found
No related tags found
No related merge requests found
......@@ -286,11 +286,8 @@ getTimeStepOrder() const
return this->timeStepOrder;
}
template< typename Problem,
typename TimeStepper >
void
tnlPDESolver< Problem, TimeStepper >::
setIoRtTimer( tnlTimerRT& ioRtTimer )
template< typename Problem, typename TimeStepper >
void tnlPDESolver< Problem, TimeStepper > :: setIoRtTimer( tnlTimerRT& ioRtTimer )
{
this->ioRtTimer = &ioRtTimer;
}
......@@ -332,12 +329,22 @@ solve()
IndexType step( 0 );
IndexType allSteps = ceil( ( this->finalTime - this->initialTime ) / this->snapshotPeriod );
this->ioRtTimer->start();
this->ioCpuTimer->start();
this->computeRtTimer->stop();
this->computeCpuTimer->stop();
if( ! this->problem->makeSnapshot( t, step, mesh, this->dofs, this->meshDependentData ) )
{
cerr << "Making the snapshot failed." << endl;
return false;
}
this->ioRtTimer->stop();
this->ioCpuTimer->stop();
this->computeRtTimer->start();
this->computeCpuTimer->start();
/****
* Initialize the time stepper
*/
......@@ -364,10 +371,10 @@ solve()
return false;
}
this-> ioRtTimer->stop();
this-> ioCpuTimer->stop();
this-> computeRtTimer->start();
this-> computeCpuTimer->start();
this->ioRtTimer->stop();
this->ioCpuTimer->stop();
this->computeRtTimer->start();
this->computeCpuTimer->start();
}
return true;
}
......
......@@ -79,7 +79,7 @@ class tnlSemiImplicitTimeStepper
RealType timeStep;
tnlTimerRT linearSystemAssemblerTimer, linearSystemSolverTimer;
tnlTimerRT preIterateTimer, linearSystemAssemblerTimer, linearSystemSolverTimer, postIterateTimer;
bool verbose;
};
......
......@@ -145,6 +145,7 @@ solve( const RealType& time,
{
RealType currentTau = Min( this->timeStep, stopTime - t );
this->preIterateTimer.start();
if( ! this->problem->preIterate( t,
currentTau,
mesh,
......@@ -154,8 +155,11 @@ solve( const RealType& time,
cerr << endl << "Preiteration failed." << endl;
return false;
}
this->preIterateTimer.stop();
if( verbose )
cout << " Assembling the linear system ... \r" << flush;
this->linearSystemAssemblerTimer.start();
this->problem->assemblyLinearSystem( t,
currentTau,
......@@ -165,8 +169,10 @@ solve( const RealType& time,
this->rightHandSide,
meshDependentData );
this->linearSystemAssemblerTimer.stop();
if( verbose )
cout << " Solving the linear system for time " << t << " \r" << flush;
this->linearSystemSolverTimer.start();
if( ! this->linearSystemSolver->template solve< DofVectorType, tnlLinearResidueGetter< MatrixType, DofVectorType > >( this->rightHandSide, dofVector ) )
{
......@@ -174,8 +180,11 @@ solve( const RealType& time,
return false;
}
this->linearSystemSolverTimer.stop();
//if( verbose )
// cout << endl;
this->postIterateTimer.start();
if( ! this->problem->postIterate( t,
currentTau,
mesh,
......@@ -185,6 +194,8 @@ solve( const RealType& time,
cerr << endl << "Postiteration failed." << endl;
return false;
}
this->postIterateTimer.stop();
t += currentTau;
}
return true;
......@@ -196,8 +207,10 @@ bool
tnlSemiImplicitTimeStepper< Problem, LinearSystemSolver >::
writeEpilog( tnlLogger& logger )
{
logger.writeParameter< double >( "Pre-iterate time:", this->preIterateTimer.getTime() );
logger.writeParameter< double >( "Linear system assembler time:", this->linearSystemAssemblerTimer.getTime() );
logger.writeParameter< double >( "Linear system solver time:", this->linearSystemSolverTimer.getTime() );
logger.writeParameter< double >( "Post-iterate time:", this->postIterateTimer.getTime() );
return true;
}
......
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