Skip to content
Snippets Groups Projects
Commit 6c353008 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixed MLUPS printing out.

parent ac2693cf
No related branches found
No related tags found
No related merge requests found
......@@ -47,7 +47,8 @@ protected:
std::atomic_bool saved;
RealType time, saved_time, timeStep, saved_timeStep, residue, saved_residue, elapsed_time_before_refresh;
RealType time, saved_time, timeStep, saved_timeStep, residue, saved_residue, elapsed_time_before_refresh, last_mlups;
//TODO: Move MLUPS to LBM solver only i.e create solver monitor for LBM
IndexType iterations, saved_iterations, iterations_before_refresh;
......
......@@ -168,10 +168,18 @@ void IterativeSolverMonitor< Real, Index > :: refresh()
print_item( real_to_string( (saved) ? saved_residue : residue, 5 ), 12 );
}
if( nodesPerIteration ) {
if( nodesPerIteration ) // otherwise MLUPS: 0 is printed
{
const RealType mlups = nodesPerIteration * (iterations - iterations_before_refresh) / (getElapsedTime() - elapsed_time_before_refresh) * 1e-6;
//std::cerr << std::endl << " iterations - iterations_before_refresh = " << iterations - iterations_before_refresh
// << " getElapsedTime() - elapsed_time_before_refresh = " << getElapsedTime() - elapsed_time_before_refresh << std::endl;
print_item( " MLUPS:", 0 );
print_item( real_to_string( mlups, 5 ), 7 );
if( mlups > 0 )
{
print_item( real_to_string( mlups, 5 ), 7 );
last_mlups = mlups;
}
else print_item( real_to_string( last_mlups, 5 ), 7 );
}
iterations_before_refresh = iterations;
elapsed_time_before_refresh = getElapsedTime();
......
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