21#include <boost/format.hpp>
30 const std::string& title)
const {
32 double accounted = 0.0;
33 XTP_LOG(level, log) <<
" " << title <<
" (wall clock)" << std::flush;
34 XTP_LOG(level, log) << (boost::format(
" %-38s %7s %11s %10s %6s") %
"part" %
35 "calls" %
"time [s]" %
"per call" %
"%")
39 accounted +=
e.seconds;
40 XTP_LOG(level, log) << (boost::format(
" %-38s %7d %11.2f %10.3f %6.1f") %
41 e.name %
e.calls %
e.seconds %
42 (
e.seconds / double(
e.calls)) %
43 (total > 0 ? 100.0 *
e.seconds / total : 0.0))
47 XTP_LOG(level, log) << (boost::format(
" %-38s %7s %11.2f %10s %6.1f") %
48 "not itemised" %
"" % (total - accounted) %
"" %
49 (total > 0 ? 100.0 * (total - accounted) / total
54 << (boost::format(
" %-38s %7s %11.2f") %
"total" %
"" % total).str()
64 line += (boost::format(
"%s %.2f s") %
e.name %
e.seconds).str();
70 std::ifstream status(
"/proc/self/status");
71 if (!status.is_open()) {
74 const std::string key = peak ?
"VmHWM:" :
"VmRSS:";
76 while (status >> word) {
80 return kb / (1024.0 * 1024.0);
std::vector< Entry > entries_
void Report(Logger &log, Log::Level level, const std::string &title="DFT timing summary") const
Table of all entries with their share of the time since Reset().
static double ResidentMemoryGB(bool peak)
std::string Format() const
The entries on one line, "name 1.23 s, name 4.56 s".
Logger is used for thread-safe output of messages.
#define XTP_LOG(level, log)
Charge transport classes.
Provides a means for comparing floating point numbers.