@@ -42,8 +42,7 @@ using namespace edm::service::monitor_file_utilities;
42
42
namespace {
43
43
44
44
using duration_t = std::chrono::microseconds;
45
- using clock_t = std::chrono::steady_clock;
46
- auto now = clock_t ::now;
45
+ using steady_clock = std::chrono::steady_clock;
47
46
48
47
// ===============================================================
49
48
class StallStatistics {
@@ -214,7 +213,7 @@ namespace edm {
214
213
ThreadSafeOutputFileStream file_;
215
214
bool const validFile_; // Separate data member from file to improve efficiency.
216
215
duration_t const stallThreshold_;
217
- decltype (now()) beginTime_{};
216
+ decltype (steady_clock:: now()) beginTime_{};
218
217
219
218
// There can be multiple modules per stream. Therefore, we need
220
219
// the combination of StreamID and ModuleID to correctly track
@@ -306,13 +305,13 @@ StallMonitor::StallMonitor(ParameterSet const& iPS, ActivityRegistry& iRegistry)
306
305
});
307
306
308
307
iRegistry.preESModuleSignal_ .connect ([this ](auto const &, auto const & context) {
309
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
308
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
310
309
auto msg = assembleMessage<step::preESModule>(
311
310
numStreams_, module_id (context), std::underlying_type_t <Phase>(Phase::eventSetupCall), t);
312
311
file_.write (std::move (msg));
313
312
});
314
313
iRegistry.postESModuleSignal_ .connect ([this ](auto const &, auto const & context) {
315
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
314
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
316
315
auto msg = assembleMessage<step::postESModule>(
317
316
numStreams_, module_id (context), std::underlying_type_t <Phase>(Phase::eventSetupCall), t);
318
317
file_.write (std::move (msg));
@@ -325,7 +324,7 @@ StallMonitor::StallMonitor(ParameterSet const& iPS, ActivityRegistry& iRegistry)
325
324
if (recordFrameworkTransitions) {
326
325
{
327
326
auto preGlobal = [this ](GlobalContext const & gc) {
328
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
327
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
329
328
auto msg = assembleMessage<step::preFrameworkTransition>(
330
329
numStreams_, gc.luminosityBlockID ().run (), gc.luminosityBlockID ().luminosityBlock (), toTransition (gc), t);
331
330
file_.write (std::move (msg));
@@ -337,7 +336,7 @@ StallMonitor::StallMonitor(ParameterSet const& iPS, ActivityRegistry& iRegistry)
337
336
}
338
337
{
339
338
auto postGlobal = [this ](GlobalContext const & gc) {
340
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
339
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
341
340
auto msg = assembleMessage<step::postFrameworkTransition>(
342
341
numStreams_, gc.luminosityBlockID ().run (), gc.luminosityBlockID ().luminosityBlock (), toTransition (gc), t);
343
342
file_.write (std::move (msg));
@@ -349,7 +348,7 @@ StallMonitor::StallMonitor(ParameterSet const& iPS, ActivityRegistry& iRegistry)
349
348
}
350
349
{
351
350
auto preStream = [this ](StreamContext const & sc) {
352
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
351
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
353
352
auto msg = assembleMessage<step::preFrameworkTransition>(
354
353
stream_id (sc), sc.eventID ().run (), sc.eventID ().luminosityBlock (), toTransition (sc), t);
355
354
file_.write (std::move (msg));
@@ -361,7 +360,7 @@ StallMonitor::StallMonitor(ParameterSet const& iPS, ActivityRegistry& iRegistry)
361
360
}
362
361
{
363
362
auto postStream = [this ](StreamContext const & sc) {
364
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
363
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
365
364
auto msg = assembleMessage<step::postFrameworkTransition>(
366
365
stream_id (sc), sc.eventID ().run (), sc.eventID ().luminosityBlock (), toTransition (sc), t);
367
366
file_.write (std::move (msg));
@@ -499,23 +498,23 @@ void StallMonitor::postBeginJob() {
499
498
decltype (moduleLabels_)().swap (moduleLabels_);
500
499
decltype (esModuleLabels_)().swap (esModuleLabels_);
501
500
502
- beginTime_ = now ();
501
+ beginTime_ = steady_clock:: now ();
503
502
}
504
503
505
504
void StallMonitor::preSourceEvent (StreamID const sid) {
506
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
505
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
507
506
auto msg = assembleMessage<step::preSourceEvent>(sid.value (), t);
508
507
file_.write (std::move (msg));
509
508
}
510
509
511
510
void StallMonitor::postSourceEvent (StreamID const sid) {
512
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
511
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
513
512
auto msg = assembleMessage<step::postSourceEvent>(sid.value (), t);
514
513
file_.write (std::move (msg));
515
514
}
516
515
517
516
void StallMonitor::preEvent (StreamContext const & sc) {
518
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
517
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
519
518
auto const & eid = sc.eventID ();
520
519
auto msg = assembleMessage<step::preEvent>(stream_id (sc), eid.run (), eid.luminosityBlock (), eid.event (), t);
521
520
file_.write (std::move (msg));
@@ -524,7 +523,7 @@ void StallMonitor::preEvent(StreamContext const& sc) {
524
523
void StallMonitor::postModuleEventPrefetching (StreamContext const & sc, ModuleCallingContext const & mcc) {
525
524
auto const sid = stream_id (sc);
526
525
auto const mid = module_id (mcc);
527
- auto start = stallStart_[std::make_pair (sid, mid)] = std::make_pair (now (), false );
526
+ auto start = stallStart_[std::make_pair (sid, mid)] = std::make_pair (steady_clock:: now (), false );
528
527
529
528
if (validFile_) {
530
529
auto const t = duration_cast<duration_t >(start.first - beginTime_).count ();
@@ -534,7 +533,7 @@ void StallMonitor::postModuleEventPrefetching(StreamContext const& sc, ModuleCal
534
533
}
535
534
536
535
void StallMonitor::preModuleEventAcquire (StreamContext const & sc, ModuleCallingContext const & mcc) {
537
- auto const preModEventAcquire = now ();
536
+ auto const preModEventAcquire = steady_clock:: now ();
538
537
auto const sid = stream_id (sc);
539
538
auto const mid = module_id (mcc);
540
539
auto & start = stallStart_[std::make_pair (sid, mid)];
@@ -555,13 +554,13 @@ void StallMonitor::preModuleEventAcquire(StreamContext const& sc, ModuleCallingC
555
554
}
556
555
557
556
void StallMonitor::postModuleEventAcquire (StreamContext const & sc, ModuleCallingContext const & mcc) {
558
- auto const postModEventAcquire = duration_cast<duration_t >(now () - beginTime_).count ();
557
+ auto const postModEventAcquire = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
559
558
auto msg = assembleMessage<step::postModuleEventAcquire>(stream_id (sc), module_id (mcc), postModEventAcquire);
560
559
file_.write (std::move (msg));
561
560
}
562
561
563
562
void StallMonitor::preModuleEvent (StreamContext const & sc, ModuleCallingContext const & mcc) {
564
- auto const preModEvent = now ();
563
+ auto const preModEvent = steady_clock:: now ();
565
564
auto const sid = stream_id (sc);
566
565
auto const mid = module_id (mcc);
567
566
auto const & start = stallStart_[std::make_pair (sid, mid)];
@@ -582,7 +581,7 @@ void StallMonitor::preModuleEvent(StreamContext const& sc, ModuleCallingContext
582
581
}
583
582
584
583
void StallMonitor::preModuleStreamTransition (StreamContext const & sc, ModuleCallingContext const & mcc) {
585
- auto const tNow = now ();
584
+ auto const tNow = steady_clock:: now ();
586
585
auto const sid = stream_id (sc);
587
586
auto const mid = module_id (mcc);
588
587
auto t = duration_cast<duration_t >(tNow - beginTime_).count ();
@@ -591,44 +590,44 @@ void StallMonitor::preModuleStreamTransition(StreamContext const& sc, ModuleCall
591
590
}
592
591
593
592
void StallMonitor::postModuleStreamTransition (StreamContext const & sc, ModuleCallingContext const & mcc) {
594
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
593
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
595
594
auto msg = assembleMessage<step::postModuleEvent>(stream_id (sc), module_id (mcc), toTransition (sc), t);
596
595
file_.write (std::move (msg));
597
596
}
598
597
599
598
void StallMonitor::preModuleGlobalTransition (GlobalContext const & gc, ModuleCallingContext const & mcc) {
600
- auto t = duration_cast<duration_t >(now () - beginTime_).count ();
599
+ auto t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
601
600
auto msg = assembleMessage<step::preModuleEvent>(numStreams_, module_id (mcc), toTransition (gc), t);
602
601
file_.write (std::move (msg));
603
602
}
604
603
605
604
void StallMonitor::postModuleGlobalTransition (GlobalContext const & gc, ModuleCallingContext const & mcc) {
606
- auto const postModTime = duration_cast<duration_t >(now () - beginTime_).count ();
605
+ auto const postModTime = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
607
606
auto msg = assembleMessage<step::postModuleEvent>(numStreams_, module_id (mcc), toTransition (gc), postModTime);
608
607
file_.write (std::move (msg));
609
608
}
610
609
611
610
void StallMonitor::preEventReadFromSource (StreamContext const & sc, ModuleCallingContext const & mcc) {
612
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
611
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
613
612
auto msg = assembleMessage<step::preEventReadFromSource>(stream_id (sc), module_id (mcc), t);
614
613
file_.write (std::move (msg));
615
614
}
616
615
617
616
void StallMonitor::postEventReadFromSource (StreamContext const & sc, ModuleCallingContext const & mcc) {
618
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
617
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
619
618
auto msg = assembleMessage<step::postEventReadFromSource>(stream_id (sc), module_id (mcc), t);
620
619
file_.write (std::move (msg));
621
620
}
622
621
623
622
void StallMonitor::postModuleEvent (StreamContext const & sc, ModuleCallingContext const & mcc) {
624
- auto const postModEvent = duration_cast<duration_t >(now () - beginTime_).count ();
623
+ auto const postModEvent = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
625
624
auto msg = assembleMessage<step::postModuleEvent>(
626
625
stream_id (sc), module_id (mcc), static_cast <std::underlying_type_t <Phase>>(Phase::Event), postModEvent);
627
626
file_.write (std::move (msg));
628
627
}
629
628
630
629
void StallMonitor::postEvent (StreamContext const & sc) {
631
- auto const t = duration_cast<duration_t >(now () - beginTime_).count ();
630
+ auto const t = duration_cast<duration_t >(steady_clock:: now () - beginTime_).count ();
632
631
auto const & eid = sc.eventID ();
633
632
auto msg = assembleMessage<step::postEvent>(stream_id (sc), eid.run (), eid.luminosityBlock (), eid.event (), t);
634
633
file_.write (std::move (msg));
0 commit comments