<h3>Specific improvements</h3>
<ol>
+<li> Fixed: One can compile deal.II with MPI support but run programs
+that aren't intended to use parallel communications and that, in fact,
+do not call <code>MPI_Init</code> at all. They are nevertheless supposed
+to work but previously the TimerOutput would crash under these conditions.
+This is now fixed.
+<br>
+(Timo Heister, Wolfgang Bangerth, 2012/09/18)
+
<li> Fixed: If you pipe content into the deallog object and there
is no end-line or flush after this content, and if a file stream
is associated to this object, and if that happens at the end of
{
FILETIME cpuTime, sysTime, createTime, exitTime;
if (GetProcessTimes(GetCurrentProcess(), &createTime,
- &exitTime, &sysTime, &cpuTime))
- {
- return (double)(((unsigned long long)cpuTime.dwHighDateTime << 32)
- | cpuTime.dwLowDateTime) / 1e6;
- }
+ &exitTime, &sysTime, &cpuTime))
+ {
+ return (double)(((unsigned long long)cpuTime.dwHighDateTime << 32)
+ | cpuTime.dwLowDateTime) / 1e6;
+ }
return 0;
}
}
struct timeval wall_timer;
gettimeofday(&wall_timer, NULL);
return (wall_timer.tv_sec
- + 1.e-6 * wall_timer.tv_usec
- - start_wall_time
- + cumulative_wall_time);
+ + 1.e-6 * wall_timer.tv_usec
+ - start_wall_time
+ + cumulative_wall_time);
#endif
}
else
// the Timers here according to that
double cpu_time = sections[actual_section_name].timer();
sections[actual_section_name].total_cpu_time
- += Utilities::MPI::sum (cpu_time, mpi_communicator);
+ += (Utilities::System::job_supports_mpi()
+ ?
+ Utilities::MPI::sum (cpu_time, mpi_communicator)
+ :
+ cpu_time);
// in case we have to print out
// something, do that here...
// in case we want to write CPU times
if (output_type != wall_times)
{
- double total_cpu_time = Utilities::MPI::sum (timer_all(),
- mpi_communicator);
+ double total_cpu_time = (Utilities::System::job_supports_mpi()
+ ?
+ Utilities::MPI::sum (timer_all(),
+ mpi_communicator)
+ :
+ timer_all());
// check that the sum of all times is
// less or equal than the total
//---------------------------- timer.cc ---------------------------
// $Id: timer.cc 23710 2011-05-17 04:50:10Z bangerth $
-// Version: $Name$
+// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2010 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2010, 2012 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
int main ()
{
- std::ofstream logfile("timer/output");
+ std::ofstream logfile("timer_02/output");
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
- TimerOutput t(std::cout, TimerOutput::summary, TimerOutput::cpu_times);
+ TimerOutput t(logfile, TimerOutput::summary, TimerOutput::cpu_times);
t.enter_subsection("hi");
t.leave_subsection("hi");
-DEAL::OK
-DEAL::OK
-DEAL::OK
-DEAL::OK
+
+
++---------------------------------------------+------------+------------+
+| Total CPU time elapsed since start | 0.00s | |
+| | | |
+| Section | no. calls | CPU time | % of total |
++---------------------------------+-----------+------------+------------+
+| hi | 1 | 0.00s | -nan% |
++---------------------------------+-----------+------------+------------+
+
+DEAL::ok
+
+
++---------------------------------------------+------------+------------+
+| Total CPU time elapsed since start | 0.00s | |
+| | | |
+| Section | no. calls | CPU time | % of total |
++---------------------------------+-----------+------------+------------+
+| hi | 1 | 0.00s | -nan% |
++---------------------------------+-----------+------------+------------+
+