* accumulated. The usage of this class is also explained in the step-28,
* step-29 and step-30 tutorial programs.
*
- * @note Implementation of this class is system dependent. In case
- * multithreaded routines (matrix-vector products, error estimators, etc.) are
- * used, the CPU time is accumulated from all the children.
+ * @note Implementation of this class is system dependent. In particular, CPU
+ * times are accumulated from summing across all threads and will usually
+ * exceed the wall times.
*
* @ingroup utilities
* @author G. Kanschat, W. Bangerth, M. Kronbichler
*/
double start_time;
-
- /**
- * Similar to #start_time, but needed for children threads in multithread
- * mode. Value of the user time when start() was called the last time or
- * when the object was created and no stop() was issued in between.
- *
- * For some reason (error in operating system?) the function call
- * <tt>getrusage(RUSAGE_CHILDREN,.)</tt> gives always 0 (at least on
- * Solaris7). Hence the Timer class still does not yet work for
- * multithreading mode.
- */
- double start_time_children;
-
/**
* Value of the wall time when start() was called the last time or when the
* object was created and no stop() was issued in between.
Timer::Timer()
:
start_time (0.),
- start_time_children (0.),
start_wall_time (0.),
cumulative_time (0.),
cumulative_wall_time (0.),
const bool sync_wall_time_)
:
start_time (0.),
- start_time_children (0.),
start_wall_time (0.),
cumulative_time (0.),
cumulative_wall_time (0.),
getrusage (RUSAGE_SELF, &usage);
start_time = usage.ru_utime.tv_sec + 1.e-6 * usage.ru_utime.tv_usec;
- rusage usage_children;
- getrusage (RUSAGE_CHILDREN, &usage_children);
- start_time_children = usage_children.ru_utime.tv_sec + 1.e-6 * usage_children.ru_utime.tv_usec;
-
#elif defined(DEAL_II_MSVC)
start_wall_time = windows::wall_clock();
start_time = windows::cpu_clock();
- start_time_children = start_time;
#else
# error Unsupported platform. Porting not finished.
#endif
const double dtime = usage.ru_utime.tv_sec + 1.e-6 * usage.ru_utime.tv_usec;
last_lap_cpu_time = dtime - start_time;
- rusage usage_children;
- getrusage (RUSAGE_CHILDREN, &usage_children);
- const double dtime_children =
- usage_children.ru_utime.tv_sec + 1.e-6 * usage_children.ru_utime.tv_usec;
- last_lap_cpu_time += dtime_children - start_time_children;
-
struct timeval wall_timer;
gettimeofday(&wall_timer, nullptr);
last_lap_time = wall_timer.tv_sec + 1.e-6 * wall_timer.tv_usec
rusage usage;
getrusage (RUSAGE_SELF, &usage);
const double dtime = usage.ru_utime.tv_sec + 1.e-6 * usage.ru_utime.tv_usec;
-
- rusage usage_children;
- getrusage (RUSAGE_CHILDREN, &usage_children);
- const double dtime_children =
- usage_children.ru_utime.tv_sec + 1.e-6 * usage_children.ru_utime.tv_usec;
-
- const double running_time = dtime - start_time + dtime_children
- - start_time_children + cumulative_time;
+ const double running_time = dtime - start_time + cumulative_time;
// in case of MPI, need to get the time passed by summing the time over
// all processes in the network. works also in case we just want to have