Commits

Anonymous committed 2bdf6fb

migration to a python-based performance monitoring

  • Participants
  • Parent commits d66f0f3

Comments (0)

Files changed (9)

+2007-11-29  Sebastien Binet  <binet@lblbox>
+
+	* tagging PerfMonKernel-00-06-00
+	* migration to a python-based performance monitoring
+	* M PerfMonKernel/IPerfMonSvc.h
+	* M src/IPerfMonSvc.cxx
+	* R PerfMonKernel/IPerfMonAuditor.h
+	* R PerfMonKernel/IPerfMonPyTool.h
+	* R PerfMonKernel/IPerfMonTool.h
+	* R src/IPerfMonAuditor.cxx
+	* R src/IPerfMonPyTool.cxx
+	* R src/IPerfMonTool.cxx
+
 2007-11-07  Sebastien Binet  <binet@lblbox>
 
 	* tagging PerfMonKernel-00-05-01

PerfMonKernel/IPerfMonAuditor.h

-///////////////////////// -*- C++ -*- /////////////////////////////
-// IPerfMonAuditor.h 
-// Header file for class IPerfMonAuditor
-// Author: S.Binet<binet@cern.ch>
-/////////////////////////////////////////////////////////////////// 
-#ifndef PERFMONKERNEL_IPERFMONAUDITOR_H 
-#define PERFMONKERNEL_IPERFMONAUDITOR_H 
-
-// STL includes
-#include <string>
-
-// FrameWork includes
-#include "GaudiKernel/IAuditor.h"
-#include "GaudiKernel/ToolHandle.h"
-
-// Forward declaration
-class INamedInterface;
-class IPerfMonTool;
-
-class IPerfMonAuditor : virtual public IAuditor
-{ 
- 
-  /////////////////////////////////////////////////////////////////// 
-  // Public typedefs: 
-  /////////////////////////////////////////////////////////////////// 
- public: 
-  typedef ToolHandleArray<IPerfMonTool> IPerfMonTools_t;
-
-  /////////////////////////////////////////////////////////////////// 
-  // Public methods: 
-  /////////////////////////////////////////////////////////////////// 
- public: 
-
-  /// destructor
-  ~IPerfMonAuditor();
-
-  /////////////////////////////////////////////////////////////////// 
-  // Non-const methods: 
-  /////////////////////////////////////////////////////////////////// 
-
-  /// register a list of @c IPerfMonTool to call back during job
-  virtual StatusCode setPerfMonTools( IPerfMonTools_t& monTools ) = 0;
-
-  /////////////////////////////////////////////////////////////////// 
-  // Private methods: 
-  /////////////////////////////////////////////////////////////////// 
- private: 
-
-  IPerfMonAuditor(); // not implemented
-
-  /////////////////////////////////////////////////////////////////// 
-  // Private data: 
-  /////////////////////////////////////////////////////////////////// 
- private: 
-  
-}; 
-
-// I/O operators
-//////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Inline methods: 
-/////////////////////////////////////////////////////////////////// 
-
-#endif //> PERFMONKERNEL_IPERFMONAUDITOR_H

PerfMonKernel/IPerfMonPyTool.h

-///////////////////////// -*- C++ -*- /////////////////////////////
-// IPerfMonPyTool.h 
-// Header file for class IPerfMonPyTool
-// Author: S.Binet<binet@cern.ch>
-/////////////////////////////////////////////////////////////////// 
-#ifndef PERFMONKERNEL_IPERFMONPYTOOL_H 
-#define PERFMONKERNEL_IPERFMONPYTOOL_H 
-
-/** @class IPerfMonPyTool
- *  The interface to tools meant to monitor the python Configuration step.
- *  Hence, only one monitoring method has been declared:
- *   - @c IPerfMonPyTool::pyMonitor
- *
- *  Monitoring is supposed to take place before the creation of a concrete tool 
- *  implementing this @c IPerfMonPyTool interface, by some python class or 
- *  other means. The performance data is then transmitted to the tool by some
- *  jobOption property.
- *  The assumption that performance data is in good shape and may be committed 
- *  to persistent storage is nonetheless enforced by the same mechanism (ie: 
- *  @c IPerfMonPyTool::shutdown)
- */
-
-// STL includes
-
-// FrameWork includes
-#include "GaudiKernel/IAlgTool.h"
-
-// forward declaration
-class IPerfMonSvc;
-
-class IPerfMonPyTool : virtual public IAlgTool
-{ 
-  friend class IPerfMonSvc;
-
-  /////////////////////////////////////////////////////////////////// 
-  // Public methods: 
-  /////////////////////////////////////////////////////////////////// 
- public: 
-
-  /** Destructor: 
-   */
-  virtual ~IPerfMonPyTool();
-
-  /////////////////////////////////////////////////////////////////// 
-  // Const methods: 
-  ///////////////////////////////////////////////////////////////////
-  static const InterfaceID& interfaceID();
-
-  /////////////////////////////////////////////////////////////////// 
-  // Non-const methods: 
-  /////////////////////////////////////////////////////////////////// 
-
-  /// retrieve performance monitoring data - during python execution
-  virtual void pyMonitor() = 0;
-
-  /////////////////////////////////////////////////////////////////// 
-  // Protected methods: 
-  /////////////////////////////////////////////////////////////////// 
- protected: 
-
-  /// shutdown monitoring: make sure that metadata (if any) is up-to-date
-  /// clean-up any persistency related stuff (@c IPerfMonTupleSvc)
-  /// This method is called by @c IPerfMonSvc
-  virtual StatusCode shutdown() = 0;
-
-}; 
-
-// I/O operators
-//////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Inline methods: 
-/////////////////////////////////////////////////////////////////// 
-inline const InterfaceID& IPerfMonPyTool::interfaceID() 
-{ 
-  static const InterfaceID IID_IPerfMonPyTool("IPerfMonPyTool", 1, 0);
-  return IID_IPerfMonPyTool; 
-}
-
-#endif //> PERFMONKERNEL_IPERFMONPYTOOL_H

PerfMonKernel/IPerfMonSvc.h

 /** @class IPerfMonSvc
  *  This is the interface to the main service scheduling a performance 
  *  monitoring job.
- *  Not much is exposed to clients as it is supposed to be a rather opaque black
- *  box, but the following methods are heavily suggested to be implemented by 
- *  derived classes:
- *    - IPerfMonSvc::pyMonitor
- *    - IPerfMonSvc::monitor
- *
- *  However, to minimize coupling between (concrete) classes, 2 methods are
- *  implemented here: @c shutdown( IPerfMonPyTool* ) and 
- *  @c shutdown( IPerfMonTool* ).
- *  These methods are the last chance provided to these tools to gather metadata
- *  and clean-up the state of their performance data. After that, nothing else
- *  will be committed to disk (ie: to the tuple) or at least no change will be
- *  reflected on the persistent side.
- *  Note that these methods have been introduced because the meaning of
- *  finalizing a tool (in the Gaudi sense) can differ from finalizing a
- *  performance monitoring task. So they had to be decoupled.
  */
 
 // STL includes
 #include <string>
 #include <vector>
 
-// boost includes
-#include <boost/array.hpp>
-
 // FrameWork includes
 #include "GaudiKernel/IMonitorSvc.h"
 
 #include "PerfMonKernel/PerfMonDefs.h"
 
 // forward declaration
-class IPerfMonTool;
-class IPerfMonPyTool;
 namespace AIDA { class IBaseHistogram; }
-class PerfMonEventLoopMgr;
 
 class IPerfMonSvc : virtual public IMonitorSvc
 { 
-  // friends
-  friend class PerfMonEventLoopMgr;
-
   /////////////////////////////////////////////////////////////////// 
   // Public methods: 
   /////////////////////////////////////////////////////////////////// 
   const std::string& monStateName() const 
   { return PerfMon::Steps[m_monState]; }
 
-  /// Retrieve the list of monitored components
-  virtual const std::vector<std::string>& components() const = 0;
-
   /////////////////////////////////////////////////////////////////// 
   // Non-const methods: 
   /////////////////////////////////////////////////////////////////// 
   */
   virtual std::set<std::string>* getInfos(const IInterface* owner = 0) = 0;
 
+  /** Start collecting monitoring data for a given component, for a given
+   *  step of the Gaudi FSM
+   */
+  virtual void startAud( PerfMon::State::Type step,
+			 const std::string& compName = "PerfMonSlice" ) = 0;
+
+  /** Stop collecting monitoring data for a given component, for a given
+   *  step of the Gaudi FSM
+   */
+  virtual void stopAud( PerfMon::State::Type step,
+			const std::string& compName = "PerfMonSlice" ) = 0;
+
   /////////////////////////////////////////////////////////////////// 
   // Protected methods: 
   /////////////////////////////////////////////////////////////////// 
  protected: 
 
-  /// main entry point for the performance monitoring (of python)
-  virtual void pyMonitor() = 0;
-
-  /// main entry point for the performance monitoring
-  virtual void monitor( PerfMon::State::Type step ) = 0;
-
-  /// helper to start auditing the 'virtual' 'PerfMonSlice'
-  virtual void startAud( PerfMon::State::Type step ) = 0;
-  /// helper to stop auditing the 'virtual' 'PerfMonSlice'
-  virtual void stopAud ( PerfMon::State::Type step ) = 0;
-
-  /// shutdown an @c IPerfMonTool
-  StatusCode shutdown( IPerfMonTool* tool );
-
-  /// shutdown an @c IPerfMonPyTool
-  StatusCode shutdown( IPerfMonPyTool* tool );
-
   /// set the current state of the Gaudi's FSM
   void setMonState( PerfMon::State::Type step )
   { m_monState = step; }

PerfMonKernel/IPerfMonTool.h

-///////////////////////// -*- C++ -*- /////////////////////////////
-// IPerfMonTool.h 
-// Header file for class IPerfMonTool
-// Author: S.Binet<binet@cern.ch>
-/////////////////////////////////////////////////////////////////// 
-#ifndef PERFMONKERNEL_IPERFMONTOOL_H 
-#define PERFMONKERNEL_IPERFMONTOOL_H 
-
-/** @class IPerfMonTool
- *  the interface to tools meant to monitor the various stages of the Gaudi 
- *  finite state machine (@c IAlgorithm::initialize @c IAlgorithm::execute 
- *  @c IAlgorithm::finalize ...). 
- *
- *  Hence, the following hopefully self-explanatory methods are declared:
- *   - @c IPerfMonTool::monitorInitialize
- *   - @c IPerfMonTool::monitor
- *   - @c IPerfMonTool::monitorFinalize
- *
- *  Monitoring is supposed to take place upon creation of a concrete tool 
- *  implementing this @c IPerfMonTool interface, until the call to the 
- *  @c IPerfMonTool::shutdown method.
- */
-
-// STL includes
-
-// FrameWork includes
-#include "GaudiKernel/IAlgTool.h"
-
-// PerfMonKernel includes
-#include "PerfMonKernel/PerfMonDefs.h"
-
-// forward declaration
-class IPerfMonSvc;
-
-class IPerfMonTool : virtual public IAlgTool
-{ 
-  friend class IPerfMonSvc;
-
-  /////////////////////////////////////////////////////////////////// 
-  // Public methods: 
-  /////////////////////////////////////////////////////////////////// 
- public: 
-
-  /** Destructor: 
-   */
-  virtual ~IPerfMonTool();
-
-  /////////////////////////////////////////////////////////////////// 
-  // Const methods: 
-  ///////////////////////////////////////////////////////////////////
-  static const InterfaceID& interfaceID();
-
-  /////////////////////////////////////////////////////////////////// 
-  // Non-const methods: 
-  /////////////////////////////////////////////////////////////////// 
-
-  /// start to create or compute performance monitoring data
-  /// This is called at each so-called point-cut of 'stepName' (ini/evt/fin)
-  virtual void startAud( const std::string& component, 
-			 PerfMon::State::Type step ) = 0;
-
-  /// stop to create or compute performance monitoring data
-  virtual void stopAud( const std::string& component, 
-			PerfMon::State::Type step ) = 0;
-
-  /// main entry point to publish monitoring data
-  virtual void poll( PerfMon::State::Type step ) = 0;
-
-  /////////////////////////////////////////////////////////////////// 
-  // Protected methods: 
-  /////////////////////////////////////////////////////////////////// 
- protected: 
-
-  /// shutdown monitoring: make sure that metadata (if any) is up-to-date
-  /// clean-up any persistency related stuff (@c IPerfMonTupleSvc)
-  /// This method is called by @c IPerfMonSvc
-  virtual StatusCode shutdown() = 0;
-
-}; 
-
-// I/O operators
-//////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Inline methods: 
-/////////////////////////////////////////////////////////////////// 
-inline const InterfaceID& IPerfMonTool::interfaceID() 
-{ 
-  static const InterfaceID IID_IPerfMonTool("IPerfMonTool", 1, 0);
-  return IID_IPerfMonTool; 
-}
-
-#endif //> PERFMONKERNEL_IPERFMONTOOL_H

src/IPerfMonAuditor.cxx

-///////////////////////// -*- C++ -*- /////////////////////////////
-// IPerfMonAuditor.cxx 
-// Implementation file for class IPerfMonAuditor
-// Author: S.Binet<binet@cern.ch>
-/////////////////////////////////////////////////////////////////// 
-
-// PerfMonKernel includes
-#include "PerfMonKernel/IPerfMonAuditor.h"
-
-/////////////////////////////////////////////////////////////////// 
-// Public methods: 
-/////////////////////////////////////////////////////////////////// 
-
-// Constructors
-////////////////
-
-// Destructor
-///////////////
-IPerfMonAuditor::~IPerfMonAuditor()
-{}
-
-/////////////////////////////////////////////////////////////////// 
-// Const methods: 
-///////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Non-const methods: 
-/////////////////////////////////////////////////////////////////// 
-
-/////////////////////////////////////////////////////////////////// 
-// Protected methods: 
-/////////////////////////////////////////////////////////////////// 
-
-/////////////////////////////////////////////////////////////////// 
-// Const methods: 
-///////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Non-const methods: 
-/////////////////////////////////////////////////////////////////// 
-

src/IPerfMonPyTool.cxx

-///////////////////////// -*- C++ -*- /////////////////////////////
-// IPerfMonPyTool.cxx 
-// Implementation file for class IPerfMonPyTool
-// Author: S.Binet<binet@cern.ch>
-/////////////////////////////////////////////////////////////////// 
-
-// PerfMonKernel includes
-#include "PerfMonKernel/IPerfMonPyTool.h"
-
-/////////////////////////////////////////////////////////////////// 
-// Public methods: 
-/////////////////////////////////////////////////////////////////// 
-
-// Constructors
-////////////////
-
-// Destructor
-///////////////
-IPerfMonPyTool::~IPerfMonPyTool()
-{}
-
-/////////////////////////////////////////////////////////////////// 
-// Const methods: 
-///////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Non-const methods: 
-/////////////////////////////////////////////////////////////////// 
-
-/////////////////////////////////////////////////////////////////// 
-// Protected methods: 
-/////////////////////////////////////////////////////////////////// 
-
-/////////////////////////////////////////////////////////////////// 
-// Const methods: 
-///////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Non-const methods: 
-/////////////////////////////////////////////////////////////////// 

src/IPerfMonSvc.cxx

 
 // PerfMonKernel includes
 #include "PerfMonKernel/IPerfMonSvc.h"
-#include "PerfMonKernel/IPerfMonTool.h"
-#include "PerfMonKernel/IPerfMonPyTool.h"
 
 /////////////////////////////////////////////////////////////////// 
 // Public methods: 
 // Non-const methods: 
 /////////////////////////////////////////////////////////////////// 
 
-StatusCode IPerfMonSvc::shutdown( IPerfMonTool* tool )
-{
-  return tool->shutdown();
-}
-
-StatusCode IPerfMonSvc::shutdown( IPerfMonPyTool* tool )
-{
-  return tool->shutdown();
-}
-

src/IPerfMonTool.cxx

-///////////////////////// -*- C++ -*- /////////////////////////////
-// IPerfMonTool.cxx 
-// Implementation file for class IPerfMonTool
-// Author: S.Binet<binet@cern.ch>
-/////////////////////////////////////////////////////////////////// 
-
-// PerfMonKernel includes
-#include "PerfMonKernel/IPerfMonTool.h"
-
-/////////////////////////////////////////////////////////////////// 
-// Public methods: 
-/////////////////////////////////////////////////////////////////// 
-
-// Constructors
-////////////////
-
-// Destructor
-///////////////
-IPerfMonTool::~IPerfMonTool()
-{}
-
-/////////////////////////////////////////////////////////////////// 
-// Const methods: 
-///////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Non-const methods: 
-/////////////////////////////////////////////////////////////////// 
-
-/////////////////////////////////////////////////////////////////// 
-// Protected methods: 
-/////////////////////////////////////////////////////////////////// 
-
-/////////////////////////////////////////////////////////////////// 
-// Const methods: 
-///////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////// 
-// Non-const methods: 
-///////////////////////////////////////////////////////////////////