13#include <boost/algorithm/string/predicate.hpp>
97 <<
"-----------------------------------------------------------------";
99 msg <<
" Timing results for " <<
Ippl::getNodes() <<
" nodes:" <<
"\n";
100 msg <<
"-----------------------------------------------------------------";
105 double walltotal = 0.0, cputotal = 0.0;
108 size_t lengthName =
std::min(tptr->
name.length(), 19lu);
109 msg << tptr->
name.substr(0,lengthName)
110 << std::string().assign(20 - lengthName,
'.')
111 <<
" Wall tot = " << std::setw(10) << walltotal <<
","
112 <<
" CPU tot = " << std::setw(10) << cputotal <<
"\n"
120 return boost::ilexicographical_compare(
a->name, b->name);
123 for (
unsigned int i=1; i <
TimerList.size(); ++i) {
125 double wallmax = 0.0, cpumax = 0.0, wallmin = 0.0, cpumin = 0.0;
126 double wallavg = 0.0, cpuavg = 0.0;
133 size_t lengthName =
std::min(tptr->
name.length(), 19lu);
135 msg << tptr->
name.substr(0,lengthName)
136 << std::string().assign(20 - lengthName,
'.')
137 <<
" Wall max = " << std::setw(10) << wallmax <<
","
138 <<
" CPU max = " << std::setw(10) << cpumax <<
"\n"
139 << std::string().assign(20,
' ')
140 <<
" Wall avg = " << std::setw(10) << wallavg /
Ippl::getNodes() <<
","
141 <<
" CPU avg = " << std::setw(10) << cpuavg /
Ippl::getNodes() <<
"\n"
142 << std::string().assign(20,
' ')
143 <<
" Wall min = " << std::setw(10) << wallmin <<
","
144 <<
" CPU min = " << std::setw(10) << cpumin <<
"\n"
147 msg <<
"-----------------------------------------------------------------";
153void Timing::print(
const std::string &fn,
const std::map<std::string, unsigned int> &problemSize) {
155 std::ofstream *timer_stream;
161 timer_stream =
new std::ofstream;
162 timer_stream->open( fn.c_str(), std::ios::out );
163 msg =
new Inform( 0, *timer_stream, 0 );
175 if (!problemSize.empty()) {
176 *msg <<
"Problem size:\n";
177 for (
auto it: problemSize) {
178 *msg <<
" " << std::setw(10) << it.first <<
": " << it.second <<
"\n";
183 *msg << std::setw(27) <<
"num Nodes"
184 << std::setw(10) <<
"CPU tot"
185 << std::setw(11) <<
"Wall tot\n"
186 << std::string().assign(47,
'=')
190 double walltotal = 0.0, cputotal = 0.0;
193 size_t lengthName =
std::min(tptr->
name.length(), 19lu);
194 *msg << tptr->
name.substr(0,lengthName);
195 for (
int j=lengthName; j < 20; ++j) {
199 <<
" " << std::setw(9) << std::setprecision(4) << cputotal
200 <<
" " << std::setw(9) << std::setprecision(4) << walltotal
208 return boost::ilexicographical_compare(
a->name, b->name);
212 << std::setw(27) <<
"num Nodes"
213 << std::setw(10) <<
"CPU max"
214 << std::setw(10) <<
"Wall max"
215 << std::setw(10) <<
"CPU min"
216 << std::setw(10) <<
"Wall min"
217 << std::setw(10) <<
"CPU avg"
218 << std::setw(11) <<
"Wall avg\n"
219 << std::string().assign(87,
'=')
221 for (
unsigned int i=0; i <
TimerList.size(); ++i) {
223 double wallmax = 0.0, cpumax = 0.0, wallmin = 0.0, cpumin = 0.0;
224 double wallavg = 0.0, cpuavg = 0.0;
231 size_t lengthName =
std::min(tptr->
name.length(), 19lu);
232 *msg << tptr->
name.substr(0,lengthName);
233 for (
int j=lengthName; j < 20; ++j) {
237 <<
" " << std::setw(9) << std::setprecision(4) << cpumax
238 <<
" " << std::setw(9) << std::setprecision(4) << wallmax
239 <<
" " << std::setw(9) << std::setprecision(4) << cpumin
240 <<
" " << std::setw(9) << std::setprecision(4) << wallmin
241 <<
" " << std::setw(9) << std::setprecision(4) << cpuavg /
Ippl::getNodes()
242 <<
" " << std::setw(9) << std::setprecision(4) << wallavg /
Ippl::getNodes()
245 timer_stream->close();
PartBunchBase< T, Dim >::ConstIterator end(PartBunchBase< T, Dim > const &bunch)
PartBunchBase< T, Dim >::ConstIterator begin(PartBunchBase< T, Dim > const &bunch)
T * value_type(const SliceIterator< T > &)
bool reduce(Communicate &, InputIterator, InputIterator, OutputIterator, const ReduceOp &, bool *IncludeVal=0)
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
Inform & endl(Inform &inf)
Inform & level1(Inform &inf)
std::string::iterator iterator
void clearTimer(TimerRef)
void startTimer(TimerRef)
TimerRef getTimer(const char *)
static std::stack< Timing * > stashedInstance