CMS 3D CMS Logo

IgProfService.h
Go to the documentation of this file.
1 #ifndef IgTools_IgProf_IgProfService_h
2 #define IgTools_IgProf_IgProfService_h
3 
4 //
5 // Description: FWK service to implement hook for igprof memory profile
6 // dump functionality
7 //
8 // Peter Elmer, Princeton University 18 Nov, 2008
9 //
10 
14 
15 namespace edm {
16  class GlobalContext;
17  class StreamContext;
18 
19  namespace service {
20  class IgProfService {
21  public:
23 
24  void postBeginJob();
25 
26  void postBeginRun(GlobalContext const &gc);
27 
28  void postBeginLumi(GlobalContext const &gc);
29 
30  void preEvent(StreamContext const &sc);
31  void postEvent(StreamContext const &sc);
32 
33  void preModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc);
34  void postModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc);
35 
36  void postEndLumi(GlobalContext const &gc);
37 
38  void preEndRun(GlobalContext const &gc);
39  void postEndRun(GlobalContext const &gc);
40 
41  void preEndProcessBlock(GlobalContext const &gc);
42  void postEndProcessBlock(GlobalContext const &gc);
43 
44  void preEndJob();
45  void postEndJob();
46 
47  void postOpenFile(std::string const &);
48 
49  void postCloseFile(std::string const &);
50 
51  private:
52  void makeDump(const std::string &format, std::string_view moduleLabel = "");
53  static std::string replace(const std::string &s, const char *pat, int val);
54  static std::string replaceU64(const std::string &s, const char *pat, unsigned long long val);
55  static std::string replace(const std::string &s, const char *pat, std::string_view val);
56 
57  void (*dump_)(const char *);
58 
62 
65 
66  std::vector<std::string> modules_;
67  std::vector<std::string> moduleTypes_;
70 
78 
81 
83  int prescale_;
84  int nrecord_; // counter
88  int nfileopened_; // counter of files opened thus far
89  int nfileclosed_; // counter of files closed thus far
90  };
91  inline bool isProcessWideService(IgProfService const *) { return true; }
92  } // namespace service
93 } // namespace edm
94 
95 #endif
void postOpenFile(std::string const &)
bool isProcessWideService(TFileService const *)
Definition: TFileService.h:98
unsigned long long EventNumber_t
IgProfService(const ParameterSet &, ActivityRegistry &)
void postEndRun(GlobalContext const &gc)
edm::LuminosityBlockNumber_t nlumi_
Definition: IgProfService.h:87
unsigned int LuminosityBlockNumber_t
void preEndRun(GlobalContext const &gc)
void preModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc)
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
Definition: HeavyIon.h:7
static std::string replaceU64(const std::string &s, const char *pat, unsigned long long val)
void postEvent(StreamContext const &sc)
void makeDump(const std::string &format, std::string_view moduleLabel="")
std::vector< std::string > modules_
Definition: IgProfService.h:66
std::string atPostEndProcessBlock_
Definition: IgProfService.h:75
void preEndProcessBlock(GlobalContext const &gc)
void postCloseFile(std::string const &)
void(* dump_)(const char *)
Definition: IgProfService.h:57
void postBeginLumi(GlobalContext const &gc)
std::vector< std::string > moduleTypes_
Definition: IgProfService.h:67
void postEndLumi(GlobalContext const &gc)
edm::EventNumber_t nevent_
Definition: IgProfService.h:85
HLT enums.
void postModuleEvent(StreamContext const &sc, ModuleCallingContext const &mcc)
void preEvent(StreamContext const &sc)
unsigned int RunNumber_t
void postEndProcessBlock(GlobalContext const &gc)
static std::string replace(const std::string &s, const char *pat, int val)
void postBeginRun(GlobalContext const &gc)