Loading src/solvers/pde/tnlPDESolver_impl.h +16 −9 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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 */ Loading src/solvers/pde/tnlSemiImplicitTimeStepper.h +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ class tnlSemiImplicitTimeStepper RealType timeStep; tnlTimerRT linearSystemAssemblerTimer, linearSystemSolverTimer; tnlTimerRT preIterateTimer, linearSystemAssemblerTimer, linearSystemSolverTimer, postIterateTimer; bool verbose; }; Loading src/solvers/pde/tnlSemiImplicitTimeStepper_impl.h +13 −0 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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, Loading @@ -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 ) ) { Loading @@ -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, Loading @@ -185,6 +194,8 @@ solve( const RealType& time, cerr << endl << "Postiteration failed." << endl; return false; } this->postIterateTimer.stop(); t += currentTau; } return true; Loading @@ -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; } Loading Loading
src/solvers/pde/tnlPDESolver_impl.h +16 −9 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading @@ -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 */ Loading
src/solvers/pde/tnlSemiImplicitTimeStepper.h +1 −1 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ class tnlSemiImplicitTimeStepper RealType timeStep; tnlTimerRT linearSystemAssemblerTimer, linearSystemSolverTimer; tnlTimerRT preIterateTimer, linearSystemAssemblerTimer, linearSystemSolverTimer, postIterateTimer; bool verbose; }; Loading
src/solvers/pde/tnlSemiImplicitTimeStepper_impl.h +13 −0 Original line number Diff line number Diff line Loading @@ -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, Loading @@ -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, Loading @@ -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 ) ) { Loading @@ -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, Loading @@ -185,6 +194,8 @@ solve( const RealType& time, cerr << endl << "Postiteration failed." << endl; return false; } this->postIterateTimer.stop(); t += currentTau; } return true; Loading @@ -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; } Loading