ATLAS Offline Software
PerfMonSvc.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // PerfMonSvc.cxx
8 // Implementation file for class PerfMonSvc
9 // Author: S.Binet<binet@cern.ch>
11 
12 // Python includes
13 #include "Python.h"
14 #include "patchlevel.h"
15 
16 #ifdef Py_False
17 #undef Py_False
18 #define Py_False ( (PyObject*)(void*)&_Py_ZeroStruct )
19 #endif
20 
21 #ifdef Py_True
22 #undef Py_True
23 #define Py_True ( (PyObject*)(void*)&_Py_TrueStruct )
24 #endif
25 
26 // C includes
27 #include <stdio.h>
28 #include <unistd.h>
29 #include <fcntl.h>
30 #include <sys/times.h>
31 #include <string.h>
32 #include <libgen.h> // for basename
33 #include <filesystem>
34 
35 // STL includes
36 
37 // FrameWork includes
38 #include "Gaudi/Property.h"
39 #include "GaudiKernel/IIncidentSvc.h"
40 #include "GaudiKernel/Incident.h"
41 #include "GaudiKernel/IChronoStatSvc.h"
42 #include "GaudiKernel/GaudiException.h"
43 #include "GaudiKernel/IAlgManager.h"
44 #include "GaudiKernel/ServiceHandle.h"
46 #include "GaudiKernel/IIoComponentMgr.h"
47 
48 #include "CxxUtils/AthDsoCbk.h"
51 
53 
54 // AIDA includes
55 #include "AIDA/IBaseHistogram.h"
56 
57 // PerfMonComps includes
58 #include "PerfMonSvc.h"
59 #include "PerfMonUtils.h"
60 #include "PerfMonAuditor.h"
61 #include "PerfMonEvent/DataModel.h"
63 
64 //For PMonSD:
65 #include "SemiDetHelper.h"
66 
67 // PyROOT includes
68 #include "CPyCppyy/PyException.h"
69 
70 
71 #define PMON_COMP_FMT \
72  /* comp-id: /step/comp-name */ \
73  "/%s/%s " \
74  /* step-index (0 or 1) */ \
75  "%lu " \
76  /* cpu: user sys real rt_cpu */ \
77  "%8.3f %8.3f %8.3f %8.3f " \
78  /* mem: vmem rss mall nmall nfree*/ \
79  "%8.3f %8.3f %8.3f %lu %lu\n"
80 
81 #define PMON_IOCOMP_FMT \
82  /* comp-id: /step/comp-name */ \
83  "/%s/%s " \
84  /* cpu-r: user sys real rt_cpu */ \
85  "%8.3f %8.3f %8.3f %8.3f " \
86  /* cpu-rr: user sys real rt_cpu */ \
87  "%8.3f %8.3f %8.3f %8.3f " \
88  /* cpu-w: user sys real rt_cpu */ \
89  "%8.3f %8.3f %8.3f %8.3f\n"
90 
96 
97 // define some macros to circumvent the MessageSvc printout limits ------------
98 #define PMON_MSG_LVL_NOCHK(lvl, lvlname, x) \
99  std::cout << "PerfMonSvc: " << lvlname " " << x << "\n"
100 
101 #define PMON_MSG_LVL(lvl, lvlname, x) \
102  do { \
103  if (this->msgLvl (lvl)) { \
104  PMON_MSG_LVL_NOCHK(lvl, lvlname, x); \
105  } \
106  } while (0)
107 
108 #define PMON_VERBOSE(x) PMON_MSG_LVL(MSG::VERBOSE, "VERBOSE", x)
109 #define PMON_DEBUG(x) PMON_MSG_LVL(MSG::DEBUG, " DEBUG", x)
110 #define PMON_INFO(x) PMON_MSG_LVL_NOCHK(MSG::INFO, " INFO", x)
111 #define PMON_WARNING(x) PMON_MSG_LVL_NOCHK(MSG::WARNING, "WARNING", x)
112 #define PMON_ERROR(x) PMON_MSG_LVL_NOCHK(MSG::ERROR, " ERROR", x)
113 #define PMON_FATAL(x) PMON_MSG_LVL_NOCHK(MSG::FATAL, " FATAL", x)
114 #define PMON_ALWAYS(x) PMON_MSG_LVL_NOCHK(MSG::ALWAYS, " ALWAYS", x)
115 // ----------------------------------------------------------------------------
116 
117 namespace {
118 
119 void throw_py_exception (bool display=true)
120 {
121  if (display) {
122  // fetch error
123  PyObject* pytype = 0, *pyvalue = 0, *pytrace = 0;
124  PyErr_Fetch (&pytype, &pyvalue, &pytrace);
125  Py_XINCREF (pytype);
126  Py_XINCREF (pyvalue);
127  Py_XINCREF (pytrace);
128  // restore...
129  PyErr_Restore (pytype, pyvalue, pytrace);
130  // and print
131  PyErr_Print();
132  }
133  throw CPyCppyy::PyException();
134 }
135 
136  std::string
137  my_basename(const std::string& path)
138  {
139  char *pathc = strdup(path.c_str());
140  char *bname = basename(pathc);
141  std::string o(bname);
142  free(pathc);
143  return o;
144  }
145 
146  std::string
147  my_dirname(const std::string& path)
148  {
149  char *pathc = strdup(path.c_str());
150  char *dname = dirname(pathc);
151  std::string o(dname);
152  free(pathc);
153  return o;
154  }
155 }
156 
157 struct Units {
158  static const int kb = 1024;
159  static const int Mb = 1024 * 1024;
160 };
161 
162 namespace {
163  void capture(int idx, PerfMon::Component& c);
164 
165  extern "C"
166  int pmon_dso_cbk ATLAS_NOT_THREAD_SAFE (const struct ath_dso_event *evt, void *userdata);
167 
168 }
169 
171 // Public methods:
173 
174 // Constructors
176 PerfMonSvc::PerfMonSvc( const std::string& name, ISvcLocator* pSvcLocator ) :
177  AthService ( name, pSvcLocator ),
178  m_pySvc ( NULL ),
179  m_chrono ( "ChronoStatSvc/ChronoStatSvc", name ),
180  m_ntuple ( ),
181  m_firstVmem( 0. ),
182  m_10evtVmem( 0. ),
183  m_lastVmem ( 0. ),
184  m_stream ( -1 ),
185  m_nevts ( 0 ),
186  m_nalgs ( 0 ),
187  m_corrector( ),
188  m_pmonsd ( 0 ),
189  m_pf ( true )
190 {
191 
192  //
193  // Property declaration
194  //
195  //declareProperty( "Property", m_nProperty, "descr" );
196 
197  declareProperty( "DeltaVMemAlert",
199  "Maximum allowed variation of virtual memory (in bytes) "
200  "between last print-out and current vmem value, before "
201  "triggering a new print-out" );
202 
203  declareProperty( "OutFileName",
204  m_outFileName = "ntuple.pmon.gz",
205  "Name of the output file to hold performance data" );
206 
207  declareProperty( "ProfiledAlgs",
209  "List of algorithms to be profiled. If empty list "
210  "(default), all the algorithms known to the ApplicationMgr "
211  "are taken." );
213  this );
214 
215  declareProperty( "IoContainers",
217  "List of <CppType>#<SgKey> containers for which one wants "
218  "to gather I/O data" );
220  this );
221 
222  declareProperty("EnableDoubleCountingCorrection",
224  "switch to enable or not the on-the-fly double-counting "
225  "correction");
226 
227  declareProperty( "MonLvl",
228  m_monLvl = 0,
229  "monitoring level for monitoring granularity.\n" \
230  " -1: ALL\n" \
231  " 0: fast mode\n" \
232  " 10: some level");
233 
234  declareProperty( "ShelveFileName",
235  m_shelveFileName = "",
236  "name of the shelve file containing jobo metadata (domain "\
237  "flags, components' list, ...)");
238 
239  declareProperty( "SemiDetailedMonitoring",
240  m_semiDetMonLvl = 0,
241  "Whether or not to enable semi-detailed monitoring.\n" \
242  " 0: Disabled\n" \
243  " 1: Enabled\n" \
244  " 2: Enabled with full output in logfile");
245 
246  declareProperty( "JobStartJiffies",
247  m_jobStartJiffies = "",
248  "Needed internally to time configuration step. Do not modify this property." );
249 
250  declareProperty( "ExtraPrintouts",
251  m_extraPrintouts = false,
252  "Trigger print of perf metrics before and after each auditing." );
253 
254 
255 
256 }
257 
258 // Destructor
261 {
262  PMON_DEBUG("Calling destructor");
263  if (! m_pf) {
264  postFinalize();
265  }
266 }
267 
268 void
270 {
271 
272  PMON_DEBUG("Calling postFinalize");
273  // make sure we're only called once.
274  if (m_pf) {
275  PMON_DEBUG("Already been called. Returning");
276  return;
277  }
278 
279  fflush(NULL); //> flushes all output streams...
280 
282 
283  auto cwd = std::filesystem::current_path();
284  if (!m_workerDir.empty()) {
285  // The Python service relies on the current directory being the worker directory.
286  // This is the case in athena but not necessarily in other applications (ATR-19462)
287  std::filesystem::current_path(m_workerDir);
288  }
289 
290  if ( m_pySvc ) {
292  stopAud( "fin", "PerfMonSlice" );
293  }
294 
295  if (m_stream>0) {
296  close(m_stream);
297  }
298 
299  if (m_pmonsd) {
300  //PerfMonSD report to stdout (with least significant entries
301  //collapsed) and a txt file (with all entries). We don't gzip
302  //since the file anyway ends up in the gzip'ed tarball of all
303  //perfmon files:
304  std::string pmonsd_out(m_outFileName);pmonsd_out+=".pmon.pmonsd.txt";
305  std::string pmon_tarball(m_outFileName);pmon_tarball+=".pmon.gz";
306  m_pmonsd->report(pmonsd_out,pmon_tarball,m_semiDetMonLvl>1);
307  delete m_pmonsd;m_pmonsd=0;
308  }
309 
310  if ( m_pySvc ) {
311 
312  for (StatStore_t::const_iterator
313  istat = m_stats.begin(),
314  iend = m_stats.end();
315  istat != iend;
316  ++istat) {
317  const Stats_t& stats = istat->second;
318  PyObject* res = PyObject_CallMethod
319  ( m_pySvc,
320  const_cast<char*>("_set_stats"),
321  const_cast<char*>("sIffffffffffffffffIfffififif"),
322  (char*)istat->first.c_str(),
323  stats.cpu.nEntries(),
324  stats.cpu.flagMean(),
325  stats.cpu.flagMeanErr(),
326  stats.cpu_user.flagMean(),
327  stats.cpu_user.flagMeanErr(),
328  stats.cpu_sys.flagMean(),
329  stats.cpu_sys.flagMeanErr(),
330  stats.real.flagMean(),
331  stats.real.flagMeanErr(),
332  stats.vmem.flagMean(),
333  stats.vmem.flagMeanErr(),
334  stats.malloc.flagMean(),
335  stats.malloc.flagMeanErr(),
336  stats.nalloc.flagMean(),
337  stats.nalloc.flagMeanErr(),
338  stats.rt.flagMean(),
339  stats.rt.flagMeanErr(),
340  m_nevts,
341  m_firstVmem,
342  m_10evtVmem,
343  m_lastVmem,
350  );
351  if ( 0 == res ) {
352  PMON_WARNING("Problem on python side during finalize() !!");
353  std::abort();
354  }
355  Py_DECREF( res );
356  }
357 
358  // write out data
359  {
360  PyObject* res = PyObject_CallMethod
361  ( m_pySvc,
362  const_cast<char*>("finalize"),
363  const_cast<char*>("") );
364  if ( 0 == res ) {
365  PMON_WARNING("Problem on python side during finalize() !!");
366  std::abort();
367  }
368  Py_DECREF( res );
369  }
370  }
371  Py_XDECREF( m_pySvc );
372 
373  m_pf = true;
374 
375  // Restore working directory
376  std::filesystem::current_path(cwd);
377 
378  //delete m_ntuple; m_ntuple = 0;
381 }
382 
384 
385 
390 {
391  ServiceHandle<IIoComponentMgr> iomgr("IoComponentMgr", name());
392  if (!iomgr.retrieve().isSuccess()) {
393  ATH_MSG_ERROR("Could not retrieve IoComponentMgr !");
394  return StatusCode::FAILURE;
395  }
396 
397  if (!iomgr->io_hasitem(this)) {
398  ATH_MSG_ERROR("IoComponentMgr does not know about myself !");
399  return StatusCode::FAILURE;
400  }
401 
402  std::string stream_name = m_outFileName.value()+".pmon.stream";
403  std::string orig_stream_name = stream_name;
404 
405  if (!iomgr->io_contains(this, stream_name)) {
406  ATH_MSG_ERROR("IoComponentMgr does not know about [" << stream_name << "] !");
407  return StatusCode::FAILURE;
408  }
409  if (!iomgr->io_retrieve(this, stream_name).isSuccess()) {
410  ATH_MSG_ERROR("Could not retrieve new value for [" << stream_name << "] !");
411  return StatusCode::FAILURE;
412  }
413  if (stream_name.empty()) {
414  ATH_MSG_DEBUG("io_reinit called in parent process. No actions required.");
415  return StatusCode::SUCCESS;
416  }
417 
418  // io_retrieve gives us a name like
419  // <amp-root-dir>/<child-pid>/mpid_<worker-id>__<ntuple-name>
420  // but many pieces in perfmon assume <ntuple-name> as a name...
421  // -> take the dirname from that file and append the original-basename
422  m_workerDir = my_dirname(stream_name);
423  stream_name = m_workerDir + "/" + my_basename(orig_stream_name);
424 
425  ATH_MSG_INFO("reopening [" << stream_name << "]...");
426 
427  // re-open the previous file
428  int old_stream = open(orig_stream_name.c_str(), O_RDONLY);
429  if (old_stream < 0) {
430  ATH_MSG_ERROR("could not reopen previously open file ["
431  << orig_stream_name << "] !");
432  return StatusCode::FAILURE;
433  }
434  m_stream = open(stream_name.c_str(),
435  O_WRONLY | O_CREAT,
436  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
437  if (m_stream < 0) {
438  char errbuf[256];
439  strerror_r(errno, errbuf, sizeof(errbuf));
440  ATH_MSG_ERROR("could not reopen [" << stream_name << "]: "
441  << errbuf);
442  close (old_stream);
443  return StatusCode::FAILURE;
444  }
445  // copy the content of the previous file over to this new one...
446  {
447  char line[512];
448  int bytes;
449  while((bytes = read(old_stream, line, sizeof(line))) > 0)
450  write(m_stream, line, bytes);
451  }
452  // close the old stream
453  int close_sc = close(old_stream);
454  if (close_sc < 0) {
455  ATH_MSG_INFO("could not close the re-open old pmon.stream file");
456  }
457  ATH_MSG_INFO("reopening [" << stream_name << "]... [ok]");
458  return StatusCode::SUCCESS;
459 }
461 
463 
464 
469 {
470  ATH_MSG_INFO("closing previously open fd [" << m_stream << "] for the pmon stream...");
471  fflush(NULL); //> flushes all output streams...
472  int close_sc = close(m_stream);
473  if (close_sc < 0) {
474  char errbuf[256];
475  strerror_r(errno, errbuf, sizeof(errbuf));
476  ATH_MSG_ERROR("could not close previously open fd [" << m_stream << "]: "
477  << errbuf);
478  return StatusCode::FAILURE;
479  }
480  m_stream = -1; // reset the fd
481  return StatusCode::SUCCESS;
482 }
484 
485 // Athena Algorithm's Hooks
488 {
489  m_pf = false;
490  if (m_semiDetMonLvl>0)
492 
493  // initialize MsgStream
494  PMON_INFO("Initializing " << name() << "...");
495  PMON_INFO("monitoring level: " << m_monLvl);
496 
497  const std::string stream_name = m_outFileName.value()+".pmon.stream";
498 
499  PMON_INFO("opening pmon-stream file [" << stream_name << "]...");
500  m_stream = open(stream_name.c_str(),
501  O_WRONLY | O_CREAT,
502  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
503 
504  if (m_stream<0) {
505  PMON_ERROR("could not open pmon-stream file ["
506  << stream_name << "] !");
507  return StatusCode::FAILURE;
508  }
509  {
510  // describe data format
511  const char* hdr = "#data format: comp-id idx cpu-fields(4) mem-fields(4)\n";
512  write(m_stream, hdr, strlen(hdr));
513  const char* fmt = "# %d " PMON_COMP_FMT;
514  write(m_stream, fmt, strlen(fmt));
515  }
516 
517  // register all ntuples' blocks...
518  for (std::size_t istep=0, imax=PerfMon::Steps.size();
519  istep != imax;
520  ++istep) {
521  const std::string& step = PerfMon::Steps[istep];
522  m_ntuple.comp.insert(std::make_pair(step, CompStore_t()));
523  }
524  // "io" ntuple
525  {
526  const std::string step = "io";
527  m_ntuple.iocomp.insert(std::make_pair(step, IoCompStore_t()));
528  }
529  // "usr" ntuple
530  {
531  const std::string step = "usr";
532  m_ntuple.comp.insert(std::make_pair(step, CompStore_t()));
533  }
534 
536 
537  PMON_INFO("Retrieving PyPerfMonSvc object...");
538  const std::string moduleName = "PerfMonComps.PyPerfMon";
539  PyObject* module = PyImport_ImportModule( const_cast<char*>(moduleName.c_str()) );
540  if ( !module || !PyModule_Check(module) ) {
541  PMON_ERROR("Could not import [" << moduleName << "] !!");
543  }
544 
545  {
546  PMON_INFO("Retrieving PyPerfMonSvc object...");
547  // retrieve the pmon-py-svc
548  const std::string fctName = "retrieve_pmon_svc";
549  PyObject *py_fct = NULL;
550  py_fct = PyDict_GetItemString(PyModule_GetDict(module),
551  const_cast<char*>(fctName.c_str()));
552  if (!py_fct) {
553  PMON_ERROR("could not retrieve function [" << fctName << "] from "
554  "module [" << moduleName << "] !!");
556  }
557  const std::string pickle_name = m_outFileName.value()+".props.pkl";
558  m_pySvc = PyObject_CallFunction(py_fct,
559  (char*)"s",
560  (char*)pickle_name.c_str());
561  if (!m_pySvc) {
562  PMON_ERROR("problem calling function [" << fctName << "] from "
563  "module [" << moduleName << "] !!");
565  }
566  PMON_INFO("Retrieving PyPerfMonSvc object... [OK]");
567  }
568  // don't need the module anymore
569  Py_DECREF ( module );
570 
571  {
572  PyObject* res = PyObject_CallMethod
573  ( m_pySvc,
574  const_cast<char*>("initialize"),
575  const_cast<char*>("") );
576  if ( 0 == res ) {
577  PMON_WARNING("Problem on python side during initialize() !!");
579  }
580  Py_DECREF( res );
581  }
582 
583  // update our current monitoring state:
585 
586  // make sure the list of algorithm names to be profiled is up-to-date
588  if ( msgLvl(MSG::VERBOSE) ) {
589  std::ostringstream out;
590  out << "[ ";
591  std::copy( m_profiledAlgNames.value().begin(),
592  m_profiledAlgNames.value().end(),
593  std::ostream_iterator<std::string>( out, " " ) );
594  out << "]";
595  PMON_VERBOSE("Algorithms: " << out.str());
596  }
597 
598  // make sure the list of I/O containers to be monitored is up-to-date
600  if ( msgLvl(MSG::VERBOSE) ) {
601  std::ostringstream out;
602  out << "[ ";
603  std::copy( m_ioContainerNames.value().begin(),
604  m_ioContainerNames.value().end(),
605  std::ostream_iterator<std::string>( out, " " ) );
606  out << "]";
607  PMON_VERBOSE("Containers: " << out.str());
608  }
609 
610  // Set to be listener for end-of-event
611  ServiceHandle<IIncidentSvc> incSvc( "IncidentSvc", this->name() );
612  if ( !incSvc.retrieve().isSuccess() ) {
613  PMON_ERROR("Unable to get the IncidentSvc");
614  return StatusCode::FAILURE;
615  }
616  incSvc->addListener( this, IncidentType::SvcPostFinalize );
617 
618  // make sure the correct auditor is configured and running
619  if ( !PerfMon::makeAuditor("Athena::PerfMonAuditor",
620  auditorSvc(),
621  msg() ).isSuccess() ) {
622  PMON_ERROR("Could not register auditor [Athena::PerfMonAuditor] !!");
623  return StatusCode::FAILURE;
624  }
625 
626  startAud( "ini", "PerfMonSlice" );
627  {
628  // register myself with the I/O component manager...
629  ServiceHandle<IIoComponentMgr> iomgr ("IoComponentMgr", name());
630  if ( !iomgr.retrieve().isSuccess() ) {
631  ATH_MSG_ERROR ("could not retrieve I/O component manager !");
632  return StatusCode::FAILURE;
633  }
634  if ( !iomgr->io_register(this).isSuccess() ) {
635  ATH_MSG_ERROR ("could not register with the I/O component manager !");
636  return StatusCode::FAILURE;
637  }
638 
639  // register output file...
640  if ( !iomgr->io_register(this,
642  stream_name).isSuccess() ) {
643  ATH_MSG_WARNING ("could not register file ["
644  << stream_name << "] with the I/O component manager...");
645  return StatusCode::FAILURE;
646  }
647  }
648 
649  {
650  // install the pmon dso logger
651  PyObject* res = PyObject_CallMethod
652  ( m_pySvc,
653  const_cast<char*>("install_pmon_dso_logger"),
654  const_cast<char*>(""),
655  const_cast<char*>(""));
656  if ( 0 == res ) {
657  PMON_WARNING("Problem during pmon-dso-logger installation");
659  }
660 #if PY_MAJOR_VERSION < 3
661  long do_dso = PyInt_AS_LONG(res);
662 #else
663  long do_dso = PyLong_AS_LONG(res);
664 #endif
665  Py_DECREF( res );
666 
667  if (do_dso) {
668  if (0 != ath_dso_cbk_register(&pmon_dso_cbk, (void*)this)) {
669  ATH_MSG_INFO("could not register dso-pmon C-callback");
670  }
671  } else {
672  // nothing to do: dsoMonitoring is disabled.
673  }
674  }
675 
676  startAud( "ini", "PerfMonSvc" );
677  return StatusCode::SUCCESS;
678 }
679 
681 {
682  PMON_INFO("Finalizing " << name() << "...");
683 
685  startAud( "fin", "PerfMonSlice" );
686 
687  return StatusCode::SUCCESS;
688 }
689 
690 // Query the interfaces.
691 // Input: riid, Requested interface ID
692 // ppvInterface, Pointer to requested interface
693 // Return: StatusCode indicating SUCCESS or FAILURE.
694 // N.B. Don't forget to release the interface after use!!!
696 PerfMonSvc::queryInterface(const InterfaceID& riid, void** ppvInterface)
697 {
698  if ( IPerfMonSvc::interfaceID().versionMatch(riid) ) {
699  *ppvInterface = dynamic_cast<IPerfMonSvc*>(this);
700  } else {
701  // Interface is not directly available : try out a base class
702  return Service::queryInterface(riid, ppvInterface);
703  }
704  addRef();
705  return StatusCode::SUCCESS;
706 }
707 
709 // Const methods:
711 
713 std::vector<std::string>
714 PerfMonSvc::components(const std::string& stepName) const
715 {
716  CompTuple_t::const_iterator itr = m_ntuple.comp.find(stepName);
717  if (itr == m_ntuple.comp.end()) {
718  return std::vector<std::string>();
719  }
720 
721  const CompStore_t& store = itr->second;
722 
723  std::vector<std::string> comps;
724  comps.reserve(store.size());
725  for (CompStore_t::const_iterator
726  jtr = store.begin(),
727  jend= store.end();
728  jtr != jend;
729  ++jtr) {
730  comps.push_back(jtr->first);
731  }
732  return comps;
733 }
734 
736 std::vector<std::string>
738 {
739  IoCompTuple_t::const_iterator itr = m_ntuple.iocomp.find("io");
740  if (itr == m_ntuple.iocomp.end()) {
741  return std::vector<std::string>();
742  }
743 
744  const IoCompStore_t& store = itr->second;
745 
746  std::vector<std::string> comps;
747  comps.reserve(store.size());
748  for (IoCompStore_t::const_iterator
749  jtr = store.begin(),
750  jend= store.end();
751  jtr != jend;
752  ++jtr) {
753  comps.push_back(jtr->first);
754  }
755  return comps;
756 }
757 
760 const PerfMon::Component*
761 PerfMonSvc::component(const std::string& stepName,
762  const std::string& compName) const
763 {
764  CompTuple_t::const_iterator itr = m_ntuple.comp.find(stepName);
765  if (itr == m_ntuple.comp.end()) {
766  return 0;
767  }
768 
769  const CompStore_t& store = itr->second;
770  CompStore_t::const_iterator jtr = store.find(compName);
771  if (jtr == store.end()) {
772  return 0;
773  }
774  return &(jtr->second);
775 }
776 
779 PerfMonSvc::io_component(const std::string& compName) const
780 {
781  IoCompTuple_t::const_iterator itr = m_ntuple.iocomp.find("io");
782  if (itr == m_ntuple.iocomp.end()) {
783  return 0;
784  }
785 
786  const IoCompStore_t& store = itr->second;
787  IoCompStore_t::const_iterator jtr = store.find(compName);
788  if (jtr == store.end()) {
789  return 0;
790  }
791  return &(jtr->second);
792 }
793 
795 void
796 PerfMonSvc::domain(const std::string& compName, std::string& domain) const
797 {
798  domain = "N/A";
799 
801 
802  PyObject* db = PyObject_CallMethod
803  ( m_pySvc,
804  const_cast<char*>("domains_db"),
805  NULL );
806  if ( 0 == db ) {
807  PMON_WARNING("Problem on python side for domains_db() !!");
809  }
810 
811  if (!PyDict_Check(db)) {
812  PMON_WARNING("domains_db() did not return a dict");
813  Py_DECREF(db);
815  }
816 
817  PyObject *py_domain = PyDict_GetItemString
818  (db,
819  const_cast<char*>(compName.c_str()));
820  if (!py_domain) {
821  PMON_WARNING("domains_db() has no [" << compName << "] component");
822  Py_DECREF(db);
824  }
825 
826 #if PY_MAJOR_VERSION < 3
827  if (!PyString_Check(py_domain)) {
828  PMON_WARNING("domains_db() returned a non-string for component ["
829  << compName << "]");
830  Py_DECREF(db);
832  }
833 
834  domain = std::string(PyString_AS_STRING(py_domain));
835  Py_DECREF(db);
836 #else
837  if (!PyUnicode_Check(py_domain)) {
838  PMON_WARNING("domains_db() returned a non-unicode for component ["
839  << compName << "]");
840  Py_DECREF(db);
842  }
843 
844  domain = std::string(PyUnicode_AsUTF8(py_domain));
845  Py_DECREF(db);
846 #endif
847 
848  return;
849 }
850 
851 
853 // Non-const methods:
855 
856 void PerfMonSvc::handle( const Incident& inc )
857 {
858  if ( msgLvl(MSG::VERBOSE) ) {
860  << "Entering handle(): "
861  << endmsg
862  << " Incidence type: " << inc.type() << endmsg
863  << " from: " << inc.source() << endmsg;
864  }
865 
866  if ( inc.type() == IncidentType::SvcPostFinalize ) {
867  postFinalize();
868  return;
869  }
870 
871  return;
872 }
873 
874 // IMonitorSvc interface implementation
875 // ======================================
876 
877 void PerfMonSvc::declareInfo( const std::string& /*name*/,
878  const bool& /*var*/,
879  const std::string& /*desc*/,
880  const IInterface* iowner )
881 {
882  const INamedInterface* owner = dynamic_cast<const INamedInterface*>(iowner);
883  if ( !owner ) { throw std::bad_cast();
884  }
885 
886  // const bool *ovar = 0;
887  // ovar = m_ntuple["usr"]->add_block<bool>((owner->name()+"."+name).c_str());
888  // delete ovar;
889  // ovar = &var;
890 
891  return;
892 }
893 
894 void PerfMonSvc::declareInfo( const std::string& /*name*/,
895  const int& /*var*/,
896  const std::string& /*desc*/,
897  const IInterface* iowner )
898 {
899  const INamedInterface* owner = dynamic_cast<const INamedInterface*>(iowner);
900  if ( !owner ) { throw std::bad_cast();
901  }
902 
903  // const int *ovar = 0;
904  // ovar = m_ntuple["usr"]->add_block<int>((owner->name()+"."+name).c_str());
905  // delete ovar;
906  // ovar = &var;
907 
908  return;
909 }
910 
911 void PerfMonSvc::declareInfo( const std::string& /*name*/,
912  const long& /*var*/,
913  const std::string& /*desc*/,
914  const IInterface* iowner )
915 {
916  const INamedInterface* owner = dynamic_cast<const INamedInterface*>(iowner);
917  if ( !owner ) { throw std::bad_cast();
918  }
919 
920  // const long *ovar = 0;
921  // ovar = m_ntuple["usr"]->add_block<long>((owner->name()+"."+name).c_str());
922  // delete ovar;
923  // ovar = &var;
924 
925  return;
926 }
927 
928 void PerfMonSvc::declareInfo( const std::string& /*name*/,
929  const double& /*var*/,
930  const std::string& /*desc*/,
931  const IInterface* iowner )
932 {
933  const INamedInterface* owner = dynamic_cast<const INamedInterface*>(iowner);
934  if ( !owner ) { throw std::bad_cast();
935  }
936 
937  // const double *ovar = 0;
938  // ovar = m_ntuple["usr"]->add_block<double>((owner->name()+"."+name).c_str());
939  // delete ovar;
940  // ovar = &var;
941 
942  return;
943 }
944 
945 void PerfMonSvc::declareInfo( const std::string& /*name*/,
946  const std::string& /*var*/,
947  const std::string& /*desc*/,
948  const IInterface* iowner )
949 {
950  const INamedInterface* owner = dynamic_cast<const INamedInterface*>(iowner);
951  if ( !owner ) { throw std::bad_cast();
952  }
953 
954  // const std::string *ovar = 0;
955  // ovar = m_ntuple["usr"]->add_block<std::string>((owner->name()+"."+name).c_str());
956  // delete ovar;
957  // ovar = &var;
958 
959  return;
960 }
961 
962 void PerfMonSvc::declareInfo( const std::string& /*name*/,
963  const std::pair<double,double>& /*var*/,
964  const std::string& /*desc*/,
965  const IInterface* iowner )
966 {
967  const INamedInterface* owner = dynamic_cast<const INamedInterface*>(iowner);
968  if ( !owner ) { throw std::bad_cast();
969  }
970 
971  // typedef std::pair<double,double> Var_t;
972  // const Var_t *ovar = 0;
973  // ovar = m_ntuple["usr"]->add_block<Var_t>((owner->name()+"."+name).c_str());
974  // delete ovar;
975  // ovar = &var;
976 
977  return;
978 }
979 
980 void PerfMonSvc::declareInfo( const std::string& name,
981  const AIDA::IBaseHistogram* var,
982  const std::string& desc,
983  const IInterface* owner )
984 {
985  std::ostringstream err;
986  err << "PerfMonSvc::declareInfo( "
987  << "name = [" << name << "], "
988  << "hist = [" << var << "], "
989  << "descr = [" << desc << "], "
990  << "owner = [" << owner << "] )\n"
991  << "Not implemented !"
992  << std::endl;
993  msg(MSG::ERROR) << err.str() << endmsg;
994  throw std::runtime_error( err.str() );
995 }
996 
997 void PerfMonSvc::declareInfo( const std::string& name,
998  const std::string& format,
999  const void * var, int size,
1000  const std::string& desc,
1001  const IInterface* owner )
1002 {
1003  std::ostringstream err;
1004  err << "PerfMonSvc::declareInfo( "
1005  << "name = [" << name << "], "
1006  << "fmt = [" << format << "], "
1007  << "var = [" << var << "], "
1008  << "size= [" << size << "], "
1009  << "descr = [" << desc << "], "
1010  << "owner = [" << owner << "] )\n"
1011  << "Not implemented !"
1012  << std::endl;
1013  msg(MSG::ERROR) << err.str() << endmsg;
1014  throw std::runtime_error( err.str() );
1015 }
1016 
1017 void
1018 PerfMonSvc::declareInfo(const std::string& name,
1019  const StatEntity& var,
1020  const std::string& desc,
1021  const IInterface* owner)
1022 {
1023  std::ostringstream err;
1024  err << "PerfMonSvc::declareInfo( "
1025  << "name = [" << name << "], "
1026  << "var = [" << var << "], "
1027  << "descr = [" << desc << "], "
1028  << "owner = [" << owner << "] )\n"
1029  << "Not implemented !"
1030  << std::endl;
1031  msg(MSG::ERROR) << err.str() << endmsg;
1032  throw std::runtime_error( err.str() );
1033 }
1034 
1035 void PerfMonSvc::undeclareInfo( const std::string& name,
1036  const IInterface* iowner )
1037 {
1038  const INamedInterface* owner = dynamic_cast<const INamedInterface*>(iowner);
1039  if ( !owner ) {
1040  msg(MSG::WARNING)
1041  << "Requested to undeclare info from un-registered owner ["
1042  << owner << "] !"
1043  << endmsg;
1044  throw std::bad_cast();
1045  }
1046 
1047  msg(MSG::WARNING)
1048  << "Could not find nor erase MonInfo of name [" << name << "] "
1049  << "registered with owner [" << owner << " (" << owner->name() << ")] !"
1050  << endmsg;
1051  return;
1052 }
1053 
1054 void PerfMonSvc::undeclareAll( const IInterface* iowner )
1055 {
1056  const INamedInterface* owner = dynamic_cast<const INamedInterface*>(iowner);
1057  if ( !owner ) {
1058  msg(MSG::WARNING)
1059  << "Requested to undeclare info from un-registered owner ["
1060  << owner << "] !"
1061  << endmsg;
1062  throw std::bad_cast();
1063  }
1064 
1065  msg(MSG::WARNING)
1066  << "Could not undeclare all infos "
1067  << "registered with owner [" << owner << " (" << owner->name() << ")] !"
1068  << endmsg;
1069 }
1070 
1071  std::set<std::string>* PerfMonSvc::getInfos( const IInterface* /*owner*/ )
1072 {
1073  return 0;
1074 }
1075 
1077 // Non-const methods:
1079 void PerfMonSvc::setupProfiledAlgList( Gaudi::Details::PropertyBase& /*profiledAlgNames*/ )
1080 {
1081  return;
1082 }
1083 
1084 void PerfMonSvc::setupIoContainerList( Gaudi::Details::PropertyBase& /*ioContainerNames*/ )
1085 {
1086 }
1087 
1088 namespace {
1089 const std::string pmon_slice = "PerfMonSlice";
1090 const std::string usr_step_name = "usr";
1091 
1092 inline
1093 bool do_mon(int lvl,
1094  const std::string& stepName,
1095  const std::string& compName)
1096 {
1097  return (lvl < 0 || lvl > 10 ||
1098  compName == pmon_slice ||
1099  stepName == PerfMon::Steps[PerfMon::State::ini] ||
1100  stepName == PerfMon::Steps[PerfMon::State::cbk] ||
1101  stepName == PerfMon::Steps[PerfMon::State::fin] ||
1102  stepName == PerfMon::Steps[PerfMon::State::io] ||
1103  stepName == PerfMon::Steps[PerfMon::State::dso] ||
1104  stepName == usr_step_name);
1105 }
1106 
1107 inline
1108 bool
1109 do_msg_mon(int lvl,
1110  const std::string& stepName,
1111  const std::string& /*compName*/)
1112 {
1113  return
1114  ((lvl < 0 || lvl > 10 ) &&
1115  (stepName == PerfMon::Steps[PerfMon::State::ini] ||
1116  stepName == PerfMon::Steps[PerfMon::State::cbk] ||
1117  stepName == PerfMon::Steps[PerfMon::State::fin] ||
1118  stepName == PerfMon::Steps[PerfMon::State::dso] ||
1119  stepName == PerfMon::Steps[PerfMon::State::io]))
1120  ||
1121  stepName == usr_step_name;
1122 }
1123 
1124 }
1125 
1126 void PerfMonSvc::startAud( const std::string& stepName,
1127  const std::string& compName )
1128 {
1129  // Performing performance-monitoring for BeginEvent
1130  if ( compName == m_compBeginEvent && stepName == "evt" ) {
1131  [[maybe_unused]] static const bool firstEvt = [&] ATLAS_NOT_THREAD_SAFE () {
1132  stopAud( "ini", "PerfMonSlice" );
1133  // capture the number of algorithms - here
1134  ServiceHandle<IAlgManager> mgr("ApplicationMgr", this->name());
1135  m_nalgs = mgr->getAlgorithms().size();
1136  m_ntuple.comp["ini"].clear();
1137  m_ntuple.comp["cbk"].clear();
1138  m_ntuple.comp["preLoadProxies"].clear();
1139  return false;
1140  }();
1141  startAud( "evt", "PerfMonSlice" );
1142  return;
1143  }
1144  else if ( compName == m_compEndEvent && stepName == "evt" ) {
1145  // Avoid mismatched start/stop that leads to bogus measurements
1146  return;
1147  }
1148 
1149  if (m_extraPrintouts) {
1150  double vmem,rss;
1151  PMonSD::get_vmem_rss_kb(vmem,rss);
1152  PMON_INFO("before:/" << stepName << "/" << compName
1153  <<" [vmem="<<vmem/1024.0<<"mb, rss="
1154  <<rss/1024.0<<"mb, malloc="<<PMonSD::get_malloc_kb()/1024.0
1155  <<"mb, wall="<<PMonSD::get_wall_ms()<<"s]"
1156  );
1157  }
1158  PMON_DEBUG("start:/" << stepName << "/" << compName);
1159  if (::do_mon(m_monLvl, stepName, compName)) {
1160  if (stepName == PerfMon::Steps[PerfMon::State::io]) {
1161  //io_startAud(stepName, compName);
1162  } else {
1163  comp_startAud(stepName, compName);
1164  }
1165  }
1166  if (m_pmonsd)
1167  m_pmonsd->startAud(stepName,compName,m_nevts);
1168 
1169  return;
1170 }
1171 
1172 void PerfMonSvc::stopAud( const std::string& stepName,
1173  const std::string& compName )
1174 {
1175  // Performing performance-monitoring for EndEvent
1176  if ( compName == m_compEndEvent && stepName == "evt" ) {
1177  // make sure we update the data from declareInfo...
1178  poll();
1179  stopAud( "evt", "PerfMonSlice" );
1180  return;
1181  }
1182  else if ( compName == m_compBeginEvent && stepName == "evt" ) {
1183  // Avoid mismatched start/stop that leads to bogus measurements
1184  return;
1185  }
1186 
1187  if (m_pmonsd)
1188  m_pmonsd->stopAud(stepName,compName,m_nevts);
1189 
1190  if (::do_mon(m_monLvl, stepName, compName)) {
1191  if (stepName == PerfMon::Steps[PerfMon::State::io]) {
1192  //io_stopAud(stepName, compName);
1193  } else {
1194  comp_stopAud(stepName, compName);
1195  }
1196  }
1197  if (m_extraPrintouts) {
1198  double vmem,rss;
1199  PMonSD::get_vmem_rss_kb(vmem,rss);
1200  PMON_INFO("after:/" << stepName << "/" << compName
1201  <<" [vmem="<<vmem/1024.0<<"mb, rss="
1202  <<rss/1024.0<<"mb, malloc="<<PMonSD::get_malloc_kb()/1024.0
1203  <<"mb, wall="<<PMonSD::get_wall_ms()<<"s]"
1204  );
1205  }
1206  return;
1207 }
1208 
1210 {
1211  // Tuple_t::iterator itr = m_ntuple.find("usr");
1212  // if (itr != m_ntuple.end()) {
1213  // ntlib::Tuple nt = itr->second;
1214  // nt->write();
1215  // }
1216 
1217  return;
1218 }
1219 
1222 void
1223 PerfMonSvc::comp_startAud(const std::string& stepName,
1224  const std::string& compName)
1225 {
1226  PerfMon::Component& c = m_ntuple.comp[stepName][compName];
1227  ::capture(0, c);
1228 
1229  // we still want to double-count dso's and callbacks since they don't appear in the summary file (maybe they should?)
1230  const bool step_displayed_in_summary(PerfMon::Steps[PerfMon::State::evt] == stepName ||
1231  PerfMon::Steps[PerfMon::State::ini] == stepName ||
1232  PerfMon::Steps[PerfMon::State::fin] == stepName );
1233  if (step_displayed_in_summary && m_enableDblCountingCorrection) {
1234  c.mem.vmem[0] -= m_corrector.vmem;
1235  c.mem.rss [0] -= m_corrector.rss;
1236  c.mem.mall[0] -= m_corrector.mall;
1237  c.mem.nmall[0]-= m_corrector.nmall;
1238  c.mem.nfree[0]-= m_corrector.nfree;
1239  }
1240 
1241  char* buf = 0;
1242  int buf_sz = asprintf
1243  (&buf,
1244  PMON_COMP_FMT,
1245  stepName.c_str(), compName.c_str(),
1246  0LU,
1247  c.cpu.user, c.cpu.sys, c.cpu.real, c.cpu.rt_cpu,
1248  c.mem.vmem[0], c.mem.rss[0], c.mem.mall[0],
1249  ((unsigned long)c.mem.nmall[0]),
1250  ((unsigned long)c.mem.nfree[0])
1251  );
1252  // In AthenaMP, we need to re-open the pmon stream
1253  // before we write the results that come from the
1254  // finalization of the mother process. Otherwise,
1255  // we shouldn't be going into this block...
1256  if (m_stream<0) {
1257  const std::string stream_name = m_outFileName.value()+".pmon.stream";
1258 
1259  PMON_INFO("re-opening pmon-stream file [" << stream_name << "]...");
1260  m_stream = open(stream_name.c_str(),
1261  O_WRONLY | O_APPEND,
1262  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
1263 
1264  if (m_stream<0) {
1265  PMON_ERROR("could not re-open pmon-stream file ["
1266  << stream_name << "] !");
1267  }
1268  }
1269  write(m_stream, buf, buf_sz);
1270  free(buf);
1271 
1272  return;
1273 }
1274 
1275 void
1276 PerfMonSvc::comp_stopAud(const std::string& stepName,
1277  const std::string& compName)
1278 {
1279  PerfMon::Component& c = m_ntuple.comp[stepName][compName];
1280  ::capture(1, c);
1281 
1282  bool alertVmem = false;
1283  if (compName == pmon_slice) {
1284  if (stepName == PerfMon::Steps[PerfMon::State::evt]) {
1285  ++m_nevts;
1286  // vmems are already in kb but m_deltaVMemAlert is in Mb...
1287  float deltaVmem= (c.mem.vmem[1] - m_lastVmem);
1288  if (deltaVmem >= (m_deltaVMemAlert/1024.)) {
1289  alertVmem = true;
1290  m_lastVmem = c.mem.vmem[1];
1291  }
1292  }
1293  if (m_nevts > 1 ||
1294  (stepName == PerfMon::Steps[PerfMon::State::ini] ||
1295  stepName == PerfMon::Steps[PerfMon::State::fin])) {
1296  Stats_t& stats = m_stats[stepName];
1297  stats.cpu += c.cpu.user + c.cpu.sys;
1298  stats.cpu_user += c.cpu.user;
1299  stats.cpu_sys += c.cpu.sys;
1300  stats.real += c.cpu.real;
1301  stats.rt += c.cpu.rt_cpu;
1302  stats.vmem += c.mem.vmem[1];
1303  stats.malloc += c.mem.mall[1] - c.mem.mall[0];
1304  stats.nalloc += c.mem.nmall[1]- c.mem.nmall[0];
1305  }
1306 
1307  if ( m_nevts>=2 && stepName == PerfMon::Steps[PerfMon::State::evt]) {
1311  }
1312  if ( 1<=m_nevts && m_nevts < 11 &&
1313  stepName == PerfMon::Steps[PerfMon::State::evt]) {
1314  switch (m_nevts-1) {
1315  case 0:
1316  // update first-evt high-water mark
1318  break;
1319  case 9:
1320  // update 10th-evt high-water mark
1322  break;
1323  default:
1324  break;
1325  }
1326  }
1327  }
1328 
1329  if (alertVmem ||
1330  (m_nevts <= 10 && compName == pmon_slice) ||
1331  ::do_msg_mon(m_monLvl, stepName, compName))
1332  {
1333  char* buf = 0;
1334  char* hdr = 0;
1335  asprintf(&hdr, "[%s] ", stepName.c_str());
1336  //TK: Coverity makes the good point here that alertVmem is only
1337  //true for "evt" step, so is_evt is always true and we get dead
1338  //code below.
1339  //SB: I actually think coverity is a bit confused b/c I do see
1340  // printouts like so:
1341  // PerfMonSvc: INFO (null)cpu= ...
1342  // instead of e.g.:
1343  // PerfMonSvc: INFO [dso] cpu= ...
1344  // which would tend to confirm is_evt is not always true.
1345  const bool is_evt = (stepName == PerfMon::Steps[PerfMon::State::evt]);
1346  if (is_evt) {
1347  free(hdr); hdr = 0;
1348  asprintf(&hdr, "[evt: %3lu] ", (m_nevts>0 ? m_nevts-1 : 0));
1349  }
1350  asprintf(&buf,
1351  "%s" \
1352  "cpu=%8.3f ms " \
1353  "vmem=%8.3f Mb " \
1354  "dvmem=%8.3f Mb " \
1355  "alloc= +%lu -%lu %8.3f kb " \
1356  " => [/%s/%s]",
1357  hdr,
1358  c.cpu.user+c.cpu.sys,
1359  c.mem.vmem[1]/1024.,
1360  c.mem.dVmem()/1024.,
1361  ((unsigned long)c.mem.dNMall()),
1362  ((unsigned long)c.mem.dNFree()),
1363  (float)c.mem.dMall(),
1364  stepName.c_str(), compName.c_str()
1365  );
1366  PMON_INFO(buf);
1367  free(hdr);
1368  free(buf);
1369  }
1370  {
1371 
1372  // we still want to double-count dso's and callbacks since they don't appear in the summary file (maybe they should?)
1373  const bool step_displayed_in_summary(PerfMon::Steps[PerfMon::State::evt] == stepName ||
1374  PerfMon::Steps[PerfMon::State::ini] == stepName ||
1375  PerfMon::Steps[PerfMon::State::fin] == stepName );
1376  if (step_displayed_in_summary && m_enableDblCountingCorrection) {
1377  c.mem.vmem[1] -= m_corrector.vmem;
1378  c.mem.rss [1] -= m_corrector.rss;
1379  c.mem.mall[1] -= m_corrector.mall;
1380  c.mem.nmall[1]-= m_corrector.nmall;
1381  c.mem.nfree[1]-= m_corrector.nfree;
1382 
1383  m_corrector.vmem += (c.mem.vmem[1] - c.mem.vmem[0]);
1384  m_corrector.rss += (c.mem.rss[1] - c.mem.rss [0]);
1385  m_corrector.mall += (c.mem.mall[1] - c.mem.mall[0]);
1386  m_corrector.nmall += (c.mem.nmall[1] - c.mem.nmall[0]);
1387  m_corrector.nfree += (c.mem.nfree[1] - c.mem.nfree[0]);
1388  }
1389 
1390  char* buf = 0;
1391  int buf_sz = asprintf
1392  (&buf,
1393  PMON_COMP_FMT,
1394  stepName.c_str(), compName.c_str(),
1395  1LU,
1396  c.cpu.user, c.cpu.sys, c.cpu.real, c.cpu.rt_cpu,
1397  c.mem.vmem[1], c.mem.rss[1], c.mem.mall[1],
1398  ((unsigned long)c.mem.nmall[1]),
1399  ((unsigned long)c.mem.nfree[1])
1400  );
1401  write(m_stream, buf, buf_sz);
1402  free(buf);
1403  }
1404 
1405  if (stepName == PerfMon::Steps[PerfMon::State::evt] &&
1406  compName == pmon_slice) {
1407  // trigger the post event I/O monitoring...
1408  do_io_mon();
1409  }
1410 }
1411 
1412 void
1414 {
1415  const std::vector<std::string>& ionames = m_ioContainerNames.value();
1416  for (std::size_t i = 0, imax = ionames.size();
1417  i != imax;
1418  ++i) {
1419  const std::string& ioname = ionames[i];
1420  const std::string p2t = std::string("cObj_")+ioname;
1421  const std::string p2tr= std::string("cObjR_")+ioname;
1422  const std::string t2p = std::string("cRep_")+ioname;
1423 
1424  PerfMon::IoContainer& c = m_ntuple.iocomp["io"][ioname];
1425 
1426  // read
1427  c.r.user = (float)m_chrono->chronoDelta(p2t, IChronoStatSvc::USER);
1428  c.r.sys = (float)m_chrono->chronoDelta(p2t, IChronoStatSvc::KERNEL);
1429  c.r.real = (float)m_chrono->chronoDelta(p2t, IChronoStatSvc::ELAPSED);
1430  //c.r.rt_cpu = 0.;
1431 
1432  // ROOT-read
1433  c.rr.user = (float)m_chrono->chronoDelta(p2tr, IChronoStatSvc::USER);
1434  c.rr.sys = (float)m_chrono->chronoDelta(p2tr, IChronoStatSvc::KERNEL);
1435  c.rr.real = (float)m_chrono->chronoDelta(p2tr, IChronoStatSvc::ELAPSED);
1436  //c.rr.rt_cpu = 0.;
1437 
1438  // write
1439  c.w.user = (float)m_chrono->chronoDelta(t2p, IChronoStatSvc::USER);
1440  c.w.sys = (float)m_chrono->chronoDelta(t2p, IChronoStatSvc::KERNEL);
1441  c.w.real = (float)m_chrono->chronoDelta(t2p, IChronoStatSvc::ELAPSED);
1442  //c.w.rt_cpu = 0.;
1443 
1444  char* buf = 0;
1445  int buf_sz = asprintf
1446  (&buf,
1448  "io", ioname.c_str(),
1449  c.r.user, c.r.sys, c.r.real, c.r.rt_cpu,
1450  c.rr.user, c.rr.sys, c.rr.real, c.rr.rt_cpu,
1451  c.w.user, c.w.sys, c.w.real, c.w.rt_cpu
1452  );
1453  write(m_stream, buf, buf_sz);
1454  free(buf);
1455  } //> loop over io-containers
1456 
1457  PerfMon::IoContainer& c = m_ntuple.iocomp["io"]["PerfMonSliceIo"];
1458  const std::string ioname = "commitOutput";
1459  c.w.user = (float)m_chrono->chronoDelta(ioname, IChronoStatSvc::USER);
1460  c.w.sys = (float)m_chrono->chronoDelta(ioname, IChronoStatSvc::KERNEL);
1461  c.w.real = (float)m_chrono->chronoDelta(ioname, IChronoStatSvc::ELAPSED);
1462 
1463  {
1464  char* buf = 0;
1465  int buf_sz = asprintf
1466  (&buf,
1468  "io", "PerfMonSliceIo",
1469  c.r.user, c.r.sys, c.r.real, c.r.rt_cpu,
1470  c.rr.user, c.rr.sys, c.rr.real, c.rr.rt_cpu,
1471  c.w.user, c.w.sys, c.w.real, c.w.rt_cpu
1472  );
1473  write(m_stream, buf, buf_sz);
1474  free(buf);
1475  }
1476  return;
1477 }
1478 
1480 // Private data:
1482 
1483 #include <fstream>
1484 #include <sstream>
1485 #include "GaudiKernel/Timing.h"
1486 #ifdef __APPLE__
1487 #include <mach/task.h>
1488 #include <mach/mach_init.h>
1489 #endif
1490 
1492 namespace {
1493 
1494  // const System::TimeType MyUnit = System::microSec;
1495  const System::TimeType MyUnit = System::milliSec;
1496  void capture(int idx, PerfMon::Component& c)
1497  {
1498  // capture cpu data
1499  PerfMon::Cpu& cpu = c.cpu;
1500  if (idx==0) {
1501  c = PerfMon::Component();
1502  }
1503  cpu.user = static_cast<float>(System::userTime (MyUnit)) - cpu.user;
1504  cpu.sys = static_cast<float>(System::kernelTime (MyUnit)) - cpu.sys;
1505  cpu.real = static_cast<float>(System::ellapsedTime(MyUnit)) - cpu.real;
1506  cpu.rt_cpu= PerfMon::rt_cpu() - cpu.rt_cpu; //> in millisecs
1507 
1508  // capture mem data
1509  PerfMon::Mem& mem = c.mem;
1511  static const long pg_size = sysconf(_SC_PAGESIZE);
1512  mem.vmem[idx] = static_cast<float>(s.vm_pages * pg_size / (float)Units::kb);
1513  mem.rss[idx] = static_cast<float>(s.rss_pages* pg_size / (float)Units::kb);
1514  mem.mall[idx] = static_cast<float>(PerfMon::MemStats::nbytes()/Units::kb);
1515  mem.nmall[idx]= static_cast<float>(PerfMon::MemStats::nmallocs());
1516  mem.nfree[idx]= static_cast<float>(PerfMon::MemStats::nfrees());
1517  }
1518 
1519  int
1520  pmon_dso_cbk ATLAS_NOT_THREAD_SAFE (const struct ath_dso_event *evt, void *userdata)
1521  {
1522  if (userdata) {
1523  PerfMonSvc *svc = (PerfMonSvc*)userdata;
1524  const std::string compName(evt->fname ? evt->fname : "NULL");
1525  if (evt->step == 0) {
1526  svc->startAud(PerfMon::Steps[PerfMon::State::dso], compName);
1527  } else if (evt->step == 1) {
1528  svc->stopAud(PerfMon::Steps[PerfMon::State::dso], compName);
1529  } else {
1530  // fallthrough.
1531  // FIXME: warn ?
1532  }
1533  }
1534  return 0;
1535  }
1536 
1537 }
PerfMonSvc::m_shelveFileName
StringProperty m_shelveFileName
Name of the shelve file containing jobo metadata.
Definition: PerfMonSvc.h:287
PerfMonSvc::m_deltaVMemAlert
DoubleProperty m_deltaVMemAlert
Maximum allowed variation of virtual memory (in bytes) between last print-out and current vmem value,...
Definition: PerfMonSvc.h:266
read
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
Definition: openCoraCool.cxx:569
PerfMonSvc::m_jobStartJiffies
std::string m_jobStartJiffies
(needed as a property to survive athena.py –drop-and-reload
Definition: PerfMonSvc.h:293
RootUtils::PyException
CPyCppyy::PyException PyException
Definition: Utility.h:24
PerfMon::Cpu::sys
float sys
Definition: DataModel.h:39
IPerfMonSvc::setMonState
void setMonState(PerfMon::State::Type step)
set the current state of the Gaudi's FSM
Definition: IPerfMonSvc.h:184
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
PMonSD::SemiDetHelper
Definition: SemiDetHelper.h:50
AddEmptyComponent.compName
compName
Definition: AddEmptyComponent.py:32
PerfMon::Tuple::IoCompTuple_t
std::unordered_map< std::string, IoCompStore_t > IoCompTuple_t
Definition: PerfMonSvc.h:54
PMON_WARNING
#define PMON_WARNING(x)
Definition: PerfMonSvc.cxx:111
checkFileSG.line
line
Definition: checkFileSG.py:75
PerfMon::Mem
Definition: DataModel.h:45
PerfMonSvc::CgHandler::vmem
float vmem
Definition: PerfMonSvc.h:342
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
PerfMonSvc::CgHandler::mall
float mall
Definition: PerfMonSvc.h:344
PerfMonSvc::m_enableDblCountingCorrection
BooleanProperty m_enableDblCountingCorrection
switch to enable or not the on-the-fly double-counting correction
Definition: PerfMonSvc.h:281
PerfMonSvc::m_stats
StatStore_t m_stats
Definition: PerfMonSvc.h:337
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:126
PerfMonSvc.h
vtune_athena.format
format
Definition: vtune_athena.py:14
PyAthena::throw_py_exception
void throw_py_exception(bool display=true)
helper function to capture the boilerplate code for user friendly stack trace display
Definition: PyAthenaUtils.cxx:134
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PerfMon::LinFitSglPass::addPoint
void addPoint(const double &, const double &)
Definition: LinFitSglPass.h:56
PerfMonSvc::postFinalize
void postFinalize()
Definition: PerfMonSvc.cxx:269
PerfMon::makeAuditor
StatusCode makeAuditor(const std::string &audName, IAuditorSvc *audSvc, MsgStream &msg)
simple function to factorize boring things such as asking the AuditorSvc if an auditor is there (and ...
Definition: PerfMonUtils.cxx:32
PerfMonSvc::m_compBeginEvent
Gaudi::Property< std::string > m_compBeginEvent
Definition: PerfMonSvc.h:368
PerfMonSvc::stopAud
void stopAud(const std::string &stepName, const std::string &compName) override
Stop collecting monitoring data for a given component, for a given step of the Gaudi FSM.
Definition: PerfMonSvc.cxx:1172
PerfMonSvc::m_pf
bool m_pf
Definition: PerfMonSvc.h:357
PerfMonSvc::io_components
virtual std::vector< std::string > io_components() const override
return the list of io-components' names
Definition: PerfMonSvc.cxx:737
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
PerfMonSvc::undeclareInfo
virtual void undeclareInfo(const std::string &name, const IInterface *owner) override
Undeclare monitoring information.
Definition: PerfMonSvc.cxx:1035
PerfMonSvc::m_pmonsd
PMonSD::SemiDetHelper * m_pmonsd
Definition: PerfMonSvc.h:355
PerfMonSvc::initialize
virtual StatusCode initialize() override
Gaudi Service Implementation.
Definition: PerfMonSvc.cxx:487
IoCompTuple_t
PerfMon::Tuple::IoCompTuple_t IoCompTuple_t
Definition: PerfMonSvc.cxx:95
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
PerfMonSvc::CgHandler::rss
float rss
Definition: PerfMonSvc.h:343
PerfMonSvc::handle
virtual void handle(const Incident &incident) override
incident service handle for EndEvent
Definition: PerfMonSvc.cxx:856
PerfMonAuditor.h
dirname
std::string dirname(std::string name)
Definition: utils.cxx:200
pool::WRITE
@ WRITE
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:72
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
PerfMon::Tuple::IoCompStore_t
std::unordered_map< std::string, PerfMon::IoContainer > IoCompStore_t
Definition: PerfMonSvc.h:51
PerfMon::Cpu::user
float user
Definition: DataModel.h:38
PerfMonSvc::comp_startAud
void comp_startAud(const std::string &stepName, const std::string &compName)
start collection monitoring cpu+mem data for a given component
Definition: PerfMonSvc.cxx:1223
PerfMonSvc::components
virtual std::vector< std::string > components(const std::string &stepName) const override
return the list of components' names for a given step
Definition: PerfMonSvc.cxx:714
AthCommonMsg< Service >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
SemiDetHelper.h
PerfMonSvc::component
virtual const PerfMon::Component * component(const std::string &stepName, const std::string &compName) const override
retrieve the monitored value for the component compName and for the step stepName (ini,...
Definition: PerfMonSvc.cxx:761
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
PMonSD::get_wall_ms
double get_wall_ms()
Definition: SemiDetMisc.h:628
PerfMonSvc::undeclareAll
virtual void undeclareAll(const IInterface *owner) override
Undeclare monitoring information.
Definition: PerfMonSvc.cxx:1054
PerfMon::Mem::rss
float rss[2]
Definition: DataModel.h:56
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
PerfMonSvc::io_reinit
virtual StatusCode io_reinit() override final
IIoComponent interface
Definition: PerfMonSvc.cxx:389
PerfMonSvc::m_extraPrintouts
bool m_extraPrintouts
Definition: PerfMonSvc.h:296
PerfMonSvc::m_semiDetMonLvl
int m_semiDetMonLvl
Level of semi-detailed monitoring.
Definition: PerfMonSvc.h:290
PerfMonSvc::CgHandler::nmall
float nmall
Definition: PerfMonSvc.h:345
RootUtils::PyGILStateEnsure
Definition: PyAthenaGILStateEnsure.h:20
PerfMonSvc::m_nevts
long m_nevts
number of events processed during the monitored job
Definition: PerfMonSvc.h:321
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
PerfMonSvc::io_finalize
virtual StatusCode io_finalize() override final
IIoComponent interface
Definition: PerfMonSvc.cxx:468
PerfMonSvc::startAud
void startAud(const std::string &stepName, const std::string &compName) override
Start collecting monitoring data for a given component, for a given step of the Gaudi FSM.
Definition: PerfMonSvc.cxx:1126
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
python.PyAthena.module
module
Definition: PyAthena.py:134
PerfMonSvc::poll
void poll()
loop over user-declared variables (via the IMonitorSvc interface) and poll the data
Definition: PerfMonSvc.cxx:1209
PerfMonSvc::m_chrono
ServiceHandle< IChronoStatSvc > m_chrono
handle to the chronostat service
Definition: PerfMonSvc.h:262
PerfMonSvc::domain
virtual void domain(const std::string &compName, std::string &domain) const override
retrieve the domain name for a given component compName
Definition: PerfMonSvc.cxx:796
PerfMon::State::dso
@ dso
Definition: PerfMonDefs.h:35
PerfMonSvc
Definition: PerfMonSvc.h:67
AthDsoCbk.h
CompTuple_t
PerfMon::Tuple::CompTuple_t CompTuple_t
Definition: PerfMonSvc.cxx:94
PMON_DEBUG
#define PMON_DEBUG(x)
Definition: PerfMonSvc.cxx:109
CaloCondBlobAlgs_fillNoiseFromASCII.desc
desc
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:54
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
PMonSD::SemiDetHelper::startAud
void startAud(const std::string &stepName, const std::string &compName, unsigned val_nevts)
Definition: SemiDetHelper.cxx:93
PerfMon::Tuple::CompTuple_t
std::unordered_map< std::string, CompStore_t > CompTuple_t
Definition: PerfMonSvc.h:53
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
PerfMon::Mem::mall
float mall[2]
Definition: DataModel.h:57
lumiFormat.i
int i
Definition: lumiFormat.py:92
PerfMon::State::io
@ io
Definition: PerfMonDefs.h:34
PerfMonSvc::declareInfo
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner) override
Declare monitoring information.
Definition: PerfMonSvc.cxx:877
PerfMon::MemStats::nfrees
static unsigned long long nfrees()
return the number of times free has been called so far
Definition: MemStatsHooks.h:71
PMON_ERROR
#define PMON_ERROR(x)
Definition: PerfMonSvc.cxx:112
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthService
Definition: AthService.h:32
PerfMonSvc::m_pySvc
PyObject * m_pySvc
Pointer to the PyObject doing the real work.
Definition: PerfMonSvc.h:259
PerfMonSvc::m_firstVmem
float m_firstVmem
first event vmem
Definition: PerfMonSvc.h:302
ath_dso_cbk_register
int ath_dso_cbk_register(ath_dso_event_cbk_t cbk, void *userdata)
python.ByteStreamConfig.write
def write
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:248
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
PerfMonSvc::getInfos
virtual std::set< std::string > * getInfos(const IInterface *owner) override
Get the names for all declared monitoring informations for a given owener.
Definition: PerfMonSvc.cxx:1071
PerfMonUtils.h
PerfMonSvc::m_outFileName
StringProperty m_outFileName
Name of the output file to hold performance data.
Definition: PerfMonSvc.h:278
PerfMon::Component
Definition: DataModel.h:73
PerfMon::Tuple
Definition: PerfMonSvc.h:49
PerfMonSvc::m_vmemfit_evt101plus
PerfMon::LinFitSglPass m_vmemfit_evt101plus
Definition: PerfMonSvc.h:312
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
imax
int imax(int i, int j)
Definition: TileLaserTimingTool.cxx:33
pyroot.display
display
Definition: pyroot.py:44
PerfMon::LinFitSglPass::nPoints
unsigned nPoints() const
Definition: LinFitSglPass.h:31
PerfMon::rt_cpu
float rt_cpu()
Definition: DataModel.h:25
PerfMon::Cpu::real
float real
Definition: DataModel.h:40
PMON_VERBOSE
#define PMON_VERBOSE(x)
Definition: PerfMonSvc.cxx:108
PerfMonSvc::~PerfMonSvc
virtual ~PerfMonSvc()
Destructor:
Definition: PerfMonSvc.cxx:260
PerfMonSvc::setupIoContainerList
void setupIoContainerList(Gaudi::Details::PropertyBase &ioContainerNames)
callback to synchronize the list of I/O containers to be monitored
Definition: PerfMonSvc.cxx:1084
Athena::Units
Definition: Units.h:45
PerfMonSvc::m_ioContainerNames
StringArrayProperty m_ioContainerNames
List of containers for which one wants to gather I/O data.
Definition: PerfMonSvc.h:275
PerfMon::Tuple::CompStore_t
std::unordered_map< std::string, PerfMon::Component > CompStore_t
Definition: PerfMonSvc.h:50
PerfMonSvc::m_profiledAlgNames
StringArrayProperty m_profiledAlgNames
List of algorithms to be profiled.
Definition: PerfMonSvc.h:270
PerfMonSvc::m_vmemfit_evt21to100
PerfMon::LinFitSglPass m_vmemfit_evt21to100
Definition: PerfMonSvc.h:311
PerfMon::State::cbk
@ cbk
Definition: PerfMonDefs.h:33
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
PerfMonSvc::m_stream
int m_stream
pmon-stream data file descriptor
Definition: PerfMonSvc.h:315
PerfMonSvc::PerfMonSvc
PerfMonSvc()
Default constructor:
PerfMonSvc::setupProfiledAlgList
void setupProfiledAlgList(Gaudi::Details::PropertyBase &profiledAlgNames)
callback to synchronize the list of algorithms to be profiled
Definition: PerfMonSvc.cxx:1079
athena_statm
Definition: read_athena_statm.h:13
read_athena_statm.h
PerfMon::Cpu
Definition: DataModel.h:36
PerfMon::MemStats::nbytes
static unsigned long long nbytes()
return the number of bytes allocated so far
Definition: MemStatsHooks.h:67
PerfMon::Tuple::iocomp
IoCompTuple_t iocomp
Definition: PerfMonSvc.h:57
PerfMonSvc::Stats_t
Definition: PerfMonSvc.h:326
IPerfMonSvc
Definition: IPerfMonSvc.h:38
read_athena_statm
struct athena_statm read_athena_statm()
Definition: read_athena_statm.cxx:15
PerfMonSvc::m_10evtVmem
float m_10evtVmem
10th-event vmem
Definition: PerfMonSvc.h:305
PerfMon::Cpu::rt_cpu
float rt_cpu
Definition: DataModel.h:41
PerfMon::Mem::nmall
float nmall[2]
Definition: DataModel.h:58
PerfMonSvc::m_lastVmem
float m_lastVmem
last event vmem
Definition: PerfMonSvc.h:308
Trk::open
@ open
Definition: BinningType.h:40
cwd
std::string cwd
Definition: listroot.cxx:38
PerfMonSvc::comp_stopAud
void comp_stopAud(const std::string &stepName, const std::string &compName)
stop collection monitoring cpu+mem data for a given component
Definition: PerfMonSvc.cxx:1276
PerfMonSvc::io_component
virtual const PerfMon::IoContainer * io_component(const std::string &compName) const override
retrieve the I/O monitored value for the I/O component compName
Definition: PerfMonSvc.cxx:779
PMON_IOCOMP_FMT
#define PMON_IOCOMP_FMT
Definition: PerfMonSvc.cxx:81
PerfMon::IoContainer
Definition: DataModel.h:67
fmt
PerfMonSvc::CgHandler::nfree
float nfree
Definition: PerfMonSvc.h:346
MemStatsHooks.h
PerfMonSvc::m_workerDir
std::string m_workerDir
Worker directory in athenaMP.
Definition: PerfMonSvc.h:318
IDictLoaderSvc.h
PerfMon::State::fin
@ fin
Definition: PerfMonDefs.h:32
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
PerfMon::Mem::nfree
float nfree[2]
Definition: DataModel.h:59
lwtDev::Component
Component
Definition: NNLayerConfig.h:25
ath_dso_event
-*- C -*- AthDsoCbk.h Header file for the dso callbacks api Author: S.Binetbinet@cern....
Definition: AthDsoCbk.h:22
PerfMonSvc::m_vmemfit_evt2to20
PerfMon::LinFitSglPass m_vmemfit_evt2to20
Definition: PerfMonSvc.h:310
DataModel.h
PerfMon::Mem::vmem
float vmem[2]
Definition: DataModel.h:55
PMON_INFO
#define PMON_INFO(x)
Definition: PerfMonSvc.cxx:110
PMonSD::get_vmem_rss_kb
void get_vmem_rss_kb(double &vmem, double &rss, bool vmemonly=false)
Definition: SemiDetMisc.h:447
AthCommonMsg< Service >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
PerfMon::LinFitSglPass::slope
double slope() const
Definition: LinFitSglPass.h:75
PerfMonSvc::m_compEndEvent
Gaudi::Property< std::string > m_compEndEvent
Definition: PerfMonSvc.h:372
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
PerfMonSvc::do_io_mon
void do_io_mon()
collect I/O monitoring data
Definition: PerfMonSvc.cxx:1413
PMON_COMP_FMT
#define PMON_COMP_FMT
Definition: PerfMonSvc.cxx:71
PyAthenaGILStateEnsure.h
LArCellBinning.step
step
Definition: LArCellBinning.py:158
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
dq_defect_create_virtual_defects.dname
dname
Definition: dq_defect_create_virtual_defects.py:71
PerfMonSvc::finalize
virtual StatusCode finalize() override
Definition: PerfMonSvc.cxx:680
calibdata.copy
bool copy
Definition: calibdata.py:27
Units::Mb
static const int Mb
Definition: PerfMonSvc.cxx:159
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
PerfMonSvc::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvInterface) override
Definition: PerfMonSvc.cxx:696
CompStore_t
PerfMon::Tuple::CompStore_t CompStore_t
Definition: PerfMonSvc.cxx:92
PerfMonSvc::m_corrector
CgHandler m_corrector
Definition: PerfMonSvc.h:352
checker_macros.h
Define macros for attributes used to control the static checker.
PerfMon::MemStats::nmallocs
static unsigned long long nmallocs()
return the number of times malloc has been called so far
Definition: MemStatsHooks.h:69
PyObject
_object PyObject
Definition: IPyComponent.h:26
PMonSD::SemiDetHelper::stopAud
void stopAud(const std::string &stepName, const std::string &compName, unsigned val_nevts)
Definition: SemiDetHelper.cxx:123
python.compressB64.c
def c
Definition: compressB64.py:93
IoCompStore_t
PerfMon::Tuple::IoCompStore_t IoCompStore_t
Definition: PerfMonSvc.cxx:93
PerfMon::State::ini
@ ini
Definition: PerfMonDefs.h:29
readCCLHist.float
float
Definition: readCCLHist.py:83
PMonSD::SemiDetHelper::report
bool report(const std::string &file, const std::string &info_full_output_inside, bool stdout_uncollapsed)
Definition: SemiDetHelper.cxx:341
Units::kb
static const int kb
Definition: PerfMonSvc.cxx:158
PerfMonSvc::m_monLvl
int m_monLvl
level of granularity for monitoring
Definition: PerfMonSvc.h:284
PerfMonSvc::m_nalgs
std::size_t m_nalgs
number of algorithms the monitored job ran
Definition: PerfMonSvc.h:324
PerfMon::Tuple::comp
CompTuple_t comp
Definition: PerfMonSvc.h:56
IPerfMonSvc::interfaceID
static const InterfaceID & interfaceID()
Definition: IPerfMonSvc.h:200
PerfMonSvc::m_ntuple
PerfMon::Tuple m_ntuple
tuple of data (step->component[name->perf-data])
Definition: PerfMonSvc.h:299
PerfMon::State::evt
@ evt
Definition: PerfMonDefs.h:31
Tuple
PerfMon::Tuple Tuple
Definition: PerfMonSvc.cxx:91
ServiceHandle< IIoComponentMgr >
beamspotman.basename
basename
Definition: beamspotman.py:640