24 #include <boost/algorithm/string.hpp>
49 timeinfo = localtime ( &rawtime );
50 std::string
date( asctime( timeinfo ) );
52 tr.
Error <<
"TIME_STAMP: " << date <<
" " << msg << std::endl;
296 DynamicProfileThis::DynamicProfileThis( std::string
const&
tag ) {
298 using namespace basic::options::OptionKeys;
301 if ( !
option[basic::options::OptionKeys::run::profile] ) {
309 DynamicProfileThis::~DynamicProfileThis() {
311 using namespace basic::options::OptionKeys;
313 if ( !
option[basic::options::OptionKeys::run::profile] ) {
318 clock_t
const start( start_clock_ );
320 if ( current >= start ) {
322 dynamic_prof_calls[ tag_ ] += 1;
327 using namespace ObjexxFCL;
332 using namespace basic::options::OptionKeys;
335 if ( !
option[basic::options::OptionKeys::run::profile] ) {
339 static bool init(
false );
347 tt <<
"\n========================================\n";
348 tt <<
"========================================\n";
349 tt <<
"============ PROFILE INFO ==============\n";
350 tt <<
"========================================\n";
351 tt <<
"========================================\n";
352 tt <<
A(12,
"clock") <<
' ' <<
A(9,
"ncalls") <<
' ' <<
A(9,
"bad_calls") <<
' ' <<
A(12,
"c/call") <<
' ' <<
355 ProfTag const tag( static_cast< ProfTag >( i ) );
357 int const ncalls(
calls[tag] );
359 double const clocks_per_call( ncalls != 0 ? t/ncalls : 0.0 );
361 tt <<
F(12,2,t) <<
' ' <<
I(9,ncalls) <<
' ' <<
I(9,bcalls)
362 <<
' ' <<
F(12,3, clocks_per_call ) <<
' ' <<
tag2string[
tag] <<
'\n';
366 std::string
const&
tag( it->first );
367 double const t( it->second );
368 int const ncalls( dynamic_prof_calls[tag] );
369 double const clocks_per_call( ncalls != 0 ? t/ncalls : 0.0 );
371 tt <<
F(12,2,t) <<
' ' <<
I(9,ncalls) <<
' ' <<
I(9,0)
372 <<
' ' <<
F(12,3, clocks_per_call ) <<
' ' << tag <<
'\n';
376 tt <<
"========================================\n";
377 tt <<
"========================================\n";
378 tt <<
"========================================" << std::endl;
384 using namespace basic::options::OptionKeys;
387 if ( !
option[basic::options::OptionKeys::run::profile] ) {
ocstream cerr(std::cerr)
Wrapper around std::cerr.
utility::keys::KeyLookup< KeyType >::const_iterator const_iterator
Key collection iterators.
utility::vector1< clock_t > start_clock(n_prof_tags, 0)
void date(Fstring &day)
Current Date String (Not Y2K Compliant): DD-MMM-YY.
utility::vector1< int > calls(n_prof_tags, 0)
std::map< std::string, int > dynamic_prof_calls
std::string & trim(std::string &s)
Trim Trailing Space from a string.
void show_time(basic::Tracer &tr, std::string const &msg)
std::string const & channel() const
rule< Scanner, options_closure::context_t > options
std::map< std::string, double > dynamic_prof_total
utility::vector1< int > bad_calls(n_prof_tags, 0)
clock_t const SHRINK_FACTOR(2)
vector1: std::vector with 1-based indexing
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
bool show_time_on_cerr(false)
std::string string_of(Fstring const &s)
string of an Fstring
void init()
set global 'init_was_called' to true
rule< Scanner, tag_closure::context_t > tag
THREAD_LOCAL basic::Tracer tr("struc_set_fragment_picker")
utility::vector1< double > total_clock(n_prof_tags, 0)
utility::vector1< std::string > tag2string
double const clock_factor(((double) SHRINK_FACTOR *100.0)/CLOCKS_PER_SEC)
rule< Scanner, option_closure::context_t > option