The Gaudi Framework  v33r1 (b1225454)
ChronoStatSvc.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifdef _WIN32
12 # pragma warning( disable : 4786 )
13 #endif
14 // ============================================================================
15 // STD & STL
16 // ============================================================================
17 #include <algorithm>
18 #include <fstream>
19 #include <functional>
20 #include <iomanip>
21 #include <iostream>
22 #include <string>
23 // ============================================================================
24 // GaudiKernel
25 // ============================================================================
30 #include "GaudiKernel/Kernel.h"
31 #include "GaudiKernel/MsgStream.h"
32 #include "GaudiKernel/Stat.h"
33 #include "GaudiKernel/StatEntity.h"
34 #include "GaudiKernel/StatusCode.h"
35 // ============================================================================
37 // ============================================================================
38 #include "ChronoStatSvc.h"
39 // ============================================================================
42 // ============================================================================
44 // ============================================================================
51 // ============================================================================
52 // ============================================================================
53 // comparison functor
54 // ============================================================================
55 constexpr struct CompareFirstOfPointerPair_t {
56  template <typename S, typename T>
57  inline bool operator()( const std::pair<S*, T*>& p1, const std::pair<S*, T*>& p2 ) const {
58  auto e1 = p1.first;
59  auto e2 = p2.first;
60  return ( !e1 || !e2 ) || *e1 < *e2;
61  }
63 // ============================================================================
64 // Compound assignment operator.
65 // ============================================================================
66 void ChronoStatSvc::merge( const ChronoStatSvc& css ) {
67 
68  // Add the content of the maps, leave the rest unchanged
69 
70  auto lock = std::scoped_lock{m_mutex, css.m_mutex};
71  // Merge Chronomaps
72  for ( auto& item : css.m_chronoEntities ) {
73  const IChronoStatSvc::ChronoTag& key = item.first;
74  const ChronoEntity& val = item.second;
75  if ( m_chronoEntities.count( key ) )
76  m_chronoEntities[key] += val;
77  else
79  }
80 
81  // Merge StatMaps
82  for ( auto& item : css.m_statEntities ) {
83  const IChronoStatSvc::StatTag& key = item.first;
84  const StatEntity& val = item.second;
85  if ( m_statEntities.count( key ) )
86  m_statEntities[key] += val;
87  else
88  m_statEntities.emplace( key, val );
89  }
90 }
91 // ============================================================================
92 // Implementation of IService::initialize()
93 // ============================================================================
96  if ( sc.isFailure() ) return sc;
98  // Set my own properties
99  sc = setProperties();
100 
101  if ( sc.isFailure() ) {
102  error() << "setting my properties" << endmsg;
103  return StatusCode::FAILURE;
104  }
105 
106  // only add an EndEvent listener if per-event output requested
107  if ( !m_perEventFile.empty() ) {
109  if ( !m_ofd.is_open() ) {
110  error() << "unable to open per-event output file \"" << m_perEventFile << "\"" << endmsg;
111  return StatusCode::FAILURE;
112  } else {
113  auto ii = serviceLocator()->service<IIncidentSvc>( "IncidentSvc" );
114  if ( !ii ) {
115  error() << "Unable to find IncidentSvc" << endmsg;
116  return StatusCode::FAILURE;
117  }
118  ii->addListener( this, IncidentType::EndEvent );
119  }
120  }
121 
127  chronoStart( name() );
129  return StatusCode::SUCCESS;
130 }
131 // ============================================================================
132 // Implementation of IService::finalize()
133 // ============================================================================
135  std::string local = name() + ".finalize()";
137  MsgStream main_log( msgSvc(), local );
140  chronoStop( name() );
141 
142  if ( m_ofd.is_open() ) {
143  debug() << "writing per-event timing data to '" << m_perEventFile << "'" << endmsg;
144  for ( const auto& itr : m_perEvtTime ) {
145  m_ofd << itr.first.substr( 0, itr.first.length() - 8 ) << " ";
146  for ( const auto& itt : itr.second ) { m_ofd << " " << (long int)( itt ); }
147  m_ofd << std::endl;
148  }
149 
150  m_ofd.close();
151  }
152 
157  MsgStream log( msgSvc(), "*****Chrono*****" );
158  const std::string stars( ( m_chronoCoutFlag ) ? 126 : 100, '*' );
159  if ( m_chronoCoutFlag ) {
160  std::cout << stars << std::endl;
161  if ( isMT() ) { std::cout << "WARNING: MT job; statistics are unreliable" << std::endl; }
162  std::cout << local << " The Final CPU consumption (Chrono) Table "
163  << ( m_chronoOrderFlag ? "(ordered)" : "(not ordered)" ) << std::endl;
164  std::cout << stars << std::endl;
165  } else {
166  log << m_chronoPrintLevel << stars << endmsg;
167  if ( isMT() ) { log << m_chronoPrintLevel << "WARNING: MT job; statistics are unreliable" << endmsg; }
168  log << m_chronoPrintLevel << " The Final CPU consumption ( Chrono ) Table "
169  << ( m_chronoOrderFlag ? "(ordered)" : "(not ordered)" ) << endmsg;
170  log << m_chronoPrintLevel << stars << endmsg;
171  }
173  { // prepare container for printing
175  tmpCont.reserve( m_chronoEntities.size() );
176  for ( auto& it : m_chronoEntities ) { tmpCont.emplace_back( &it.second, &it.first ); }
177  // sort it
178  if ( m_chronoOrderFlag ) std::sort( tmpCont.begin(), tmpCont.end(), CompareFirstOfPointerPair );
179  // print User Time statistics
180  if ( m_printUserTime ) {
181  for ( auto iter = tmpCont.begin(); tmpCont.end() != iter; ++iter ) {
182  //
183  ChronoEntity* entity = iter->first;
184  if ( !entity ) { continue; }
185  const ChronoTag* tag = iter->second;
186  if ( !tag ) { continue; }
187  entity->stop();
189  if ( m_chronoCoutFlag )
191  {
192  std::cout << *tag << "\t" << entity->outputUserTime() << std::endl;
193  } else
194  {
195  MsgStream( msgSvc(), *tag ) << m_chronoPrintLevel << entity->outputUserTime() << endmsg;
196  }
197  //
198  }
199  }
201  if ( m_printSystemTime ) {
205  std::cout << stars << std::endl;
206  } else if ( m_printUserTime && !m_chronoCoutFlag ) {
207  log << m_chronoPrintLevel << stars << endmsg;
208  }
210  for ( auto iter = tmpCont.begin(); tmpCont.end() != iter; ++iter ) {
212  ChronoEntity* entity = iter->first;
213  if ( !entity ) { continue; }
214  const ChronoTag* tag = iter->second;
215  if ( !tag ) { continue; }
216  entity->stop();
218  if ( m_chronoCoutFlag )
220  {
221  std::cout << *tag << "\t" << entity->outputSystemTime() << std::endl;
222  } else
223  {
224  MsgStream( msgSvc(), *tag ) << m_chronoPrintLevel << entity->outputSystemTime() << endmsg;
225  }
226  //
227  }
228  }
230  if ( m_printEllapsedTime ) {
234  std::cout << stars << std::endl;
235  } else if ( ( m_printUserTime || m_printSystemTime ) && !m_chronoCoutFlag ) {
236  log << m_chronoPrintLevel << stars << endmsg;
237  }
239  for ( const auto& i : tmpCont ) {
241  ChronoEntity* entity = i.first;
242  if ( !entity ) { continue; }
243  const ChronoTag* tag = i.second;
244  if ( !tag ) { continue; }
245  entity->stop();
247  if ( m_chronoCoutFlag )
249  {
250  std::cout << *tag << "\t" << entity->outputElapsedTime() << std::endl;
251  } else
252  {
253  MsgStream( msgSvc(), *tag ) << m_chronoPrintLevel << entity->outputElapsedTime() << endmsg;
254  }
255  //
256  }
257  }
259  tmpCont.clear();
260  }
262  if ( m_chronoCoutFlag ) {
263  std::cout << stars << std::endl;
264  } else {
265  log << m_chronoPrintLevel << stars << endmsg;
266  }
267  }
268 
270 
272  if ( m_statTableFlag ) { printStats(); }
273 
274  if ( !m_statsOutFileName.value().empty() ) { saveStats(); }
275 
276  // clear the maps.
280 
281  main_log << MSG::INFO << " Service finalized successfully " << endmsg;
282 
283  return Service::finalize();
284 }
285 // ============================================================================
286 // Implementation of IChronoStatSvc::chronoStart
287 // ============================================================================
288 ChronoEntity* ChronoStatSvc::chronoStart( const ChronoTag& chronoTag ) {
289  ChronoEntity& entity = getEntity( chronoTag );
290  entity.start();
291  return &entity;
292 }
293 // ============================================================================
294 // Implementation of IChronoStatSvc::chronoStop
295 // ============================================================================
296 const ChronoEntity* ChronoStatSvc::chronoStop( const IChronoStatSvc::ChronoTag& chronoTag ) {
297  ChronoEntity& entity = getEntity( chronoTag );
298  entity.stop();
299  return &entity;
300 }
301 // ============================================================================
302 // Implementation of IChronoStatSvc::chronoDelta
303 // ============================================================================
304 IChronoStatSvc::ChronoTime ChronoStatSvc::chronoDelta( const IChronoStatSvc::ChronoTag& chronoTag,
305  IChronoStatSvc::ChronoType theType ) {
306  return getEntity( chronoTag ).delta( theType );
307 }
308 // ============================================================================
309 // Implementation of IChronoStatSvc::chronoPrint
310 // ============================================================================
311 void ChronoStatSvc::chronoPrint( const IChronoStatSvc::ChronoTag& chronoTag ) {
312  MsgStream log( msgSvc(), chronoTag );
313  if ( m_printUserTime ) { log << m_chronoPrintLevel << getEntity( chronoTag ).outputUserTime() << endmsg; }
314  if ( m_printSystemTime ) { log << m_chronoPrintLevel << getEntity( chronoTag ).outputSystemTime() << endmsg; }
315 }
316 // ============================================================================
317 // Implementation of IChronoSvc::chronoStatus
318 // ============================================================================
319 IChronoStatSvc::ChronoStatus ChronoStatSvc::chronoStatus( const IChronoStatSvc::ChronoTag& chronoTag ) {
320  return getEntity( chronoTag ).status();
321 }
322 // ============================================================================
323 // Implementation of IChronoStatSvc::stat
324 // ============================================================================
325 void ChronoStatSvc::stat( const IChronoStatSvc::StatTag& statTag, const IChronoStatSvc::StatFlag& statFlag ) {
326  auto theIter = m_statEntities.find( statTag );
327 
328  StatEntity* theStat = nullptr;
329  // if new entity, specify the number of events to be skipped
330  if ( theIter == m_statEntities.end() ) {
331  // new stat entity
332  StatEntity& theSe = m_statEntities[statTag];
333  theStat = &theSe;
334  } else {
335  // existing stat entity
336  theStat = &theIter->second;
337  }
338 
339  theStat->addFlag( statFlag );
340 }
341 // ============================================================================
342 // Implementation of IChronoStatSvc::statPrint
343 // ============================================================================
344 void ChronoStatSvc::statPrint( const IChronoStatSvc::StatTag& statTag ) {
345  MsgStream log( msgSvc(), statTag );
346  log << m_statPrintLevel << m_statEntities[statTag] << endmsg;
347 }
348 // ============================================================================
349 /* extract the chrono entity for the given tag (name)
350  * @see IChronoStatSvc
351  * @param t chrono tag(name)
352  * @return pointer to chrono entity
353  */
354 // ============================================================================
355 const ChronoEntity* ChronoStatSvc::chrono( const IChronoStatSvc::ChronoTag& t ) const {
356  auto lock = std::scoped_lock{m_mutex};
357  auto it = m_chronoEntities.find( t );
358  return m_chronoEntities.end() != it ? &( it->second ) : nullptr;
359 }
360 // ============================================================================
361 /* extract the stat entity for the given tag (name)
362  * @see IChronoStatSvc
363  * @param t stat tag(name)
364  * @return pointer to stat entity
365  */
366 // ============================================================================
367 StatEntity* ChronoStatSvc::stat( const IChronoStatSvc::StatTag& t ) {
368  auto it = m_statEntities.find( t );
369  return m_statEntities.end() != it ? &( it->second ) : nullptr;
370 }
371 // ============================================================================
372 // dump all the statistics into an ASCII file
373 // ============================================================================
375  std::ofstream out( m_statsOutFileName.value(), std::ios_base::out | std::ios_base::trunc );
376  if ( !out.good() ) {
377  info() << "Could not open the output file for writing chrono statistics [" << m_statsOutFileName.value() << "]"
378  << endmsg;
379  return;
380  } else {
381  // format it our way
382  out << std::scientific << std::setprecision( 8 );
383  }
384 
385  // ChronoEntity
387  {
388  auto lock = std::scoped_lock{m_mutex};
389  chronos.reserve( m_chronoEntities.size() );
391  []( ChronoMap::const_reference i ) { return std::make_pair( &i.second, &i.first ); } );
392  }
393 
394  // sort it
395  std::sort( std::begin( chronos ), std::end( chronos ), CompareFirstOfPointerPair );
396 
397  // print User Time statistics
398  for ( const auto& iter : chronos ) {
399  //
400  const ChronoEntity* entity = iter.first;
401  if ( !entity ) { continue; }
402 
403  const ChronoTag* tag = iter.second;
404  if ( !tag ) { continue; }
405 
406  // create an entry in the .INI-like table
407  out << "\n[" << *tag << "]\n";
408 
409  // user
410  out << "cpu_user_total = " << entity->uTotalTime() << "\n";
411  out << "cpu_user_min = " << entity->uMinimalTime() << "\n";
412  out << "cpu_user_mean = " << entity->uMeanTime() << "\n";
413  out << "cpu_user_RMS = " << entity->uRMSTime() << "\n";
414  out << "cpu_user_max = " << entity->uMaximalTime() << "\n";
415  out << "cpu_user_nbr = " << entity->nOfMeasurements() << "\n";
416 
417  // system
418  out << "\n"; // just for clarity
419  out << "cpu_system_total = " << entity->kTotalTime() << "\n";
420  out << "cpu_system_min = " << entity->kMinimalTime() << "\n";
421  out << "cpu_system_mean = " << entity->kMeanTime() << "\n";
422  out << "cpu_system_RMS = " << entity->kRMSTime() << "\n";
423  out << "cpu_system_max = " << entity->kMaximalTime() << "\n";
424  out << "cpu_system_nbr = " << entity->nOfMeasurements() << "\n";
425 
426  // real
427  out << "\n"; // just for clarity
428  out << "cpu_real_total = " << entity->eTotalTime() << "\n";
429  out << "cpu_real_min = " << entity->eMinimalTime() << "\n";
430  out << "cpu_real_mean = " << entity->eMeanTime() << "\n";
431  out << "cpu_real_RMS = " << entity->eRMSTime() << "\n";
432  out << "cpu_real_max = " << entity->eMaximalTime() << "\n";
433  out << "cpu_real_nbr = " << entity->nOfMeasurements() << "\n";
434  }
435 
436  out << std::endl;
437 }
438 // ============================================================================
439 // Test if we're running in an MT job.
440 // ============================================================================
441 bool ChronoStatSvc::isMT() const {
442  bool isMT = false;
444  error() << "Cannot retrieve HiveWhiteBoardSvc";
445  } else {
446  // In non-MT mode, `EventDataSvc' does not have an IHiveWhiteBoard interface.
448  if ( wb && wb->getNumberOfStores() > 1 ) { isMT = true; }
449  }
450  return isMT;
451 }
452 // ============================================================================
453 // print the "Stat" part of the ChronoStatSvc
454 // ============================================================================
457  if ( m_statEntities.empty() ) { return; }
458 
459  MsgStream log( msgSvc(), "******Stat******" );
461  const std::string stars( ( m_statCoutFlag ) ? 126 : 100, '*' );
463  if ( m_statCoutFlag ) {
464  std::cout << stars << std::endl;
465  if ( isMT() ) { std::cout << "WARNING: MT job; statistics are unreliable" << std::endl; }
466  std::cout << " The Final stat Table " << ( m_statOrderFlag ? "(ordered)" : "(not ordered)" ) << std::endl;
467  std::cout << stars << std::endl;
468  } else {
469  log << m_statPrintLevel << stars << endmsg;
470  if ( isMT() ) { log << (MSG::Level)m_chronoPrintLevel << "WARNING: MT job; statistics are unreliable" << endmsg; }
471  log << m_statPrintLevel << " The Final stat Table " << ( m_statOrderFlag ? "(ordered)" : "(not ordered)" )
472  << endmsg;
473  log << m_statPrintLevel << stars << endmsg;
474  }
475 
476  {
477  // prepare container for printing
479  typedef std::vector<SPair> SCont;
480  SCont tmpCont;
482  []( StatMap::const_reference i ) { return std::make_pair( &i.second, &i.first ); } );
483  // sort it
484  if ( m_statOrderFlag ) std::sort( tmpCont.begin(), tmpCont.end(), CompareFirstOfPointerPair );
485  // print the table header
486  if ( m_statCoutFlag ) {
487  std::cout << m_header.value() << std::endl;
488  } else {
489  log << m_statPrintLevel << m_header.value() << endmsg;
490  }
491 
492  // loop over counters and print them:
493  for ( const auto& iter : tmpCont ) {
495  const StatEntity* entity = iter.first;
496  if ( !entity ) { continue; }
497  const StatTag* tag = iter.second;
498  if ( !tag ) { continue; }
499  if ( m_statCoutFlag ) {
501  entity->print( std::cout, true, *tag, m_useEffFormat, "%|-15.15s|%|17t|" );
502  } else {
503  std::ostringstream ost;
504  entity->print( ost, true, *tag, m_useEffFormat, "%|-15.15s|%|17t|" );
505  log << m_statPrintLevel << ost.str() << endmsg;
506  }
507  }
508  tmpCont.clear();
509  }
511  if ( m_statCoutFlag ) {
512  std::cout << stars << std::endl;
513  } else {
514  log << m_statPrintLevel << stars << endmsg;
515  }
516 }
517 
518 // ============================================================================
519 
520 void ChronoStatSvc::handle( const Incident& /* inc */ ) {
521 
522  if ( !m_ofd.is_open() ) return;
523 
524  auto lock = std::scoped_lock{m_mutex};
525  for ( const auto& itr : m_chronoEntities ) {
526  if ( itr.first.find( ":Execute" ) == std::string::npos ) continue;
527 
528  auto itm = m_perEvtTime.find( itr.first );
529  if ( itm == m_perEvtTime.end() ) {
530  m_perEvtTime[itr.first] = {itr.second.delta( IChronoSvc::ELAPSED )};
531  } else {
532  itm->second.push_back( itr.second.delta( IChronoSvc::ELAPSED ) );
533  }
534  }
535 }
536 
537 // ============================================================================
538 // The END
539 // ============================================================================
ChronoEntity & getEntity(const ChronoTag &chronoTag)
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:34
StatusCode initialize() override
Definition: Service.cpp:70
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:287
T empty(T... args)
T open(T... args)
double eRMSTime() const
r.m.s Elapsed Time
Definition: ChronoEntity.h:255
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
ChronoStatus chronoStatus(const IChronoStatSvc::ChronoTag &chronoTag) override
Implementation of IChronoStatSvc::chronoStatus.
Gaudi::Property< std::string > m_header
StatusCode finalize() override
Definition: Service.cpp:174
StatMap m_statEntities
stat part
a small helper class for implementation of ChronoStatSvc service, It also could be used as some local...
Definition: ChronoEntity.h:31
IChronoSvc::ChronoTime delta(IChronoSvc::ChronoType type) const
return the last delta-time of type "type"
Definition: ChronoEntity.h:271
Gaudi::Property< bool > m_statCoutFlag
IChronoStatSvc::ChronoTime chronoDelta(const IChronoStatSvc::ChronoTag &chronoTag, IChronoStatSvc::ChronoType theType) override
Implementation of IchronoStatSvc::chronoDelta.
T endl(T... args)
Gaudi::Property< bool > m_chronoOrderFlag
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
Gaudi::Property< bool > m_printUserTime
std::mutex m_mutex
Mutex protecting m_chronoEntities.
void stat(const IChronoStatSvc::StatTag &statTag, const IChronoStatSvc::StatFlag &statFlag) override
Implementation of IChronoStatSvc::stat add statistical information to the entity ,...
double uMinimalTime() const
minimal measurement for user time
Definition: ChronoEntity.h:195
T end(T... args)
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
void statPrint(const IChronoStatSvc::ChronoTag &statTag) override
prints (using message service) info about statistical entity, tagged by its name
IChronoSvc::ChronoStatus start()
start the current chrono
STL class.
#define DECLARE_COMPONENT(type)
double kRMSTime() const
r.m.s Kernel Time
Definition: ChronoEntity.h:247
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:86
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:284
STL class.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
double eMaximalTime() const
maximal measurement for elapsed time
Definition: ChronoEntity.h:215
void merge(const ChronoStatSvc &css)
Compound assignment operator.
double uTotalTime() const
total user time
Definition: ChronoEntity.h:219
Gaudi::Property< bool > m_useEffFormat
void saveStats()
dump the statistics into an ASCII file for offline processing
constexpr struct CompareFirstOfPointerPair_t CompareFirstOfPointerPair
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
unsigned long nOfMeasurements() const
number of chrono measurements
Definition: ChronoEntity.h:191
double eMinimalTime() const
minimal measurement for elapsed time
Definition: ChronoEntity.h:203
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:181
TimeMap m_perEvtTime
T close(T... args)
const ChronoEntity * chronoStop(const IChronoStatSvc::ChronoTag &chronoTag) override
Implementation of IChronoStatSvc::chronoStop.
StatusCode retrieve() const
Retrieve the Service.
Definition: ServiceHandle.h:80
double uMeanTime() const
average User Time
Definition: ChronoEntity.h:239
Gaudi::Property< bool > m_statOrderFlag
double kMeanTime() const
average Kernel Time
Definition: ChronoEntity.h:235
T str(T... args)
T make_pair(T... args)
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Gaudi::Property< bool > m_chronoTableFlag
double eTotalTime() const
total Elapsed time
Definition: ChronoEntity.h:227
T clear(T... args)
ServiceHandle< IInterface > m_hiveWhiteBoardSvc
std::ofstream m_ofd
StatusCode setProperties()
Method for setting declared properties to the values specified for the job.
Definition: Service.cpp:290
T count(T... args)
T scientific(T... args)
MSG::Level m_chronoPrintLevel
level of info printing
StatusCode initialize() override
Implementation of IService::initialize()
Gaudi::Property< bool > m_printEllapsedTime
T * get() const
Release the Service.
Definition: ServiceHandle.h:91
T insert(T... args)
T find(T... args)
T size(T... args)
HepRndm::Engine< TripleRand > e2
STL class.
double kTotalTime() const
total Kernel time
Definition: ChronoEntity.h:223
T begin(T... args)
void handle(const Incident &incident) override
T back_inserter(T... args)
Gaudi::Property< bool > m_statTableFlag
Base class for all Incidents (computing events).
Definition: Incident.h:27
ChronoEntity * chronoStart(const IChronoStatSvc::ChronoTag &chronoTag) override
Implementation of IChronoStatSvc::chronoStart.
std::ostream & print(std::ostream &o, bool tableFormat, std::string_view name, bool flag=true, std::string_view fmtHead="%|-48.48s|%|27t|") const
Definition: StatEntity.h:160
unsigned long addFlag(const double v)
Definition: StatEntity.h:85
double uMaximalTime() const
maximal measurement for user time
Definition: ChronoEntity.h:207
double kMinimalTime() const
minimal measurement for kernel time
Definition: ChronoEntity.h:199
T emplace(T... args)
bool isMT() const
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::Property< std::string > m_statsOutFileName
MSG::Level m_statPrintLevel
level of info printing
Gaudi::Property< bool > m_chronoCoutFlag
T sort(T... args)
T transform(T... args)
bool isFailure() const
Definition: StatusCode.h:145
double eMeanTime() const
average Elapsed Time
Definition: ChronoEntity.h:243
bool operator()(const std::pair< S *, T * > &p1, const std::pair< S *, T * > &p2) const
backward compatible StatEntity class.
Definition: StatEntity.h:18
T is_open(T... args)
IChronoSvc::ChronoStatus stop()
stop the chrono
T setprecision(T... args)
double kMaximalTime() const
maximal measurement for kernel time
Definition: ChronoEntity.h:211
IChronoSvc::ChronoStatus status() const
return the status of chrono
Definition: ChronoEntity.h:187
std::string outputElapsedTime() const
print the chrono ;
double uRMSTime() const
r.m.s User Time
Definition: ChronoEntity.h:251
void chronoPrint(const IChronoStatSvc::ChronoTag &chronoTag) override
Implementation of IChronoStatSvc::chronoPrint.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:33
std::string outputUserTime() const
print the chrono ;
The Chrono & Stat Sservice: service implements the IChronoStatSvc interface and provides the basic ch...
Definition: ChronoStatSvc.h:46
std::string outputSystemTime() const
print the chrono ;
T reserve(T... args)
ChronoMap m_chronoEntities
chrono part
T emplace_back(T... args)
Gaudi::Property< bool > m_printSystemTime
StatusCode finalize() override
Implementation of IService::finalize()
Gaudi::Property< std::string > m_perEventFile
const ChronoEntity * chrono(const IChronoStatSvc::ChronoTag &t) const override
extract the chrono entity for the given tag (name)