CMS 3D CMS Logo

ExceptionThrowingProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Integration
4 // Class : ExceptionThrowingProducer
5 //
6 // Implementation:
7 // Intentionally throws exceptions in various Framework transitions.
8 // You can configure which transition. Includes some tests of
9 // the Framework behavior after an exception occurs.
10 //
11 // Original Author: W. David Dagenhart
12 // Created: 26 September 2022
13 
29 
30 #include <atomic>
31 #include <limits>
32 #include <memory>
33 
34 constexpr unsigned int kTestStreams = 4;
37 // 3 modules configured plus TriggerResultsInserter plus PathStatusInserter plus EndPathStatusInserter
41 constexpr unsigned int kStreamToThrowOn = 2;
42 
43 namespace edmtest {
44 
45  namespace {
46  struct Cache {};
47  } // namespace
48 
49  class ExceptionThrowingProducer : public edm::global::EDProducer<edm::StreamCache<Cache>,
50  edm::RunCache<Cache>,
51  edm::LuminosityBlockCache<Cache>,
52  edm::WatchProcessBlock> {
53  public:
55 
56  ~ExceptionThrowingProducer() noexcept(false) override;
61 
62  void produce(edm::StreamID, edm::Event&, edm::EventSetup const&) const override;
63 
64  std::shared_ptr<Cache> globalBeginRun(edm::Run const&, edm::EventSetup const&) const override;
65  void globalEndRun(edm::Run const&, edm::EventSetup const&) const override;
66  std::shared_ptr<Cache> globalBeginLuminosityBlock(edm::LuminosityBlock const&,
67  edm::EventSetup const&) const override;
68  void globalEndLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) const override;
69 
70  std::unique_ptr<Cache> beginStream(edm::StreamID) const override;
71  void streamBeginRun(edm::StreamID, edm::Run const&, edm::EventSetup const&) const override;
74  void streamEndRun(edm::StreamID, edm::Run const&, edm::EventSetup const&) const override;
75  void endStream(edm::StreamID) const override;
76 
77  void beginProcessBlock(edm::ProcessBlock const& processBlock) override;
78  void endProcessBlock(edm::ProcessBlock const& processBlock) override;
79 
80  void beginJob() override;
81  void endJob() override;
82 
84 
85  private:
86  const bool verbose_;
87 
97  const bool throwInBeginJob_;
98  const bool throwInBeginStream_;
101  const bool throwInEndStream_;
102  const bool throwInEndJob_;
103 
104  unsigned int nBeginJob_ = 0;
105  mutable std::atomic<unsigned int> nBeginStream_{0};
106  unsigned int nBeginProcessBlock_ = 0;
107  unsigned int nEndProcessBlock_ = 0;
108  mutable std::atomic<unsigned int> nEndStream_{0};
109  unsigned int nEndJob_ = 0;
110 
111  mutable std::vector<unsigned int> nStreamBeginLumi_;
112  mutable std::vector<unsigned int> nStreamEndLumi_;
113  mutable std::atomic<unsigned int> nGlobalBeginLumi_{0};
114  mutable std::atomic<unsigned int> nGlobalEndLumi_{0};
115 
116  mutable std::vector<unsigned int> nStreamBeginRun_;
117  mutable std::vector<unsigned int> nStreamEndRun_;
118  mutable std::atomic<unsigned int> nGlobalBeginRun_{0};
119  mutable std::atomic<unsigned int> nGlobalEndRun_{0};
120 
121  const unsigned int expectedNBeginJob_;
122  const unsigned int expectedNBeginStream_;
123  const unsigned int expectedNBeginProcessBlock_;
124  const unsigned int expectedNEndProcessBlock_;
125  const unsigned int expectedNEndStream_;
126  const unsigned int expectedNEndJob_;
128 
129  const unsigned int expectedOffsetNoEndJob_;
130  const unsigned int expectedOffsetNoEndStream_;
132 
133  const unsigned int expectedStreamBeginLumi_;
134  const unsigned int expectedOffsetNoStreamEndLumi_;
135  mutable unsigned int streamWithBeginLumiException_ = kUnset;
136  const unsigned int expectedGlobalBeginLumi_;
137  const unsigned int expectedOffsetNoGlobalEndLumi_;
138  const unsigned int expectedOffsetNoWriteLumi_;
139 
140  const unsigned int expectedStreamBeginRun_;
141  const unsigned int expectedOffsetNoStreamEndRun_;
142  mutable unsigned int streamWithBeginRunException_ = kUnset;
143  const unsigned int expectedGlobalBeginRun_;
144  const unsigned int expectedOffsetNoGlobalEndRun_;
145  const unsigned int expectedOffsetNoWriteRun_;
146 
147  mutable std::atomic<bool> streamBeginLumiExceptionOccurred_ = false;
148  mutable std::atomic<bool> streamEndLumiExceptionOccurred_ = false;
149  mutable std::atomic<bool> globalBeginLumiExceptionOccurred_ = false;
150 
151  mutable std::atomic<bool> streamBeginRunExceptionOccurred_ = false;
152  mutable std::atomic<bool> streamEndRunExceptionOccurred_ = false;
153  mutable std::atomic<bool> globalBeginRunExceptionOccurred_ = false;
154  };
155 
157  : verbose_(pset.getUntrackedParameter<bool>("verbose")),
158  eventIDThrowOnEvent_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnEvent")),
159  eventIDThrowOnGlobalBeginRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalBeginRun")),
160  eventIDThrowOnGlobalBeginLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalBeginLumi")),
161  eventIDThrowOnGlobalEndRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalEndRun")),
162  eventIDThrowOnGlobalEndLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalEndLumi")),
163  eventIDThrowOnStreamBeginRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamBeginRun")),
164  eventIDThrowOnStreamBeginLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamBeginLumi")),
165  eventIDThrowOnStreamEndRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamEndRun")),
166  eventIDThrowOnStreamEndLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamEndLumi")),
167  throwInBeginJob_(pset.getUntrackedParameter<bool>("throwInBeginJob")),
168  throwInBeginStream_(pset.getUntrackedParameter<bool>("throwInBeginStream")),
169  throwInBeginProcessBlock_(pset.getUntrackedParameter<bool>("throwInBeginProcessBlock")),
170  throwInEndProcessBlock_(pset.getUntrackedParameter<bool>("throwInEndProcessBlock")),
171  throwInEndStream_(pset.getUntrackedParameter<bool>("throwInEndStream")),
172  throwInEndJob_(pset.getUntrackedParameter<bool>("throwInEndJob")),
173  nStreamBeginLumi_(kTestStreams, 0),
174  nStreamEndLumi_(kTestStreams, 0),
175  nStreamBeginRun_(kTestStreams, 0),
176  nStreamEndRun_(kTestStreams, 0),
177  expectedNBeginJob_(pset.getUntrackedParameter<unsigned int>("expectedNBeginJob")),
178  expectedNBeginStream_(pset.getUntrackedParameter<unsigned int>("expectedNBeginStream")),
179  expectedNBeginProcessBlock_(pset.getUntrackedParameter<unsigned int>("expectedNBeginProcessBlock")),
180  expectedNEndProcessBlock_(pset.getUntrackedParameter<unsigned int>("expectedNEndProcessBlock")),
181  expectedNEndStream_(pset.getUntrackedParameter<unsigned int>("expectedNEndStream")),
182  expectedNEndJob_(pset.getUntrackedParameter<unsigned int>("expectedNEndJob")),
183  expectNoRunsProcessed_(pset.getUntrackedParameter<bool>("expectNoRunsProcessed")),
184  expectedOffsetNoEndJob_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoEndJob")),
185  expectedOffsetNoEndStream_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoEndStream")),
186  expectedOffsetNoEndProcessBlock_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoEndProcessBlock")),
187  expectedStreamBeginLumi_(pset.getUntrackedParameter<unsigned int>("expectedStreamBeginLumi")),
188  expectedOffsetNoStreamEndLumi_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoStreamEndLumi")),
189  expectedGlobalBeginLumi_(pset.getUntrackedParameter<unsigned int>("expectedGlobalBeginLumi")),
190  expectedOffsetNoGlobalEndLumi_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoGlobalEndLumi")),
191  expectedOffsetNoWriteLumi_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoWriteLumi")),
192  expectedStreamBeginRun_(pset.getUntrackedParameter<unsigned int>("expectedStreamBeginRun")),
193  expectedOffsetNoStreamEndRun_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoStreamEndRun")),
194  expectedGlobalBeginRun_(pset.getUntrackedParameter<unsigned int>("expectedGlobalBeginRun")),
195  expectedOffsetNoGlobalEndRun_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoGlobalEndRun")),
196  expectedOffsetNoWriteRun_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoWriteRun")) {}
197 
200  edm::LogAbsolute("ExceptionThrowingProducer")
201  << "ExceptionThrowingProducer::beginJob did not run expected number of times.";
202  edm::LogAbsolute("ExceptionThrowingProducer") << "At least one test in ExceptionThrowingProducer FAILED";
203  } else if (nEndJob_ != expectedNEndJob_) {
204  edm::LogAbsolute("ExceptionThrowingProducer")
205  << "ExceptionThrowingProducer::endJob did not run expected number of times.";
206  edm::LogAbsolute("ExceptionThrowingProducer") << "At least one test in ExceptionThrowingProducer FAILED";
207  } else if (nEndJob_ == 0u && nBeginProcessBlock_ == 0 && nEndProcessBlock_ == 0 && nBeginStream_.load() == 0 &&
208  nEndStream_.load() == 0 && nGlobalBeginRun_.load() == 0 && nGlobalEndRun_.load() == 0) {
209  edm::LogAbsolute("ExceptionThrowingProducer") << "All tests in ExceptionThrowingProducer PASSED";
210  }
211 
213 
214  if (verbose_) {
215  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPostEndJob = " << serviceOne->nPostEndJob();
216  edm::LogAbsolute("ExceptionThrowingProducer")
217  << "serviceOne->nPreModuleEndJob = " << serviceOne->nPreModuleEndJob();
218  edm::LogAbsolute("ExceptionThrowingProducer")
219  << "serviceOne->nPostModuleEndJob = " << serviceOne->nPostModuleEndJob();
220  }
221 
222  if (serviceOne->nPostEndJob() != nBeginJob_ ||
225  edm::LogAbsolute("ExceptionThrowingProducer")
226  << "FAILED: Unexpected number of service end job related signals in TestServiceOne, checking while in "
227  "ExceptionThrowingProducer destructor";
228  edm::LogAbsolute("ExceptionThrowingProducer") << "At least one test in ExceptionThrowingProducer FAILED";
229  }
230  }
231 
233  if (event.id() == eventIDThrowOnEvent_) {
234  throw cms::Exception("IntentionalTestException")
235  << "ExceptionThrowingProducer::produce, module configured to throw on: " << eventIDThrowOnEvent_;
236  }
237  }
238 
239  std::shared_ptr<Cache> ExceptionThrowingProducer::globalBeginRun(edm::Run const& run, edm::EventSetup const&) const {
244  throw cms::Exception("IntentionalTestException")
245  << "ExceptionThrowingProducer::globalBeginRun, module configured to throw on: "
247  }
248  return std::make_shared<Cache>();
249  }
250 
252  ++nGlobalEndRun_;
255  throw cms::Exception("IntentionalTestException")
256  << "ExceptionThrowingProducer::globalEndRun, module configured to throw on: " << eventIDThrowOnGlobalEndRun_;
257  }
258  }
259 
261  edm::EventSetup const&) const {
263  if (edm::EventID(lumi.id().run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
266  throw cms::Exception("IntentionalTestException")
267  << "ExceptionThrowingProducer::globalBeginLuminosityBlock, module configured to throw on: "
269  }
270  return std::make_shared<Cache>();
271  }
272 
274  edm::EventSetup const&) const {
275  ++nGlobalEndLumi_;
276  if (edm::EventID(lumi.id().run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
278  throw cms::Exception("IntentionalTestException")
279  << "ExceptionThrowingProducer::globalEndLuminosityBlock, module configured to throw on: "
281  }
282  }
283 
284  std::unique_ptr<Cache> ExceptionThrowingProducer::beginStream(edm::StreamID streamID) const {
285  ++nBeginStream_;
286  if (throwInBeginStream_ && streamID.value() == kStreamToThrowOn) {
287  throw cms::Exception("IntentionalTestException")
288  << "ExceptionThrowingProducer::beginStream, module configured to throw during beginStream for stream: "
289  << kStreamToThrowOn;
290  }
291  return std::make_unique<Cache>();
292  }
293 
295  edm::Run const& run,
296  edm::EventSetup const&) const {
297  if (iStream < kTestStreams) {
298  ++nStreamBeginRun_[iStream];
299  }
300 
301  bool expected = false;
304  streamBeginRunExceptionOccurred_.compare_exchange_strong(expected, true)) {
305  // Remember which stream threw
307  throw cms::Exception("IntentionalTestException")
308  << "ExceptionThrowingProducer::streamBeginRun, module configured to throw on: "
310  }
311  }
312 
314  edm::LuminosityBlock const& lumi,
315  edm::EventSetup const&) const {
316  if (iStream < kTestStreams) {
317  ++nStreamBeginLumi_[iStream];
318  }
319 
320  // Throw if this lumi's ID matches the configured ID (this code is written so
321  // that only the first stream to match it will throw).
322  bool expected = false;
323  if (edm::EventID(lumi.run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
325  streamBeginLumiExceptionOccurred_.compare_exchange_strong(expected, true)) {
326  // Remember which stream threw
328 
329  throw cms::Exception("IntentionalTestException")
330  << "ExceptionThrowingProducer::streamBeginLuminosityBlock, module configured to throw on: "
332  }
333  }
334 
336  edm::LuminosityBlock const& lumi,
337  edm::EventSetup const&) const {
338  if (iStream < kTestStreams) {
339  ++nStreamEndLumi_[iStream];
340  }
341 
342  bool expected = false;
343  if (edm::EventID(lumi.run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
345  streamEndLumiExceptionOccurred_.compare_exchange_strong(expected, true)) {
346  throw cms::Exception("IntentionalTestException")
347  << "ExceptionThrowingProducer::streamEndLuminosityBlock, module configured to throw on: "
349  }
350  }
351 
353  edm::Run const& run,
354  edm::EventSetup const&) const {
355  if (iStream < kTestStreams) {
356  ++nStreamEndRun_[iStream];
357  }
358 
359  bool expected = false;
362  streamEndRunExceptionOccurred_.compare_exchange_strong(expected, true)) {
363  throw cms::Exception("IntentionalTestException")
364  << "ExceptionThrowingProducer::streamEndRun, module configured to throw on: " << eventIDThrowOnStreamEndRun_;
365  }
366  }
367 
369  ++nEndStream_;
370  if (throwInEndStream_ && streamID.value() == kStreamToThrowOn) {
371  throw cms::Exception("IntentionalTestException")
372  << "ExceptionThrowingProducer::endStream, module configured to throw during endStream for stream: "
373  << kStreamToThrowOn;
374  }
375  }
376 
380  throw cms::Exception("IntentionalTestException")
381  << "ExceptionThrowingProducer::beginProcessBlock, module configured to throw during beginProcessBlock";
382  }
383  }
384 
388  throw cms::Exception("IntentionalTestException")
389  << "ExceptionThrowingProducer::endProcessBlock, module configured to throw during endProcessBlock";
390  }
391  }
392 
394  ++nBeginJob_;
395  if (throwInBeginJob_) {
396  throw cms::Exception("IntentionalTestException")
397  << "ExceptionThrowingProducer::beginJob, module configured to throw during beginJob";
398  }
399  }
400 
402  ++nEndJob_;
403 
404  bool testsPass = true;
405 
406  if (nBeginStream_.load() != expectedNBeginStream_) {
407  edm::LogAbsolute("ExceptionThrowingProducer")
408  << "FAILED: Unexpected number of beginStream transitions, saw: " << nBeginStream_.load()
409  << " expected: " << expectedNBeginStream_;
410  testsPass = false;
411  }
412 
414  edm::LogAbsolute("ExceptionThrowingProducer")
415  << "FAILED: Unexpected number of beginProcessBlock transitions, saw: " << nBeginProcessBlock_
416  << " expected: " << expectedNBeginProcessBlock_;
417  testsPass = false;
418  }
419 
421  edm::LogAbsolute("ExceptionThrowingProducer")
422  << "FAILED: Unexpected number of endProcessBlock transitions, saw: " << nEndProcessBlock_
423  << " expected: " << expectedNEndProcessBlock_;
424  testsPass = false;
425  }
426 
427  if (nEndStream_.load() != expectedNEndStream_) {
428  edm::LogAbsolute("ExceptionThrowingProducer")
429  << "FAILED: Unexpected number of endStream transitions, saw: " << nEndStream_.load()
430  << " expected: " << expectedNEndStream_;
431  testsPass = false;
432  }
433 
434  if (expectNoRunsProcessed_ && nGlobalBeginRun_.load() != 0) {
435  edm::LogAbsolute("ExceptionThrowingProducer")
436  << "FAILED: Unexpected number of globalBeginRun transitions, saw: " << nGlobalBeginRun_.load()
437  << " expected: " << 0;
438  testsPass = false;
439  }
440 
441  unsigned int totalStreamBeginLumi = 0;
442  unsigned int i = 0;
443  for (auto const& nStreamBeginLumi : nStreamBeginLumi_) {
444  totalStreamBeginLumi += nStreamBeginLumi;
445 
446  // Don't know exact number to expect because streams might skip a lumi so
447  // only throw if it is greater than the maximum possible and we only know
448  // that for sure if the exception was thrown in stream begin lumi.
449  if (nStreamBeginLumi > expectedStreamBeginLumi_ && streamWithBeginLumiException_ != kUnset) {
450  edm::LogAbsolute("ExceptionThrowingProducer")
451  << "FAILED: More than maximum possible number of streamBeginLumi transitions, stream " << i << " saw "
452  << nStreamBeginLumi << " max possible " << expectedStreamBeginLumi_;
453  testsPass = false;
454  }
455  unsigned int expectedStreamEndLumi =
456  (streamWithBeginLumiException_ == i) ? nStreamBeginLumi - 1 : nStreamBeginLumi;
457  if (nStreamEndLumi_[i] != expectedStreamEndLumi) {
458  edm::LogAbsolute("ExceptionThrowingProducer")
459  << "FAILED: Unexpected number of streamEndLumi transitions, stream " << i << " saw " << nStreamEndLumi_[i]
460  << " expected " << expectedStreamEndLumi;
461  testsPass = false;
462  }
463 
464  ++i;
465  }
466 
467  unsigned int totalStreamBeginRun = 0;
468  i = 0;
469  for (auto const& nStreamBeginRun : nStreamBeginRun_) {
470  totalStreamBeginRun += nStreamBeginRun;
471 
472  // Don't know exact number to expect because streams might skip a run (not yet
473  // but probably in the future) so only throw if it is greater than the maximum
474  // possible and we only know that for sure if the exception was thrown in stream begin run.
475  if (nStreamBeginRun > expectedStreamBeginRun_ && streamWithBeginRunException_ != kUnset) {
476  edm::LogAbsolute("ExceptionThrowingProducer")
477  << "FAILED: More than maximum possible number of streamBeginRun transitions, stream " << i << " saw "
478  << nStreamBeginRun << " max possible " << expectedStreamBeginRun_;
479  testsPass = false;
480  }
481  unsigned int expectedStreamEndRun = (streamWithBeginRunException_ == i) ? nStreamBeginRun - 1 : nStreamBeginRun;
482  if (nStreamEndRun_[i] != expectedStreamEndRun) {
483  edm::LogAbsolute("ExceptionThrowingProducer")
484  << "FAILED: Unexpected number of streamEndRun transitions, stream " << i << " saw " << nStreamEndRun_[i]
485  << " expected " << expectedStreamEndRun;
486  testsPass = false;
487  }
488 
489  ++i;
490  }
491 
492  // There has to be at least as many global begin lumi transitions
493  // as expected. Because of concurrency, the Framework might already have
494  // started other lumis ahead of the one where an exception occurs.
496  edm::LogAbsolute("ExceptionThrowingProducer")
497  << "FAILED: Less than the expected number of globalBeginLumi transitions, expected at least "
498  << expectedGlobalBeginLumi_ << " saw " << nGlobalBeginLumi_.load();
499  testsPass = false;
500  }
501 
502  // There has to be at least as many global begin run transitions
503  // as expected. Because of concurrency, the Framework might already have
504  // started other runs ahead of the one where an exception occurs.
506  edm::LogAbsolute("ExceptionThrowingProducer")
507  << "FAILED: Less than the expected number of globalBeginRun transitions, expected at least "
508  << expectedGlobalBeginRun_ << " saw " << nGlobalBeginRun_.load();
509  testsPass = false;
510  }
511 
512  unsigned int expectedGlobalEndLumi =
514  if (nGlobalEndLumi_.load() != expectedGlobalEndLumi) {
515  edm::LogAbsolute("ExceptionThrowingProducer")
516  << "FAILED: number of global end lumi transitions not equal to expected value, expected "
517  << expectedGlobalEndLumi << " saw " << nGlobalEndLumi_.load();
518  testsPass = false;
519  }
520 
521  unsigned int expectedGlobalEndRun =
523  if (nGlobalEndRun_.load() != expectedGlobalEndRun) {
524  edm::LogAbsolute("ExceptionThrowingProducer")
525  << "FAILED: number of global end run transitions not equal to expected value, expected "
526  << expectedGlobalEndRun << " saw " << nGlobalEndRun_.load();
527  testsPass = false;
528  }
529 
531  if (serviceOne->nPreBeginJob() != nBeginJob_ || serviceOne->nPostBeginJob() != nBeginJob_ ||
532  serviceOne->nPreEndJob() != nBeginJob_ ||
535  edm::LogAbsolute("ExceptionThrowingProducer")
536  << "FAILED: Unexpected number of service transitions in TestServiceOne, beginJob and endJob";
537  testsPass = false;
538  }
539 
540  if (serviceOne->nPreBeginStream() != nBeginStream_ || serviceOne->nPostBeginStream() != nBeginStream_ ||
541  serviceOne->nPreEndStream() != nBeginStream_ || serviceOne->nPostEndStream() != nBeginStream_ ||
544  serviceOne->nPreModuleEndStream() !=
546  serviceOne->nPostModuleEndStream() !=
548  edm::LogAbsolute("ExceptionThrowingProducer")
549  << "FAILED: Unexpected number of service transitions in TestServiceOne, beginStream and endStream";
550  testsPass = false;
551  }
552 
553  if (serviceOne->nPreBeginProcessBlock() != nBeginProcessBlock_ ||
554  serviceOne->nPostBeginProcessBlock() != nBeginProcessBlock_ ||
555  serviceOne->nPreEndProcessBlock() != nBeginProcessBlock_ ||
556  serviceOne->nPostEndProcessBlock() != nBeginProcessBlock_ ||
557  serviceOne->nPreModuleBeginProcessBlock() !=
559  serviceOne->nPostModuleBeginProcessBlock() !=
561  serviceOne->nPreModuleEndProcessBlock() !=
563  serviceOne->nPostModuleEndProcessBlock() !=
565  edm::LogAbsolute("ExceptionThrowingProducer") << "FAILED: Unexpected number of service transitions in "
566  "TestServiceOne, beginProcessBlock and endProcessBlock";
567  testsPass = false;
568  }
569 
570  if (serviceOne->nPreStreamBeginLumi() != totalStreamBeginLumi ||
571  serviceOne->nPostStreamBeginLumi() != totalStreamBeginLumi ||
572  serviceOne->nPreStreamEndLumi() != totalStreamBeginLumi ||
573  serviceOne->nPostStreamEndLumi() != totalStreamBeginLumi ||
574  serviceOne->nPreModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
575  serviceOne->nPostModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
576  serviceOne->nPreModuleStreamEndLumi() !=
577  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_ ||
578  serviceOne->nPostModuleStreamEndLumi() !=
579  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_) {
580  edm::LogAbsolute("ExceptionThrowingProducer")
581  << "FAILED: Unexpected number of service transitions in TestServiceOne, stream lumi";
582  testsPass = false;
583  }
584 
586  if (serviceTwo->nPreStreamBeginLumi() != totalStreamBeginLumi ||
587  serviceTwo->nPostStreamBeginLumi() != totalStreamBeginLumi ||
588  serviceTwo->nPreStreamEndLumi() != totalStreamBeginLumi ||
589  serviceTwo->nPostStreamEndLumi() != totalStreamBeginLumi ||
590  serviceTwo->nPreModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
591  serviceTwo->nPostModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
592  serviceTwo->nPreModuleStreamEndLumi() !=
593  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_ ||
594  serviceTwo->nPostModuleStreamEndLumi() !=
595  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_) {
596  edm::LogAbsolute("ExceptionThrowingProducer")
597  << "FAILED: Unexpected number of service transitions in TestServiceTwo, stream lumi";
598  testsPass = false;
599  }
600 
601  unsigned int nGlobalBeginLumi = nGlobalBeginLumi_.load();
602 
603  if (serviceOne->nPreGlobalBeginLumi() != nGlobalBeginLumi ||
604  serviceOne->nPostGlobalBeginLumi() != nGlobalBeginLumi || serviceOne->nPreGlobalEndLumi() != nGlobalBeginLumi ||
605  serviceOne->nPostGlobalEndLumi() != nGlobalBeginLumi ||
606  serviceOne->nPreModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
607  serviceOne->nPostModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
608  serviceOne->nPreModuleGlobalEndLumi() !=
610  serviceOne->nPostModuleGlobalEndLumi() !=
612  serviceOne->nPreGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_ ||
613  serviceOne->nPostGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_) {
614  edm::LogAbsolute("ExceptionThrowingProducer")
615  << "FAILED: Unexpected number of service transitions in TestServiceOne, global lumi";
616  testsPass = false;
617  }
618 
619  if (serviceTwo->nPreGlobalBeginLumi() != nGlobalBeginLumi ||
620  serviceTwo->nPostGlobalBeginLumi() != nGlobalBeginLumi || serviceTwo->nPreGlobalEndLumi() != nGlobalBeginLumi ||
621  serviceTwo->nPostGlobalEndLumi() != nGlobalBeginLumi ||
622  serviceTwo->nPreModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
623  serviceTwo->nPostModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
624  serviceTwo->nPreModuleGlobalEndLumi() !=
626  serviceTwo->nPostModuleGlobalEndLumi() !=
628  serviceTwo->nPreGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_ ||
629  serviceTwo->nPostGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_) {
630  edm::LogAbsolute("ExceptionThrowingProducer")
631  << "FAILED: Unexpected number of service transitions in TestServiceTwo, global lumi";
632  testsPass = false;
633  }
634 
635  if (serviceOne->nPreStreamBeginRun() != totalStreamBeginRun ||
636  serviceOne->nPostStreamBeginRun() != totalStreamBeginRun ||
637  serviceOne->nPreStreamEndRun() != totalStreamBeginRun ||
638  serviceOne->nPostStreamEndRun() != totalStreamBeginRun ||
639  serviceOne->nPreModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
640  serviceOne->nPostModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
641  serviceOne->nPreModuleStreamEndRun() !=
642  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_ ||
643  serviceOne->nPostModuleStreamEndRun() !=
644  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_) {
645  edm::LogAbsolute("ExceptionThrowingProducer")
646  << "FAILED: Unexpected number of service transitions in TestServiceOne, stream run";
647  testsPass = false;
648  }
649 
650  if (serviceTwo->nPreStreamBeginRun() != totalStreamBeginRun ||
651  serviceTwo->nPostStreamBeginRun() != totalStreamBeginRun ||
652  serviceTwo->nPreStreamEndRun() != totalStreamBeginRun ||
653  serviceTwo->nPostStreamEndRun() != totalStreamBeginRun ||
654  serviceTwo->nPreModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
655  serviceTwo->nPostModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
656  serviceTwo->nPreModuleStreamEndRun() !=
657  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_ ||
658  serviceTwo->nPostModuleStreamEndRun() !=
659  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_) {
660  edm::LogAbsolute("ExceptionThrowingProducer")
661  << "FAILED: Unexpected number of service transitions in TestServiceTwo, stream run";
662  testsPass = false;
663  }
664 
665  unsigned int nGlobalBeginRun = nGlobalBeginRun_.load();
666 
667  if (serviceOne->nPreGlobalBeginRun() != nGlobalBeginRun || serviceOne->nPostGlobalBeginRun() != nGlobalBeginRun ||
668  serviceOne->nPreGlobalEndRun() != nGlobalBeginRun || serviceOne->nPostGlobalEndRun() != nGlobalBeginRun ||
669  serviceOne->nPreModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
670  serviceOne->nPostModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
671  serviceOne->nPreModuleGlobalEndRun() !=
673  serviceOne->nPostModuleGlobalEndRun() !=
675  serviceOne->nPreGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_ ||
676  serviceOne->nPostGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_) {
677  edm::LogAbsolute("ExceptionThrowingProducer")
678  << "FAILED: Unexpected number of service transitions in TestServiceOne, global run";
679  testsPass = false;
680  }
681 
682  if (serviceTwo->nPreGlobalBeginRun() != nGlobalBeginRun || serviceTwo->nPostGlobalBeginRun() != nGlobalBeginRun ||
683  serviceTwo->nPreGlobalEndRun() != nGlobalBeginRun || serviceTwo->nPostGlobalEndRun() != nGlobalBeginRun ||
684  serviceTwo->nPreModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
685  serviceTwo->nPostModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
686  serviceTwo->nPreModuleGlobalEndRun() !=
688  serviceTwo->nPostModuleGlobalEndRun() !=
690  serviceTwo->nPreGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_ ||
691  serviceTwo->nPostGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_) {
692  edm::LogAbsolute("ExceptionThrowingProducer")
693  << "FAILED: Unexpected number of service transitions in TestServiceTwo, global run";
694  testsPass = false;
695  }
696 
697  if (verbose_) {
698  edm::LogAbsolute("ExceptionThrowingProducer") << "nBeginJob_ = " << nBeginJob_;
699  edm::LogAbsolute("ExceptionThrowingProducer") << "nBeginStream_ = " << nBeginStream_.load();
700  edm::LogAbsolute("ExceptionThrowingProducer") << "nBeginProcessBlock_ = " << nBeginProcessBlock_;
701  edm::LogAbsolute("ExceptionThrowingProducer") << "nEndProcessBlock_ = " << nEndProcessBlock_;
702  edm::LogAbsolute("ExceptionThrowingProducer") << "nEndStream_ = " << nEndStream_.load();
703  edm::LogAbsolute("ExceptionThrowingProducer") << "nEndJob_ = " << nEndJob_ << "\n";
704 
705  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalBeginLumi_ = " << nGlobalBeginLumi_;
706  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalEndLumi_ = " << nGlobalEndLumi_;
707  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalBeginRun_ = " << nGlobalBeginRun_;
708  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalEndRun_ = " << nGlobalEndRun_ << "\n";
709 
710  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPreBeginJob = " << serviceOne->nPreBeginJob();
711  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPostBeginJob = " << serviceOne->nPostBeginJob();
712  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPreEndJob = " << serviceOne->nPreEndJob();
713 
714  edm::LogAbsolute("ExceptionThrowingProducer")
715  << "serviceOne->nPreModuleBeginJob = " << serviceOne->nPreModuleBeginJob();
716  edm::LogAbsolute("ExceptionThrowingProducer")
717  << "serviceOne->nPostModuleBeginJob = " << serviceOne->nPostModuleBeginJob() << "\n";
718 
719  edm::LogAbsolute("ExceptionThrowingProducer")
720  << "serviceOne->nPreBeginStream = " << serviceOne->nPreBeginStream();
721  edm::LogAbsolute("ExceptionThrowingProducer")
722  << "serviceOne->nPostBeginStream = " << serviceOne->nPostBeginStream();
723  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPreEndStream = " << serviceOne->nPreEndStream();
724  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPostEndStream = " << serviceOne->nPostEndStream();
725 
726  edm::LogAbsolute("ExceptionThrowingProducer")
727  << "serviceOne->nPreModuleBeginStream = " << serviceOne->nPreModuleBeginStream();
728  edm::LogAbsolute("ExceptionThrowingProducer")
729  << "serviceOne->nPostModuleBeginStream = " << serviceOne->nPostModuleBeginStream();
730  edm::LogAbsolute("ExceptionThrowingProducer")
731  << "serviceOne->nPreModuleEndStream = " << serviceOne->nPreModuleEndStream();
732  edm::LogAbsolute("ExceptionThrowingProducer")
733  << "serviceOne->nPostModuleEndStream = " << serviceOne->nPostModuleEndStream() << "\n";
734 
735  edm::LogAbsolute("ExceptionThrowingProducer")
736  << "serviceOne->nPreBeginProcessBlock = " << serviceOne->nPreBeginProcessBlock();
737  edm::LogAbsolute("ExceptionThrowingProducer")
738  << "serviceOne->nPostBeginProcessBlock = " << serviceOne->nPostBeginProcessBlock();
739  edm::LogAbsolute("ExceptionThrowingProducer")
740  << "serviceOne->nPreEndProcessBlock = " << serviceOne->nPreEndProcessBlock();
741  edm::LogAbsolute("ExceptionThrowingProducer")
742  << "serviceOne->nPostEndProcessBlock = " << serviceOne->nPostEndProcessBlock();
743 
744  edm::LogAbsolute("ExceptionThrowingProducer")
745  << "serviceOne->nPreModuleBeginProcessBlock = " << serviceOne->nPreModuleBeginProcessBlock();
746  edm::LogAbsolute("ExceptionThrowingProducer")
747  << "serviceOne->nPostModuleBeginProcessBlock = " << serviceOne->nPostModuleBeginProcessBlock();
748  edm::LogAbsolute("ExceptionThrowingProducer")
749  << "serviceOne->nPreModuleEndProcessBlock = " << serviceOne->nPreModuleEndProcessBlock();
750  edm::LogAbsolute("ExceptionThrowingProducer")
751  << "serviceOne->nPostModuleEndProcessBlock = " << serviceOne->nPostModuleEndProcessBlock() << "\n";
752 
753  edm::LogAbsolute("ExceptionThrowingProducer")
754  << "serviceOne->nPreStreamBeginLumi = " << serviceOne->nPreStreamBeginLumi();
755  edm::LogAbsolute("ExceptionThrowingProducer")
756  << "serviceOne->nPostStreamBeginLumi = " << serviceOne->nPostStreamBeginLumi();
757  edm::LogAbsolute("ExceptionThrowingProducer")
758  << "serviceOne->nPreStreamEndLumi = " << serviceOne->nPreStreamEndLumi();
759  edm::LogAbsolute("ExceptionThrowingProducer")
760  << "serviceOne->nPostStreamEndLumi = " << serviceOne->nPostStreamEndLumi();
761  edm::LogAbsolute("ExceptionThrowingProducer")
762  << "serviceOne->nPreModuleStreamBeginLumi = " << serviceOne->nPreModuleStreamBeginLumi();
763  edm::LogAbsolute("ExceptionThrowingProducer")
764  << "serviceOne->nPostModuleStreamBeginLumi = " << serviceOne->nPostModuleStreamBeginLumi();
765  edm::LogAbsolute("ExceptionThrowingProducer")
766  << "serviceOne->nPreModuleStreamEndLumi = " << serviceOne->nPreModuleStreamEndLumi();
767  edm::LogAbsolute("ExceptionThrowingProducer")
768  << "serviceOne->nPostModuleStreamEndLumi = " << serviceOne->nPostModuleStreamEndLumi() << "\n";
769 
770  edm::LogAbsolute("ExceptionThrowingProducer")
771  << "serviceOne->nPreGlobalBeginLumi = " << serviceOne->nPreGlobalBeginLumi();
772  edm::LogAbsolute("ExceptionThrowingProducer")
773  << "serviceOne->nPostGlobalBeginLumi = " << serviceOne->nPostGlobalBeginLumi();
774  edm::LogAbsolute("ExceptionThrowingProducer")
775  << "serviceOne->nPreGlobalEndLumi = " << serviceOne->nPreGlobalEndLumi();
776  edm::LogAbsolute("ExceptionThrowingProducer")
777  << "serviceOne->nPostGlobalEndLumi = " << serviceOne->nPostGlobalEndLumi();
778  edm::LogAbsolute("ExceptionThrowingProducer")
779  << "serviceOne->nPreModuleGlobalBeginLumi = " << serviceOne->nPreModuleGlobalBeginLumi();
780  edm::LogAbsolute("ExceptionThrowingProducer")
781  << "serviceOne->nPostModuleGlobalBeginLumi = " << serviceOne->nPostModuleGlobalBeginLumi();
782  edm::LogAbsolute("ExceptionThrowingProducer")
783  << "serviceOne->nPreModuleGlobalEndLumi = " << serviceOne->nPreModuleGlobalEndLumi();
784  edm::LogAbsolute("ExceptionThrowingProducer")
785  << "serviceOne->nPostModuleGlobalEndLumi = " << serviceOne->nPostModuleGlobalEndLumi();
786  edm::LogAbsolute("ExceptionThrowingProducer")
787  << "serviceOne->nPreGlobalWriteLumi = " << serviceOne->nPreGlobalWriteLumi();
788  edm::LogAbsolute("ExceptionThrowingProducer")
789  << "serviceOne->nPostGlobalWriteLumi = " << serviceOne->nPostGlobalWriteLumi() << "\n";
790 
791  edm::LogAbsolute("ExceptionThrowingProducer")
792  << "serviceOne->nPreStreamBeginRun = " << serviceOne->nPreStreamBeginRun();
793  edm::LogAbsolute("ExceptionThrowingProducer")
794  << "serviceOne->nPostStreamBeginRun = " << serviceOne->nPostStreamBeginRun();
795  edm::LogAbsolute("ExceptionThrowingProducer")
796  << "serviceOne->nPreStreamEndRun = " << serviceOne->nPreStreamEndRun();
797  edm::LogAbsolute("ExceptionThrowingProducer")
798  << "serviceOne->nPostStreamEndRun = " << serviceOne->nPostStreamEndRun();
799  edm::LogAbsolute("ExceptionThrowingProducer")
800  << "serviceOne->nPreModuleStreamBeginRun = " << serviceOne->nPreModuleStreamBeginRun();
801  edm::LogAbsolute("ExceptionThrowingProducer")
802  << "serviceOne->nPostModuleStreamBeginRun = " << serviceOne->nPostModuleStreamBeginRun();
803  edm::LogAbsolute("ExceptionThrowingProducer")
804  << "serviceOne->nPreModuleStreamEndRun = " << serviceOne->nPreModuleStreamEndRun();
805  edm::LogAbsolute("ExceptionThrowingProducer")
806  << "serviceOne->nPostModuleStreamEndRun = " << serviceOne->nPostModuleStreamEndRun() << "\n";
807 
808  edm::LogAbsolute("ExceptionThrowingProducer")
809  << "serviceOne->nPreGlobalBeginRun = " << serviceOne->nPreGlobalBeginRun();
810  edm::LogAbsolute("ExceptionThrowingProducer")
811  << "serviceOne->nPostGlobalBeginRun = " << serviceOne->nPostGlobalBeginRun();
812  edm::LogAbsolute("ExceptionThrowingProducer")
813  << "serviceOne->nPreGlobalEndRun = " << serviceOne->nPreGlobalEndRun();
814  edm::LogAbsolute("ExceptionThrowingProducer")
815  << "serviceOne->nPostGlobalEndRun = " << serviceOne->nPostGlobalEndRun();
816  edm::LogAbsolute("ExceptionThrowingProducer")
817  << "serviceOne->nPreModuleGlobalBeginRun = " << serviceOne->nPreModuleGlobalBeginRun();
818  edm::LogAbsolute("ExceptionThrowingProducer")
819  << "serviceOne->nPostModuleGlobalBeginRun = " << serviceOne->nPostModuleGlobalBeginRun();
820  edm::LogAbsolute("ExceptionThrowingProducer")
821  << "serviceOne->nPreModuleGlobalEndRun = " << serviceOne->nPreModuleGlobalEndRun();
822  edm::LogAbsolute("ExceptionThrowingProducer")
823  << "serviceOne->nPostModuleGlobalEndRun = " << serviceOne->nPostModuleGlobalEndRun();
824  edm::LogAbsolute("ExceptionThrowingProducer")
825  << "serviceOne->nPreGlobalWriteRun = " << serviceOne->nPreGlobalWriteRun();
826  edm::LogAbsolute("ExceptionThrowingProducer")
827  << "serviceOne->nPostGlobalWriteRun = " << serviceOne->nPostGlobalWriteRun() << "\n";
828  }
829 
830  if (testsPass) {
831  edm::LogAbsolute("ExceptionThrowingProducer") << "All tests in ExceptionThrowingProducer PASSED";
832  } else {
833  edm::LogAbsolute("ExceptionThrowingProducer") << "At least one test in ExceptionThrowingProducer FAILED";
834  }
835 
836  if (throwInEndJob_) {
837  throw cms::Exception("IntentionalTestException")
838  << "ExceptionThrowingProducer::endJob, module configured to throw during endJob";
839  }
840  }
841 
844  edm::EventID invalidEventID;
845  desc.addUntracked<bool>("verbose", false);
846  desc.addUntracked<edm::EventID>("eventIDThrowOnEvent", invalidEventID);
847  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalBeginRun", invalidEventID);
848  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalBeginLumi", invalidEventID);
849  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalEndRun", invalidEventID);
850  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalEndLumi", invalidEventID);
851  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamBeginRun", invalidEventID);
852  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamBeginLumi", invalidEventID);
853  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamEndRun", invalidEventID);
854  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamEndLumi", invalidEventID);
855 
856  desc.addUntracked<bool>("throwInBeginJob", false);
857  desc.addUntracked<bool>("throwInBeginStream", false);
858  desc.addUntracked<bool>("throwInBeginProcessBlock", false);
859  desc.addUntracked<bool>("throwInEndProcessBlock", false);
860  desc.addUntracked<bool>("throwInEndStream", false);
861  desc.addUntracked<bool>("throwInEndJob", false);
862 
863  desc.addUntracked<unsigned int>("expectedNBeginJob", 1);
864  desc.addUntracked<unsigned int>("expectedNBeginStream", 4);
865  desc.addUntracked<unsigned int>("expectedNBeginProcessBlock", 1);
866  desc.addUntracked<unsigned int>("expectedNEndProcessBlock", 1);
867  desc.addUntracked<unsigned int>("expectedNEndStream", 4);
868  desc.addUntracked<unsigned int>("expectedNEndJob", 1);
869  desc.addUntracked<bool>("expectNoRunsProcessed", false);
870  desc.addUntracked<unsigned int>("expectedOffsetNoEndJob", 0);
871  desc.addUntracked<unsigned int>("expectedOffsetNoEndStream", 0);
872  desc.addUntracked<unsigned int>("expectedOffsetNoEndProcessBlock", 0);
873  desc.addUntracked<unsigned int>("expectedStreamBeginLumi", kUnset);
874  desc.addUntracked<unsigned int>("expectedOffsetNoStreamEndLumi", 0);
875  desc.addUntracked<unsigned int>("expectedGlobalBeginLumi", 0);
876  desc.addUntracked<unsigned int>("expectedOffsetNoGlobalEndLumi", 0);
877  desc.addUntracked<unsigned int>("expectedOffsetNoWriteLumi", 0);
878 
879  desc.addUntracked<unsigned int>("expectedStreamBeginRun", kUnset);
880  desc.addUntracked<unsigned int>("expectedOffsetNoStreamEndRun", 0);
881  desc.addUntracked<unsigned int>("expectedGlobalBeginRun", 0);
882  desc.addUntracked<unsigned int>("expectedOffsetNoGlobalEndRun", 0);
883  desc.addUntracked<unsigned int>("expectedOffsetNoWriteRun", 0);
884 
885  descriptions.addDefault(desc);
886  }
887 
888 } // namespace edmtest
void endProcessBlock(edm::ProcessBlock const &processBlock) override
unsigned int nPreStreamEndLumi() const
unsigned int nPostBeginJob() const
unsigned int nPreModuleGlobalBeginLumi() const
std::vector< unsigned int > nStreamBeginRun_
unsigned int nPreStreamBeginLumi() const
unsigned int nPreStreamBeginRun() const
unsigned int nPostBeginProcessBlock() const
unsigned int nPreModuleEndJob() const
constexpr unsigned int kTestStreams
unsigned int nPreStreamBeginLumi() const
unsigned int nPreModuleStreamBeginLumi() const
ExceptionThrowingProducer & operator=(const ExceptionThrowingProducer &)=delete
std::vector< unsigned int > nStreamBeginLumi_
unsigned int nPreModuleGlobalBeginLumi() const
unsigned int nPostGlobalEndLumi() const
unsigned int nPostStreamBeginLumi() const
std::shared_ptr< Cache > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
std::unique_ptr< Cache > beginStream(edm::StreamID) const override
unsigned int nPostModuleStreamEndLumi() const
unsigned int nPreGlobalEndRun() const
unsigned int nPostGlobalBeginRun() const
unsigned int nPreModuleStreamBeginRun() const
unsigned int nPreGlobalBeginLumi() const
constexpr unsigned int kNumberOfModulesWithJobTransitions
unsigned int nPostGlobalBeginLumi() const
unsigned int nPostStreamBeginRun() const
unsigned int nPreBeginProcessBlock() const
unsigned int nPreModuleBeginJob() const
unsigned int nPreModuleGlobalEndRun() const
static void fillDescriptions(edm::ConfigurationDescriptions &)
std::atomic< unsigned int > nGlobalBeginLumi_
unsigned int nPostGlobalEndLumi() const
unsigned int nPostModuleGlobalEndRun() const
unsigned int nPreGlobalEndLumi() const
unsigned int nPostGlobalWriteLumi() const
unsigned int nPreModuleBeginProcessBlock() const
unsigned int nPostModuleStreamBeginLumi() const
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const override
unsigned int nPostModuleEndProcessBlock() const
unsigned int nPreModuleBeginStream() const
unsigned int nPostModuleEndJob() const
EventNumber_t const invalidEventNumber
unsigned int nPreGlobalBeginLumi() const
unsigned int nPreEndJob() const
unsigned int nPreEndStream() const
unsigned int nPreModuleStreamBeginLumi() const
void addDefault(ParameterSetDescription const &psetDescription)
unsigned int nPostModuleGlobalBeginLumi() const
unsigned int nPreGlobalWriteRun() const
unsigned int nPostStreamBeginLumi() const
unsigned int nPreStreamBeginRun() const
unsigned int nPostGlobalBeginRun() const
constexpr unsigned int kNumberOfModulesWithStreamTransitions
unsigned int nPostGlobalEndRun() const
constexpr unsigned int kStreamToThrowOn
unsigned int nPreModuleStreamBeginRun() const
unsigned int nPostStreamEndRun() const
unsigned int nPreBeginStream() const
unsigned int nPreGlobalEndRun() const
unsigned int nPreGlobalBeginRun() const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void streamBeginLuminosityBlock(edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
unsigned int nPreStreamEndLumi() const
unsigned int nPreModuleEndStream() const
unsigned int nPreModuleGlobalBeginRun() const
void endStream(edm::StreamID) const override
void streamBeginRun(edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
unsigned int nPreGlobalWriteLumi() const
unsigned int nPostModuleGlobalBeginLumi() const
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
unsigned int nPreStreamEndRun() const
unsigned int nPreGlobalWriteRun() const
unsigned int nPostModuleBeginProcessBlock() const
unsigned int nPreModuleGlobalEndLumi() const
constexpr unsigned int kNumberOfTestModules
unsigned int nPostModuleBeginJob() const
unsigned int nPreModuleGlobalBeginRun() const
unsigned int nPostModuleGlobalBeginRun() const
std::shared_ptr< Cache > globalBeginRun(edm::Run const &, edm::EventSetup const &) const override
unsigned int nPostModuleGlobalEndLumi() const
unsigned int nPostModuleEndStream() const
unsigned int nPostModuleStreamEndLumi() const
unsigned int nPostGlobalWriteLumi() const
unsigned int nPreGlobalWriteLumi() const
unsigned int nPostEndStream() const
unsigned int nPostStreamEndLumi() const
unsigned int nPreBeginJob() const
unsigned int nPostModuleGlobalBeginRun() const
unsigned int nPostGlobalBeginLumi() const
ExceptionThrowingProducer(edm::ParameterSet const &)
void streamEndRun(edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
unsigned int nPostModuleStreamBeginRun() const
unsigned int nPostModuleGlobalEndLumi() const
~ExceptionThrowingProducer() noexcept(false) override
unsigned int nPostModuleGlobalEndRun() const
constexpr unsigned int kUnset
unsigned int nPreStreamEndRun() const
unsigned int nPreModuleStreamEndLumi() const
void streamEndLuminosityBlock(edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
unsigned int nPreModuleStreamEndRun() const
HLT enums.
unsigned int nPostModuleStreamEndRun() const
unsigned int nPreModuleEndProcessBlock() const
unsigned int nPreModuleGlobalEndLumi() const
void globalEndRun(edm::Run const &, edm::EventSetup const &) const override
unsigned int nPostEndProcessBlock() const
unsigned int nPostBeginStream() const
unsigned int nPostStreamEndRun() const
unsigned int nPostGlobalWriteRun() const
unsigned int nPreModuleStreamEndLumi() const
unsigned int nPostGlobalWriteRun() const
unsigned int nPostModuleStreamEndRun() const
Log< level::System, true > LogAbsolute
unsigned int nPreModuleGlobalEndRun() const
unsigned int nPostGlobalEndRun() const
unsigned int nPostEndJob() const
unsigned int value() const
Definition: StreamID.h:43
std::atomic< unsigned int > nGlobalBeginRun_
unsigned int nPreModuleStreamEndRun() const
void beginProcessBlock(edm::ProcessBlock const &processBlock) override
constexpr unsigned int kNumberOfModulesWithProcessBlockTransitions
unsigned int nPostModuleStreamBeginRun() const
unsigned int nPostStreamBeginRun() const
unsigned int nPostModuleBeginStream() const
unsigned int nPostModuleStreamBeginLumi() const
Definition: event.py:1
Definition: Run.h:45
unsigned int nPreGlobalEndLumi() const
unsigned int nPostStreamEndLumi() const
unsigned int nPreGlobalBeginRun() const
unsigned int nPreEndProcessBlock() const