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 <<
"-----------------------------------------------------------------";
153 void 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();
static std::stack< Timing * > stashedInstance
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
void startTimer(TimerRef)
void clearTimer(TimerRef)
clearpage the user may choose between constant or variable radius This model includes fringe fields begin
Inform & endl(Inform &inf)
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
std::string::iterator iterator
T * value_type(const SliceIterator< T > &)
TimerRef getTimer(const char *)
Inform & level1(Inform &inf)
bool reduce(Communicate &, InputIterator, InputIterator, OutputIterator, const ReduceOp &, bool *IncludeVal=0)