ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
PerfMonSvc Class Reference

#include <PerfMonSvc.h>

Inheritance diagram for PerfMonSvc:
Collaboration diagram for PerfMonSvc:

Classes

struct  CgHandler
 
struct  Stats_t
 

Public Member Functions

 PerfMonSvc (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor with parameters: More...
 
virtual ~PerfMonSvc ()
 Destructor: More...
 
virtual StatusCode initialize () override
 Gaudi Service Implementation. More...
 
virtual StatusCode finalize () override
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface) override
 
virtual StatusCode io_reinit () override final
 IIoComponent interface More...
 
virtual StatusCode io_finalize () override final
 IIoComponent interface More...
 
virtual std::vector< std::string > components (const std::string &stepName) const override
 return the list of components' names for a given step More...
 
virtual std::vector< std::string > io_components () const override
 return the list of io-components' names More...
 
virtual const PerfMon::Componentcomponent (const std::string &stepName, const std::string &compName) const override
 retrieve the monitored value for the component compName and for the step stepName (ini,evt,fin,cbk,...) More...
 
virtual const PerfMon::IoContainerio_component (const std::string &compName) const override
 retrieve the I/O monitored value for the I/O component compName More...
 
virtual void domain (const std::string &compName, std::string &domain) const override
 retrieve the domain name for a given component compName More...
 
virtual void handle (const Incident &incident) override
 incident service handle for EndEvent More...
 
virtual void declareInfo (const std::string &name, const bool &var, const std::string &desc, const IInterface *owner) override
 Declare monitoring information. More...
 
virtual void declareInfo (const std::string &name, const int &var, const std::string &desc, const IInterface *owner) override
 
virtual void declareInfo (const std::string &name, const long &var, const std::string &desc, const IInterface *owner) override
 
virtual void declareInfo (const std::string &name, const double &var, const std::string &desc, const IInterface *owner) override
 
virtual void declareInfo (const std::string &name, const std::string &var, const std::string &desc, const IInterface *owner) override
 
virtual void declareInfo (const std::string &name, const std::pair< double, double > &var, const std::string &desc, const IInterface *owner) override
 
virtual void declareInfo (const std::string &name, const AIDA::IBaseHistogram *var, const std::string &desc, const IInterface *owner) override
 
virtual void declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc, const IInterface *owner) override
 
virtual void declareInfo (const std::string &name, const StatEntity &var, const std::string &desc, const IInterface *owner) override
 
virtual void undeclareInfo (const std::string &name, const IInterface *owner) override
 Undeclare monitoring information. More...
 
virtual void undeclareAll (const IInterface *owner) override
 Undeclare monitoring information. More...
 
virtual std::set< std::string > * getInfos (const IInterface *owner) override
 Get the names for all declared monitoring informations for a given owener. More...
 
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. More...
 
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. More...
 
PerfMon::State::Type monState () const
 Retrieve the current state of Gaudi's finite state machine. More...
 
const std::string & monStateName () const
 Retrieve the name of the current state of Gaudi's FSM. More...
 
std::vector< std::string > components (PerfMon::State::Type step) const
 return the list of components' names for a given step More...
 
const PerfMon::Componentcomponent (PerfMon::State::Type step, const std::string &compName) const
 retrieve the monitored value for the component compName and for the step step (ini,evt,fin,cbk,...) More...
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Inline methods:
More...
 

Protected Member Functions

void setMonState (PerfMon::State::Type step)
 set the current state of the Gaudi's FSM More...
 

Private Types

typedef std::unordered_map< std::string, Stats_tStatStore_t
 

Private Member Functions

 PerfMonSvc ()
 Default constructor: More...
 
void setupProfiledAlgList (Gaudi::Details::PropertyBase &profiledAlgNames)
 callback to synchronize the list of algorithms to be profiled More...
 
void setupIoContainerList (Gaudi::Details::PropertyBase &ioContainerNames)
 callback to synchronize the list of I/O containers to be monitored More...
 
void poll ()
 loop over user-declared variables (via the IMonitorSvc interface) and poll the data More...
 
void comp_startAud (const std::string &stepName, const std::string &compName)
 start collection monitoring cpu+mem data for a given component More...
 
void comp_stopAud (const std::string &stepName, const std::string &compName)
 stop collection monitoring cpu+mem data for a given component More...
 
void do_io_mon ()
 collect I/O monitoring data More...
 
void postFinalize ()
 

Private Attributes

PyObjectm_pySvc
 Pointer to the PyObject doing the real work. More...
 
ServiceHandle< IChronoStatSvc > m_chrono
 handle to the chronostat service More...
 
DoubleProperty m_deltaVMemAlert
 Maximum allowed variation of virtual memory (in bytes) between last print-out and current vmem value, before triggering a new print-out. More...
 
StringArrayProperty m_profiledAlgNames
 List of algorithms to be profiled. More...
 
StringArrayProperty m_ioContainerNames
 List of containers for which one wants to gather I/O data. More...
 
StringProperty m_outFileName
 Name of the output file to hold performance data. More...
 
BooleanProperty m_enableDblCountingCorrection
 switch to enable or not the on-the-fly double-counting correction More...
 
int m_monLvl
 level of granularity for monitoring More...
 
StringProperty m_shelveFileName
 Name of the shelve file containing jobo metadata. More...
 
int m_semiDetMonLvl
 Level of semi-detailed monitoring. More...
 
std::string m_jobStartJiffies
 (needed as a property to survive athena.py –drop-and-reload More...
 
bool m_extraPrintouts
 
PerfMon::Tuple m_ntuple
 tuple of data (step->component[name->perf-data]) More...
 
float m_firstVmem
 first event vmem More...
 
float m_10evtVmem
 10th-event vmem More...
 
float m_lastVmem
 last event vmem More...
 
PerfMon::LinFitSglPass m_vmemfit_evt2to20
 
PerfMon::LinFitSglPass m_vmemfit_evt21to100
 
PerfMon::LinFitSglPass m_vmemfit_evt101plus
 
int m_stream
 pmon-stream data file descriptor More...
 
std::string m_workerDir
 Worker directory in athenaMP. More...
 
long m_nevts
 number of events processed during the monitored job More...
 
std::size_t m_nalgs
 number of algorithms the monitored job ran More...
 
StatStore_t m_stats
 
CgHandler m_corrector
 
PMonSD::SemiDetHelperm_pmonsd
 
bool m_pf
 
Gaudi::Property< std::string > m_compBeginEvent
 
Gaudi::Property< std::string > m_compEndEvent
 
PerfMon::State::Type m_monState
 current state of the Gaudi's FSM More...
 

Friends

class SvcFactory< PerfMonSvc >
 

Detailed Description

Definition at line 63 of file PerfMonSvc.h.

Member Typedef Documentation

◆ StatStore_t

typedef std::unordered_map<std::string, Stats_t> PerfMonSvc::StatStore_t
private

Definition at line 336 of file PerfMonSvc.h.

Constructor & Destructor Documentation

◆ PerfMonSvc() [1/2]

PerfMonSvc::PerfMonSvc ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Constructor with parameters:

Definition at line 176 of file PerfMonSvc.cxx.

176  :
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 }

◆ ~PerfMonSvc()

PerfMonSvc::~PerfMonSvc ( )
virtual

Destructor:

Definition at line 260 of file PerfMonSvc.cxx.

261 {
262  PMON_DEBUG("Calling destructor");
263  if (! m_pf) {
264  postFinalize();
265  }
266 }

◆ PerfMonSvc() [2/2]

PerfMonSvc::PerfMonSvc ( )
private

Default constructor:

Member Function Documentation

◆ comp_startAud()

void PerfMonSvc::comp_startAud ( const std::string &  stepName,
const std::string &  compName 
)
private

start collection monitoring cpu+mem data for a given component

Definition at line 1223 of file PerfMonSvc.cxx.

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 }

◆ comp_stopAud()

void PerfMonSvc::comp_stopAud ( const std::string &  stepName,
const std::string &  compName 
)
private

stop collection monitoring cpu+mem data for a given component

Definition at line 1276 of file PerfMonSvc.cxx.

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 }

◆ component() [1/2]

const PerfMon::Component * PerfMonSvc::component ( const std::string &  stepName,
const std::string &  compName 
) const
overridevirtual

retrieve the monitored value for the component compName and for the step stepName (ini,evt,fin,cbk,...)

retrieve the monitored value for the component compName and for the step step (ini,evt,fin,cbk,...)

Implements IPerfMonSvc.

Definition at line 761 of file PerfMonSvc.cxx.

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 }

◆ component() [2/2]

const PerfMon::Component* IPerfMonSvc::component ( PerfMon::State::Type  step,
const std::string &  compName 
) const
inlineinherited

retrieve the monitored value for the component compName and for the step step (ini,evt,fin,cbk,...)

Definition at line 78 of file IPerfMonSvc.h.

80  { return this->component(PerfMon::Steps[step], compName); }

◆ components() [1/2]

std::vector< std::string > PerfMonSvc::components ( const std::string &  stepName) const
overridevirtual

return the list of components' names for a given step

Implements IPerfMonSvc.

Definition at line 714 of file PerfMonSvc.cxx.

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 }

◆ components() [2/2]

std::vector<std::string> IPerfMonSvc::components ( PerfMon::State::Type  step) const
inlineinherited

return the list of components' names for a given step

Definition at line 62 of file IPerfMonSvc.h.

63  { return this->components(PerfMon::Steps[step]); }

◆ declareInfo() [1/9]

void PerfMonSvc::declareInfo ( const std::string &  name,
const AIDA::IBaseHistogram *  var,
const std::string &  desc,
const IInterface *  owner 
)
overridevirtual

Implements IPerfMonSvc.

Definition at line 980 of file PerfMonSvc.cxx.

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 }

◆ declareInfo() [2/9]

void PerfMonSvc::declareInfo ( const std::string &  name,
const bool &  var,
const std::string &  desc,
const IInterface *  owner 
)
overridevirtual

Declare monitoring information.

Parameters
nameMonitoring information name knwon to the external system
varMonitoring Listener address
descTextual description
ownerOwner identifier of the monitoring information (needed to peform clean up

Implements IPerfMonSvc.

Definition at line 877 of file PerfMonSvc.cxx.

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 }

◆ declareInfo() [3/9]

void PerfMonSvc::declareInfo ( const std::string &  name,
const double &  var,
const std::string &  desc,
const IInterface *  owner 
)
overridevirtual

Implements IPerfMonSvc.

Definition at line 928 of file PerfMonSvc.cxx.

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 }

◆ declareInfo() [4/9]

void PerfMonSvc::declareInfo ( const std::string &  name,
const int &  var,
const std::string &  desc,
const IInterface *  owner 
)
overridevirtual

Implements IPerfMonSvc.

Definition at line 894 of file PerfMonSvc.cxx.

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 }

◆ declareInfo() [5/9]

void PerfMonSvc::declareInfo ( const std::string &  name,
const long &  var,
const std::string &  desc,
const IInterface *  owner 
)
overridevirtual

Implements IPerfMonSvc.

Definition at line 911 of file PerfMonSvc.cxx.

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 }

◆ declareInfo() [6/9]

void PerfMonSvc::declareInfo ( const std::string &  name,
const StatEntity &  var,
const std::string &  desc,
const IInterface *  owner 
)
overridevirtual

Implements IPerfMonSvc.

Definition at line 1018 of file PerfMonSvc.cxx.

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 }

◆ declareInfo() [7/9]

void PerfMonSvc::declareInfo ( const std::string &  name,
const std::pair< double, double > &  var,
const std::string &  desc,
const IInterface *  owner 
)
overridevirtual

Implements IPerfMonSvc.

Definition at line 962 of file PerfMonSvc.cxx.

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 }

◆ declareInfo() [8/9]

void PerfMonSvc::declareInfo ( const std::string &  name,
const std::string &  format,
const void *  var,
int  size,
const std::string &  desc,
const IInterface *  owner 
)
overridevirtual

Implements IPerfMonSvc.

Definition at line 997 of file PerfMonSvc.cxx.

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 }

◆ declareInfo() [9/9]

void PerfMonSvc::declareInfo ( const std::string &  name,
const std::string &  var,
const std::string &  desc,
const IInterface *  owner 
)
overridevirtual

Implements IPerfMonSvc.

Definition at line 945 of file PerfMonSvc.cxx.

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 }

◆ do_io_mon()

void PerfMonSvc::do_io_mon ( )
private

collect I/O monitoring data

Definition at line 1413 of file PerfMonSvc.cxx.

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 }

◆ domain()

void PerfMonSvc::domain ( const std::string &  compName,
std::string &  domain 
) const
overridevirtual

retrieve the domain name for a given component compName

Implements IPerfMonSvc.

Definition at line 796 of file PerfMonSvc.cxx.

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 }

◆ finalize()

StatusCode PerfMonSvc::finalize ( )
overridevirtual

loop over the perf-tools and harvest 'finalize' perf-data

Definition at line 680 of file PerfMonSvc.cxx.

681 {
682  PMON_INFO("Finalizing " << name() << "...");
683 
685  startAud( "fin", "PerfMonSlice" );
686 
687  return StatusCode::SUCCESS;
688 }

◆ getInfos()

std::set< std::string > * PerfMonSvc::getInfos ( const IInterface *  owner)
overridevirtual

Get the names for all declared monitoring informations for a given owener.

If the owner is NULL, then it returns for all owners informationUndeclare monitoring information

Implements IPerfMonSvc.

Definition at line 1071 of file PerfMonSvc.cxx.

1072 {
1073  return 0;
1074 }

◆ handle()

void PerfMonSvc::handle ( const Incident &  incident)
overridevirtual

incident service handle for EndEvent

Definition at line 856 of file PerfMonSvc.cxx.

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 }

◆ initialize()

StatusCode PerfMonSvc::initialize ( )
overridevirtual

Gaudi Service Implementation.

Definition at line 487 of file PerfMonSvc.cxx.

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 }

◆ interfaceID()

const InterfaceID & PerfMonSvc::interfaceID ( )
inlinestatic

Inline methods:

Definition at line 380 of file PerfMonSvc.h.

381 {
382  return IPerfMonSvc::interfaceID();
383 }

◆ io_component()

const PerfMon::IoContainer * PerfMonSvc::io_component ( const std::string &  compName) const
overridevirtual

retrieve the I/O monitored value for the I/O component compName

Implements IPerfMonSvc.

Definition at line 779 of file PerfMonSvc.cxx.

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 }

◆ io_components()

std::vector< std::string > PerfMonSvc::io_components ( ) const
overridevirtual

return the list of io-components' names

Implements IPerfMonSvc.

Definition at line 737 of file PerfMonSvc.cxx.

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 }

◆ io_finalize()

StatusCode PerfMonSvc::io_finalize ( )
finaloverridevirtual

IIoComponent interface

callback method to finalize the internal state of the component for I/O purposes (e.g. upon fork(2))

Definition at line 468 of file PerfMonSvc.cxx.

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 }

◆ io_reinit()

StatusCode PerfMonSvc::io_reinit ( )
finaloverridevirtual

IIoComponent interface

callback methods to reinitialize/finalize the internal state of the component for I/O purposes (e.g. upon fork(2))

callback method to reinitialize the internal state of the component for I/O purposes (e.g. upon fork(2))

Definition at line 389 of file PerfMonSvc.cxx.

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 }

◆ monState()

PerfMon::State::Type IPerfMonSvc::monState ( ) const
inlineinherited

Retrieve the current state of Gaudi's finite state machine.

Definition at line 53 of file IPerfMonSvc.h.

54  { return m_monState; }

◆ monStateName()

const std::string& IPerfMonSvc::monStateName ( ) const
inlineinherited

Retrieve the name of the current state of Gaudi's FSM.

Definition at line 57 of file IPerfMonSvc.h.

58  { return PerfMon::Steps[m_monState]; }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Service >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Service >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Service >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ poll()

void PerfMonSvc::poll ( )
private

loop over user-declared variables (via the IMonitorSvc interface) and poll the data

Definition at line 1209 of file PerfMonSvc.cxx.

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 }

◆ postFinalize()

void PerfMonSvc::postFinalize ( )
private

loop over the perf-tools and harvest 'finalize' perf-data

Definition at line 269 of file PerfMonSvc.cxx.

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 }

◆ queryInterface()

StatusCode PerfMonSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
)
overridevirtual

Definition at line 696 of file PerfMonSvc.cxx.

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 }

◆ setMonState()

void IPerfMonSvc::setMonState ( PerfMon::State::Type  step)
inlineprotectedinherited

set the current state of the Gaudi's FSM

Definition at line 184 of file IPerfMonSvc.h.

185  { m_monState = step; }

◆ setupIoContainerList()

void PerfMonSvc::setupIoContainerList ( Gaudi::Details::PropertyBase &  ioContainerNames)
private

callback to synchronize the list of I/O containers to be monitored

Definition at line 1084 of file PerfMonSvc.cxx.

1085 {
1086 }

◆ setupProfiledAlgList()

void PerfMonSvc::setupProfiledAlgList ( Gaudi::Details::PropertyBase &  profiledAlgNames)
private

callback to synchronize the list of algorithms to be profiled

Definition at line 1079 of file PerfMonSvc.cxx.

1080 {
1081  return;
1082 }

◆ startAud()

void PerfMonSvc::startAud ( const std::string &  stepName,
const std::string &  compName 
)
overridevirtual

Start collecting monitoring data for a given component, for a given step of the Gaudi FSM.

Implements IPerfMonSvc.

Definition at line 1126 of file PerfMonSvc.cxx.

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 }

◆ stopAud()

void PerfMonSvc::stopAud ( const std::string &  stepName,
const std::string &  compName 
)
overridevirtual

Stop collecting monitoring data for a given component, for a given step of the Gaudi FSM.

Implements IPerfMonSvc.

Definition at line 1172 of file PerfMonSvc.cxx.

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 }

◆ undeclareAll()

void PerfMonSvc::undeclareAll ( const IInterface *  owner)
overridevirtual

Undeclare monitoring information.

Parameters
ownerOwner identifier of the monitoring information

Implements IPerfMonSvc.

Definition at line 1054 of file PerfMonSvc.cxx.

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 }

◆ undeclareInfo()

void PerfMonSvc::undeclareInfo ( const std::string &  name,
const IInterface *  owner 
)
overridevirtual

Undeclare monitoring information.

Parameters
nameMonitoring information name knwon to the external system
ownerOwner identifier of the monitoring information

Implements IPerfMonSvc.

Definition at line 1035 of file PerfMonSvc.cxx.

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 }

Friends And Related Function Documentation

◆ SvcFactory< PerfMonSvc >

friend class SvcFactory< PerfMonSvc >
friend

Definition at line 57 of file PerfMonSvc.h.

Member Data Documentation

◆ m_10evtVmem

float PerfMonSvc::m_10evtVmem
private

10th-event vmem

Definition at line 305 of file PerfMonSvc.h.

◆ m_chrono

ServiceHandle<IChronoStatSvc> PerfMonSvc::m_chrono
private

handle to the chronostat service

Definition at line 262 of file PerfMonSvc.h.

◆ m_compBeginEvent

Gaudi::Property<std::string> PerfMonSvc::m_compBeginEvent
private
Initial value:
{
this, "compBeginEvent", "AthMasterSeq", "Component name that'll trigger begin event" }

Definition at line 368 of file PerfMonSvc.h.

◆ m_compEndEvent

Gaudi::Property<std::string> PerfMonSvc::m_compEndEvent
private
Initial value:
{
this, "compEndEvent", "AthMasterSeq", "Component name that'll trigger end event" }

Definition at line 372 of file PerfMonSvc.h.

◆ m_corrector

CgHandler PerfMonSvc::m_corrector
private

Definition at line 352 of file PerfMonSvc.h.

◆ m_deltaVMemAlert

DoubleProperty PerfMonSvc::m_deltaVMemAlert
private

Maximum allowed variation of virtual memory (in bytes) between last print-out and current vmem value, before triggering a new print-out.

Definition at line 266 of file PerfMonSvc.h.

◆ m_enableDblCountingCorrection

BooleanProperty PerfMonSvc::m_enableDblCountingCorrection
private

switch to enable or not the on-the-fly double-counting correction

Definition at line 281 of file PerfMonSvc.h.

◆ m_extraPrintouts

bool PerfMonSvc::m_extraPrintouts
private

Definition at line 296 of file PerfMonSvc.h.

◆ m_firstVmem

float PerfMonSvc::m_firstVmem
private

first event vmem

Definition at line 302 of file PerfMonSvc.h.

◆ m_ioContainerNames

StringArrayProperty PerfMonSvc::m_ioContainerNames
private

List of containers for which one wants to gather I/O data.

If empty list, no I/O data will be collected (except the overall 'commitOutput' timing)

Definition at line 275 of file PerfMonSvc.h.

◆ m_jobStartJiffies

std::string PerfMonSvc::m_jobStartJiffies
private

(needed as a property to survive athena.py –drop-and-reload

Definition at line 293 of file PerfMonSvc.h.

◆ m_lastVmem

float PerfMonSvc::m_lastVmem
private

last event vmem

Definition at line 308 of file PerfMonSvc.h.

◆ m_monLvl

int PerfMonSvc::m_monLvl
private

level of granularity for monitoring

Definition at line 284 of file PerfMonSvc.h.

◆ m_monState

PerfMon::State::Type IPerfMonSvc::m_monState
privateinherited

current state of the Gaudi's FSM

Definition at line 193 of file IPerfMonSvc.h.

◆ m_nalgs

std::size_t PerfMonSvc::m_nalgs
private

number of algorithms the monitored job ran

Definition at line 324 of file PerfMonSvc.h.

◆ m_nevts

long PerfMonSvc::m_nevts
private

number of events processed during the monitored job

Definition at line 321 of file PerfMonSvc.h.

◆ m_ntuple

PerfMon::Tuple PerfMonSvc::m_ntuple
private

tuple of data (step->component[name->perf-data])

Definition at line 299 of file PerfMonSvc.h.

◆ m_outFileName

StringProperty PerfMonSvc::m_outFileName
private

Name of the output file to hold performance data.

Definition at line 278 of file PerfMonSvc.h.

◆ m_pf

bool PerfMonSvc::m_pf
private

Definition at line 357 of file PerfMonSvc.h.

◆ m_pmonsd

PMonSD::SemiDetHelper* PerfMonSvc::m_pmonsd
private

Definition at line 355 of file PerfMonSvc.h.

◆ m_profiledAlgNames

StringArrayProperty PerfMonSvc::m_profiledAlgNames
private

List of algorithms to be profiled.

If empty list, all the algorithms known to the ApplicationMgr are taken.

Definition at line 270 of file PerfMonSvc.h.

◆ m_pySvc

PyObject* PerfMonSvc::m_pySvc
private

Pointer to the PyObject doing the real work.

Definition at line 259 of file PerfMonSvc.h.

◆ m_semiDetMonLvl

int PerfMonSvc::m_semiDetMonLvl
private

Level of semi-detailed monitoring.

Definition at line 290 of file PerfMonSvc.h.

◆ m_shelveFileName

StringProperty PerfMonSvc::m_shelveFileName
private

Name of the shelve file containing jobo metadata.

Definition at line 287 of file PerfMonSvc.h.

◆ m_stats

StatStore_t PerfMonSvc::m_stats
private

Definition at line 337 of file PerfMonSvc.h.

◆ m_stream

int PerfMonSvc::m_stream
private

pmon-stream data file descriptor

Definition at line 315 of file PerfMonSvc.h.

◆ m_vmemfit_evt101plus

PerfMon::LinFitSglPass PerfMonSvc::m_vmemfit_evt101plus
private

Definition at line 312 of file PerfMonSvc.h.

◆ m_vmemfit_evt21to100

PerfMon::LinFitSglPass PerfMonSvc::m_vmemfit_evt21to100
private

Definition at line 311 of file PerfMonSvc.h.

◆ m_vmemfit_evt2to20

PerfMon::LinFitSglPass PerfMonSvc::m_vmemfit_evt2to20
private

Definition at line 310 of file PerfMonSvc.h.

◆ m_workerDir

std::string PerfMonSvc::m_workerDir
private

Worker directory in athenaMP.

Definition at line 318 of file PerfMonSvc.h.


The documentation for this class was generated from the following files:
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
AthService::AthService
AthService()
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
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
PerfMonSvc::CgHandler::vmem
float vmem
Definition: PerfMonSvc.h:342
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
IPerfMonSvc::component
const PerfMon::Component * component(PerfMon::State::Type step, const std::string &compName) const
retrieve the monitored value for the component compName and for the step step (ini,...
Definition: IPerfMonSvc.h:78
PerfMonSvc::m_stats
StatStore_t m_stats
Definition: PerfMonSvc.h:337
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
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::m_pmonsd
PMonSD::SemiDetHelper * m_pmonsd
Definition: PerfMonSvc.h:355
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
PerfMonSvc::CgHandler::rss
float rss
Definition: PerfMonSvc.h:343
pool::WRITE
@ WRITE
Definition: Database/APR/StorageSvc/StorageSvc/pool.h:72
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
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
AthCommonMsg< Service >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
PMonSD::get_wall_ms
double get_wall_ms()
Definition: SemiDetMisc.h:628
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
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
IPerfMonSvc::m_monState
PerfMon::State::Type m_monState
current state of the Gaudi's FSM
Definition: IPerfMonSvc.h:193
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::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
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
lumiFormat.i
int i
Definition: lumiFormat.py:92
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
PerfMon::State::io
@ io
Definition: PerfMonDefs.h:34
PMON_ERROR
#define PMON_ERROR(x)
Definition: PerfMonSvc.cxx:112
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
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::m_outFileName
StringProperty m_outFileName
Name of the output file to hold performance data.
Definition: PerfMonSvc.h:278
PerfMon::Component
Definition: DataModel.h:73
PerfMonSvc::m_vmemfit_evt101plus
PerfMon::LinFitSglPass m_vmemfit_evt101plus
Definition: PerfMonSvc.h:312
imax
int imax(int i, int j)
Definition: TileLaserTimingTool.cxx:33
PerfMon::LinFitSglPass::nPoints
unsigned nPoints() const
Definition: LinFitSglPass.h:31
PMON_VERBOSE
#define PMON_VERBOSE(x)
Definition: PerfMonSvc.cxx:108
PerfMonSvc::setupIoContainerList
void setupIoContainerList(Gaudi::Details::PropertyBase &ioContainerNames)
callback to synchronize the list of I/O containers to be monitored
Definition: PerfMonSvc.cxx:1084
PerfMonSvc::m_ioContainerNames
StringArrayProperty m_ioContainerNames
List of containers for which one wants to gather I/O data.
Definition: PerfMonSvc.h:275
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
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::setupProfiledAlgList
void setupProfiledAlgList(Gaudi::Details::PropertyBase &profiledAlgNames)
callback to synchronize the list of algorithms to be profiled
Definition: PerfMonSvc.cxx:1079
PerfMon::Tuple::iocomp
IoCompTuple_t iocomp
Definition: PerfMonSvc.h:57
IPerfMonSvc
Definition: IPerfMonSvc.h:38
PerfMonSvc::m_10evtVmem
float m_10evtVmem
10th-event vmem
Definition: PerfMonSvc.h:305
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
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
PerfMonSvc::m_workerDir
std::string m_workerDir
Worker directory in athenaMP.
Definition: PerfMonSvc.h:318
PerfMon::State::fin
@ fin
Definition: PerfMonDefs.h:32
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
PerfMonSvc::m_vmemfit_evt2to20
PerfMon::LinFitSglPass m_vmemfit_evt2to20
Definition: PerfMonSvc.h:310
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
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
LArCellBinning.step
step
Definition: LArCellBinning.py:158
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
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
CompStore_t
PerfMon::Tuple::CompStore_t CompStore_t
Definition: PerfMonSvc.cxx:92
PerfMonSvc::m_corrector
CgHandler m_corrector
Definition: PerfMonSvc.h:352
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
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
IPerfMonSvc::components
std::vector< std::string > components(PerfMon::State::Type step) const
return the list of components' names for a given step
Definition: IPerfMonSvc.h:62
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
ServiceHandle< IIncidentSvc >