CMS 3D CMS Logo

TestServiceOne.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 #ifndef FWCore_Integration_TestServiceOne_h
3 #define FWCore_Integration_TestServiceOne_h
4 //
5 // Package: FWCore/Integration
6 // Class : TestServiceOne
7 //
8 // Implementation:
9 // Service initially intended for testing behavior after exceptions.
10 // ExceptionThrowingProducer uses this and is in the same test plugin
11 // library and could be used to access the service if it was ever useful
12 // for debugging issues related to begin/end transitions.
13 //
14 // Original Author: W. David Dagenhart
15 // Created: 13 March 2024
16 
21 
22 #include <atomic>
23 
24 namespace edmtest {
25 
27  public:
29 
31 
33  void postBeginJob();
34  void preEndJob();
35  void postEndJob();
36 
41 
44  void preEndStream(edm::StreamContext const&);
45  void postEndStream(edm::StreamContext const&);
46 
51 
56 
61 
66 
71 
76 
81 
84 
89 
94 
99 
104 
107 
108  unsigned int nPreBeginJob() const;
109  unsigned int nPostBeginJob() const;
110  unsigned int nPreEndJob() const;
111  unsigned int nPostEndJob() const;
112 
113  unsigned int nPreModuleBeginJob() const;
114  unsigned int nPostModuleBeginJob() const;
115  unsigned int nPreModuleEndJob() const;
116  unsigned int nPostModuleEndJob() const;
117 
118  unsigned int nPreBeginStream() const;
119  unsigned int nPostBeginStream() const;
120  unsigned int nPreEndStream() const;
121  unsigned int nPostEndStream() const;
122 
123  unsigned int nPreModuleBeginStream() const;
124  unsigned int nPostModuleBeginStream() const;
125  unsigned int nPreModuleEndStream() const;
126  unsigned int nPostModuleEndStream() const;
127 
128  unsigned int nPreBeginProcessBlock() const;
129  unsigned int nPostBeginProcessBlock() const;
130  unsigned int nPreEndProcessBlock() const;
131  unsigned int nPostEndProcessBlock() const;
132 
133  unsigned int nPreModuleBeginProcessBlock() const;
134  unsigned int nPostModuleBeginProcessBlock() const;
135  unsigned int nPreModuleEndProcessBlock() const;
136  unsigned int nPostModuleEndProcessBlock() const;
137 
138  unsigned int nPreStreamBeginLumi() const;
139  unsigned int nPostStreamBeginLumi() const;
140  unsigned int nPreStreamEndLumi() const;
141  unsigned int nPostStreamEndLumi() const;
142 
143  unsigned int nPreModuleStreamBeginLumi() const;
144  unsigned int nPostModuleStreamBeginLumi() const;
145  unsigned int nPreModuleStreamEndLumi() const;
146  unsigned int nPostModuleStreamEndLumi() const;
147 
148  unsigned int nPreGlobalBeginLumi() const;
149  unsigned int nPostGlobalBeginLumi() const;
150  unsigned int nPreGlobalEndLumi() const;
151  unsigned int nPostGlobalEndLumi() const;
152 
153  unsigned int nPreModuleGlobalBeginLumi() const;
154  unsigned int nPostModuleGlobalBeginLumi() const;
155  unsigned int nPreModuleGlobalEndLumi() const;
156  unsigned int nPostModuleGlobalEndLumi() const;
157 
158  unsigned int nPreGlobalWriteLumi() const;
159  unsigned int nPostGlobalWriteLumi() const;
160 
161  unsigned int nPreStreamBeginRun() const;
162  unsigned int nPostStreamBeginRun() const;
163  unsigned int nPreStreamEndRun() const;
164  unsigned int nPostStreamEndRun() const;
165 
166  unsigned int nPreModuleStreamBeginRun() const;
167  unsigned int nPostModuleStreamBeginRun() const;
168  unsigned int nPreModuleStreamEndRun() const;
169  unsigned int nPostModuleStreamEndRun() const;
170 
171  unsigned int nPreGlobalBeginRun() const;
172  unsigned int nPostGlobalBeginRun() const;
173  unsigned int nPreGlobalEndRun() const;
174  unsigned int nPostGlobalEndRun() const;
175 
176  unsigned int nPreModuleGlobalBeginRun() const;
177  unsigned int nPostModuleGlobalBeginRun() const;
178  unsigned int nPreModuleGlobalEndRun() const;
179  unsigned int nPostModuleGlobalEndRun() const;
180 
181  unsigned int nPreGlobalWriteRun() const;
182  unsigned int nPostGlobalWriteRun() const;
183 
184  private:
185  bool verbose_;
187 
188  std::atomic<unsigned int> nPreBeginJob_ = 0;
189  std::atomic<unsigned int> nPostBeginJob_ = 0;
190  std::atomic<unsigned int> nPreEndJob_ = 0;
191  std::atomic<unsigned int> nPostEndJob_ = 0;
192 
193  std::atomic<unsigned int> nPreModuleBeginJob_ = 0;
194  std::atomic<unsigned int> nPostModuleBeginJob_ = 0;
195  std::atomic<unsigned int> nPreModuleEndJob_ = 0;
196  std::atomic<unsigned int> nPostModuleEndJob_ = 0;
197 
198  std::atomic<unsigned int> nPreBeginStream_ = 0;
199  std::atomic<unsigned int> nPostBeginStream_ = 0;
200  std::atomic<unsigned int> nPreEndStream_ = 0;
201  std::atomic<unsigned int> nPostEndStream_ = 0;
202 
203  std::atomic<unsigned int> nPreModuleBeginStream_ = 0;
204  std::atomic<unsigned int> nPostModuleBeginStream_ = 0;
205  std::atomic<unsigned int> nPreModuleEndStream_ = 0;
206  std::atomic<unsigned int> nPostModuleEndStream_ = 0;
207 
208  std::atomic<unsigned int> nPreBeginProcessBlock_ = 0;
209  std::atomic<unsigned int> nPostBeginProcessBlock_ = 0;
210  std::atomic<unsigned int> nPreEndProcessBlock_ = 0;
211  std::atomic<unsigned int> nPostEndProcessBlock_ = 0;
212 
213  std::atomic<unsigned int> nPreModuleBeginProcessBlock_ = 0;
214  std::atomic<unsigned int> nPostModuleBeginProcessBlock_ = 0;
215  std::atomic<unsigned int> nPreModuleEndProcessBlock_ = 0;
216  std::atomic<unsigned int> nPostModuleEndProcessBlock_ = 0;
217 
218  std::atomic<unsigned int> nPreStreamBeginLumi_ = 0;
219  std::atomic<unsigned int> nPostStreamBeginLumi_ = 0;
220  std::atomic<unsigned int> nPreStreamEndLumi_ = 0;
221  std::atomic<unsigned int> nPostStreamEndLumi_ = 0;
222 
223  std::atomic<unsigned int> nPreModuleStreamBeginLumi_ = 0;
224  std::atomic<unsigned int> nPostModuleStreamBeginLumi_ = 0;
225  std::atomic<unsigned int> nPreModuleStreamEndLumi_ = 0;
226  std::atomic<unsigned int> nPostModuleStreamEndLumi_ = 0;
227 
228  std::atomic<unsigned int> nPreGlobalBeginLumi_ = 0;
229  std::atomic<unsigned int> nPostGlobalBeginLumi_ = 0;
230  std::atomic<unsigned int> nPreGlobalEndLumi_ = 0;
231  std::atomic<unsigned int> nPostGlobalEndLumi_ = 0;
232 
233  std::atomic<unsigned int> nPreModuleGlobalBeginLumi_ = 0;
234  std::atomic<unsigned int> nPostModuleGlobalBeginLumi_ = 0;
235  std::atomic<unsigned int> nPreModuleGlobalEndLumi_ = 0;
236  std::atomic<unsigned int> nPostModuleGlobalEndLumi_ = 0;
237 
238  std::atomic<unsigned int> nPreGlobalWriteLumi_ = 0;
239  std::atomic<unsigned int> nPostGlobalWriteLumi_ = 0;
240 
241  std::atomic<unsigned int> nPreStreamBeginRun_ = 0;
242  std::atomic<unsigned int> nPostStreamBeginRun_ = 0;
243  std::atomic<unsigned int> nPreStreamEndRun_ = 0;
244  std::atomic<unsigned int> nPostStreamEndRun_ = 0;
245 
246  std::atomic<unsigned int> nPreModuleStreamBeginRun_ = 0;
247  std::atomic<unsigned int> nPostModuleStreamBeginRun_ = 0;
248  std::atomic<unsigned int> nPreModuleStreamEndRun_ = 0;
249  std::atomic<unsigned int> nPostModuleStreamEndRun_ = 0;
250 
251  std::atomic<unsigned int> nPreGlobalBeginRun_ = 0;
252  std::atomic<unsigned int> nPostGlobalBeginRun_ = 0;
253  std::atomic<unsigned int> nPreGlobalEndRun_ = 0;
254  std::atomic<unsigned int> nPostGlobalEndRun_ = 0;
255 
256  std::atomic<unsigned int> nPreModuleGlobalBeginRun_ = 0;
257  std::atomic<unsigned int> nPostModuleGlobalBeginRun_ = 0;
258  std::atomic<unsigned int> nPreModuleGlobalEndRun_ = 0;
259  std::atomic<unsigned int> nPostModuleGlobalEndRun_ = 0;
260 
261  std::atomic<unsigned int> nPreGlobalWriteRun_ = 0;
262  std::atomic<unsigned int> nPostGlobalWriteRun_ = 0;
263  };
264 } // namespace edmtest
265 #endif
std::atomic< unsigned int > nPreGlobalEndRun_
std::atomic< unsigned int > nPostModuleGlobalEndLumi_
void postModuleGlobalEndRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPostModuleBeginStream_
void postModuleEndJob(edm::ModuleDescription const &)
std::atomic< unsigned int > nPostModuleGlobalBeginRun_
std::atomic< unsigned int > nPreGlobalWriteLumi_
unsigned int nPreStreamEndLumi() const
std::atomic< unsigned int > nPostGlobalEndLumi_
std::atomic< unsigned int > nPostModuleBeginJob_
std::atomic< unsigned int > nPostStreamEndLumi_
unsigned int nPostBeginJob() const
unsigned int nPreModuleGlobalBeginLumi() const
void preModuleGlobalBeginLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPreGlobalBeginLumi_
void preStreamBeginRun(edm::StreamContext const &)
unsigned int nPreStreamBeginLumi() const
void postGlobalBeginLumi(edm::GlobalContext const &)
unsigned int nPostBeginProcessBlock() const
void postStreamBeginLumi(edm::StreamContext const &)
unsigned int nPreModuleEndJob() const
void preModuleGlobalEndLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void preGlobalWriteLumi(edm::GlobalContext const &)
std::atomic< unsigned int > nPreStreamEndRun_
void preGlobalEndLumi(edm::GlobalContext const &)
void preBeginJob(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &)
void postModuleEndProcessBlock(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void preModuleStreamEndRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPostModuleGlobalBeginLumi_
void preModuleStreamBeginRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postModuleStreamEndRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPostEndJob_
std::atomic< unsigned int > nPreModuleBeginJob_
void postStreamEndRun(edm::StreamContext const &)
void preGlobalBeginRun(edm::GlobalContext const &)
unsigned int nPostModuleStreamEndLumi() const
std::atomic< unsigned int > nPostGlobalWriteLumi_
unsigned int nPostGlobalBeginRun() const
std::atomic< unsigned int > nPostBeginProcessBlock_
unsigned int nPreModuleStreamBeginRun() const
std::atomic< unsigned int > nPostStreamBeginLumi_
void preGlobalEndRun(edm::GlobalContext const &)
std::atomic< unsigned int > nPostBeginJob_
std::atomic< unsigned int > nPostModuleEndJob_
unsigned int nPreBeginProcessBlock() const
std::atomic< unsigned int > nPostStreamEndRun_
std::atomic< unsigned int > nPreBeginStream_
void preGlobalWriteRun(edm::GlobalContext const &)
std::atomic< unsigned int > nPostModuleStreamEndRun_
std::atomic< unsigned int > nPreModuleGlobalBeginRun_
void postGlobalWriteLumi(edm::GlobalContext const &)
void preModuleBeginStream(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preModuleEndJob(edm::ModuleDescription const &)
unsigned int nPreModuleBeginJob() const
void postModuleGlobalEndLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
unsigned int nPreModuleGlobalEndRun() const
unsigned int nPostGlobalEndLumi() const
std::atomic< unsigned int > nPostGlobalWriteRun_
void preEndProcessBlock(edm::GlobalContext const &)
unsigned int nPostModuleGlobalEndRun() const
unsigned int nPreGlobalEndLumi() const
void postModuleEndStream(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preStreamBeginLumi(edm::StreamContext const &)
void postEndProcessBlock(edm::GlobalContext const &)
std::atomic< unsigned int > nPreModuleStreamBeginRun_
void postModuleGlobalBeginLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
unsigned int nPostGlobalWriteLumi() const
unsigned int nPreModuleBeginProcessBlock() const
void postModuleGlobalBeginRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
unsigned int nPostModuleStreamBeginLumi() const
unsigned int nPostModuleEndProcessBlock() const
unsigned int nPreModuleBeginStream() const
unsigned int nPostModuleEndJob() const
std::atomic< unsigned int > nPostGlobalBeginLumi_
unsigned int nPreGlobalBeginLumi() const
unsigned int nPreEndJob() const
unsigned int nPreEndStream() const
unsigned int nPreModuleStreamBeginLumi() const
unsigned int nPostModuleGlobalBeginLumi() const
void postGlobalEndLumi(edm::GlobalContext const &)
std::atomic< unsigned int > nPreModuleGlobalEndLumi_
void preEndStream(edm::StreamContext const &)
void postEndStream(edm::StreamContext const &)
std::atomic< unsigned int > nPreGlobalWriteRun_
TestServiceOne(const edm::ParameterSet &, edm::ActivityRegistry &)
std::atomic< unsigned int > nPreModuleBeginStream_
std::atomic< unsigned int > nPreModuleEndStream_
std::atomic< unsigned int > nPreGlobalEndLumi_
std::atomic< unsigned int > nPostModuleBeginProcessBlock_
unsigned int nPostStreamBeginLumi() const
unsigned int nPreStreamBeginRun() const
std::atomic< unsigned int > nPostBeginStream_
unsigned int nPostGlobalEndRun() const
void preModuleGlobalEndRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPostStreamBeginRun_
unsigned int nPostStreamEndRun() const
unsigned int nPreBeginStream() const
std::atomic< unsigned int > nPreBeginJob_
void postGlobalBeginRun(edm::GlobalContext const &)
unsigned int nPreGlobalEndRun() const
void postStreamEndLumi(edm::StreamContext const &)
std::atomic< unsigned int > nPreBeginProcessBlock_
void postGlobalWriteRun(edm::GlobalContext const &)
std::atomic< unsigned int > nPostGlobalBeginRun_
std::atomic< unsigned int > nPreModuleGlobalEndRun_
void postBeginProcessBlock(edm::GlobalContext const &)
std::atomic< unsigned int > nPostModuleEndStream_
std::atomic< unsigned int > nPostEndStream_
unsigned int nPreModuleEndStream() const
void postModuleBeginJob(edm::ModuleDescription const &)
unsigned int nPreGlobalWriteLumi() const
unsigned int nPreStreamEndRun() const
std::atomic< unsigned int > nPreEndStream_
unsigned int nPreGlobalWriteRun() const
std::atomic< unsigned int > nPreModuleGlobalBeginLumi_
unsigned int nPostModuleBeginProcessBlock() const
void preModuleBeginProcessBlock(edm::GlobalContext const &, edm::ModuleCallingContext const &)
unsigned int nPostModuleBeginJob() const
unsigned int nPreModuleGlobalBeginRun() const
void preStreamEndLumi(edm::StreamContext const &)
unsigned int nPostModuleGlobalBeginRun() const
void preStreamEndRun(edm::StreamContext const &)
void preModuleEndStream(edm::StreamContext const &, edm::ModuleCallingContext const &)
unsigned int nPostModuleEndStream() const
std::atomic< unsigned int > nPostModuleStreamBeginLumi_
void postBeginStream(edm::StreamContext const &)
void preModuleGlobalBeginRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void postModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
unsigned int nPostEndStream() const
std::atomic< unsigned int > nPreEndProcessBlock_
std::atomic< unsigned int > nPreStreamBeginRun_
unsigned int nPreBeginJob() const
unsigned int nPostGlobalBeginLumi() const
void postModuleStreamBeginRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postStreamBeginRun(edm::StreamContext const &)
void preModuleBeginJob(edm::ModuleDescription const &)
unsigned int nPostModuleStreamBeginRun() const
unsigned int nPostModuleGlobalEndLumi() const
std::atomic< unsigned int > nPreStreamEndLumi_
std::atomic< unsigned int > nPostEndProcessBlock_
std::atomic< unsigned int > nPreModuleStreamBeginLumi_
unsigned int nPreModuleStreamEndLumi() const
std::atomic< unsigned int > nPreEndJob_
std::atomic< unsigned int > nPreGlobalBeginRun_
void preBeginStream(edm::StreamContext const &)
unsigned int nPreModuleEndProcessBlock() const
unsigned int nPreModuleGlobalEndLumi() const
std::atomic< unsigned int > nPreModuleEndJob_
std::atomic< unsigned int > nPostModuleStreamEndLumi_
unsigned int nPostEndProcessBlock() const
unsigned int nPostBeginStream() const
std::atomic< unsigned int > nPreModuleStreamEndLumi_
void preModuleEndProcessBlock(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPostGlobalEndRun_
unsigned int nPostGlobalWriteRun() const
unsigned int nPostModuleStreamEndRun() const
unsigned int nPostEndJob() const
void postModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPostModuleEndProcessBlock_
std::atomic< unsigned int > nPostModuleStreamBeginRun_
void postModuleBeginProcessBlock(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void postGlobalEndRun(edm::GlobalContext const &)
std::atomic< unsigned int > nPreModuleBeginProcessBlock_
unsigned int nPreModuleStreamEndRun() const
unsigned int nPostStreamBeginRun() const
unsigned int nPostModuleBeginStream() const
std::atomic< unsigned int > nPreStreamBeginLumi_
void preGlobalBeginLumi(edm::GlobalContext const &)
void preBeginProcessBlock(edm::GlobalContext const &)
std::atomic< unsigned int > nPostModuleGlobalEndRun_
static void fillDescriptions(edm::ConfigurationDescriptions &)
void preModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::atomic< unsigned int > nPreModuleStreamEndRun_
unsigned int nPostStreamEndLumi() const
std::atomic< unsigned int > nPreModuleEndProcessBlock_
unsigned int nPreGlobalBeginRun() const
void postModuleBeginStream(edm::StreamContext const &, edm::ModuleCallingContext const &)
unsigned int nPreEndProcessBlock() const