123 <<
"-----------------------------------------------------------------";
125 msg <<
" Timing results for " <<
Ippl::getNodes() <<
" nodes:" <<
"\n";
126 msg <<
"-----------------------------------------------------------------";
131 double walltotal = 0.0, cputotal = 0.0;
134 size_t lengthName = std::min(tptr->
name.length(), 19lu);
135 msg << tptr->
name.substr(0,lengthName)
136 << std::string().assign(20 - lengthName,
'.')
137 <<
" Wall tot = " << std::setw(10) << walltotal <<
","
138 <<
" CPU tot = " << std::setw(10) << cputotal <<
"\n"
146 return std::lexicographical_compare(
147 a->name.begin(),
a->name.end(),
148 b->name.begin(), b->name.end(),
149 [](
unsigned char c1,
unsigned char c2) {
150 return std::tolower(c1) < std::tolower(c2);
154 for (
unsigned int i=1; i <
TimerList.size(); ++i) {
156 double wallmax = 0.0, cpumax = 0.0, wallmin = 0.0, cpumin = 0.0;
157 double wallavg = 0.0, cpuavg = 0.0;
164 size_t lengthName = std::min(tptr->
name.length(), 19lu);
166 msg << tptr->
name.substr(0,lengthName)
167 << std::string().assign(20 - lengthName,
'.')
168 <<
" Wall max = " << std::setw(10) << wallmax <<
","
169 <<
" CPU max = " << std::setw(10) << cpumax <<
"\n"
170 << std::string().assign(20,
' ')
171 <<
" Wall avg = " << std::setw(10) << wallavg /
Ippl::getNodes() <<
","
172 <<
" CPU avg = " << std::setw(10) << cpuavg /
Ippl::getNodes() <<
"\n"
173 << std::string().assign(20,
' ')
174 <<
" Wall min = " << std::setw(10) << wallmin <<
","
175 <<
" CPU min = " << std::setw(10) << cpumin <<
"\n"
178 msg <<
"-----------------------------------------------------------------";
184void Timing::print(
const std::string& fn,
const std::map<std::string, unsigned int>& problemSize) {
186 std::ofstream *timer_stream;
192 timer_stream =
new std::ofstream;
193 timer_stream->open( fn.c_str(), std::ios::out );
194 msg =
new Inform( 0, *timer_stream, 0 );
206 if (!problemSize.empty()) {
207 *msg <<
"Problem size:\n";
208 for (
auto it: problemSize) {
209 *msg <<
" " << std::setw(10) << it.first <<
": " << it.second <<
"\n";
214 *msg << std::setw(27) <<
"num Nodes"
215 << std::setw(10) <<
"CPU tot"
216 << std::setw(11) <<
"Wall tot\n"
217 << std::string().assign(47,
'=')
221 double walltotal = 0.0, cputotal = 0.0;
224 size_t lengthName = std::min(tptr->
name.length(), 19lu);
225 *msg << tptr->
name.substr(0,lengthName);
226 for (
int j=lengthName; j < 20; ++j) {
230 <<
" " << std::setw(9) << std::setprecision(4) << cputotal
231 <<
" " << std::setw(9) << std::setprecision(4) << walltotal
239 return std::lexicographical_compare(
240 a->name.begin(),
a->name.end(),
241 b->name.begin(), b->name.end(),
242 [](
unsigned char c1,
unsigned char c2) {
243 return std::tolower(c1) < std::tolower(c2);
248 << std::setw(27) <<
"num Nodes"
249 << std::setw(10) <<
"CPU max"
250 << std::setw(10) <<
"Wall max"
251 << std::setw(10) <<
"CPU min"
252 << std::setw(10) <<
"Wall min"
253 << std::setw(10) <<
"CPU avg"
254 << std::setw(11) <<
"Wall avg\n"
255 << std::string().assign(87,
'=')
257 for (
unsigned int i=0; i <
TimerList.size(); ++i) {
259 double wallmax = 0.0, cpumax = 0.0, wallmin = 0.0, cpumin = 0.0;
260 double wallavg = 0.0, cpuavg = 0.0;
267 size_t lengthName = std::min(tptr->
name.length(), 19lu);
268 *msg << tptr->
name.substr(0,lengthName);
269 for (
int j=lengthName; j < 20; ++j) {
273 <<
" " << std::setw(9) << std::setprecision(4) << cpumax
274 <<
" " << std::setw(9) << std::setprecision(4) << wallmax
275 <<
" " << std::setw(9) << std::setprecision(4) << cpumin
276 <<
" " << std::setw(9) << std::setprecision(4) << wallmin
277 <<
" " << std::setw(9) << std::setprecision(4) << cpuavg /
Ippl::getNodes()
278 <<
" " << std::setw(9) << std::setprecision(4) << wallavg /
Ippl::getNodes()
281 timer_stream->close();
bool reduce(Communicate &, InputIterator, InputIterator, OutputIterator, const ReduceOp &, bool *IncludeVal=0)