Fix some #ifdef logic in the Timer class.
This fixes a bug due to rewritting an else statement where the 'else' was in an
'ifdef' and the body of the else statement (one line) was outside of it. This
caused, after a rewrite, the body of the former else statement to be executed
twice.
Before
9ef67983fd the end of this function was:
#ifdef DEAL_II_WITH_MPI
if (sync_wall_time && Utilities::MPI::job_supports_mpi())
{
this->mpi_data
= Utilities::MPI::min_max_avg (last_lap_time, mpi_communicator);
last_lap_time = this->mpi_data.max;
cumulative_wall_time += last_lap_time;
}
else
#endif
cumulative_wall_time += last_lap_time;
}
return cumulative_time;
where the 'else' statement was run unconditionally if MPI was not present. The
previous (prior to this patch) version was:
#ifdef DEAL_II_WITH_MPI
this->mpi_data = Utilities::MPI::min_max_avg (last_lap_time,
mpi_communicator);
if (sync_wall_time && Utilities::MPI::job_supports_mpi())
{
last_lap_time = this->mpi_data.max;
last_lap_cpu_time = Utilities::MPI::min_max_avg (last_lap_cpu_time,
mpi_communicator).max;
}
cumulative_wall_time += last_lap_time;
cumulative_time += last_lap_cpu_time;
this->mpi_total_data = Utilities::MPI::min_max_avg (cumulative_wall_time,
mpi_communicator);
#endif
cumulative_wall_time += last_lap_time;
cumulative_time += last_lap_cpu_time;
}
return cumulative_time;
which will, if MPI is available, double count both the cumulative wall time and
cummulative time.
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams