Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add EventCounter algorithm #252

Merged
merged 4 commits into from
Oct 30, 2024
Merged

add EventCounter algorithm #252

merged 4 commits into from
Oct 30, 2024

Conversation

m-fila
Copy link
Contributor

@m-fila m-fila commented Oct 28, 2024

BEGINRELEASENOTES

  • Added thread-safeEventCounter algorithm

ENDRELEASENOTES

Adding thread-safe version of EventCounter algorithm. The algorithm will print current event number (as seen by the scheduler) depending on the frequency. Counting the total number of events passed through the algorithm is done with Gaudi::Accumulators::Counter - add MessageSvcSink in order to get a printout about all the Gaudi counters, for instance:

26: ApplicationMgr       INFO Application Manager Initialized successfully
26: ApplicationMgr       INFO Application Manager Started successfully
26: EventCounter         INFO Processing event 0
26: EventCounter         INFO Processing event 2
26: EventCounter         INFO Number of counters : 1
26:  |    Counter                                      |     #     |    sum     | mean/eff^* | rms/err^*  |     min     |     max     |
26:  | "count"                                         |         4 |
26: SilentEventCounter   INFO Number of counters : 1
26:  |    Counter                                      |     #     |    sum     | mean/eff^* | rms/err^*  |     min     |     max     |
26:  | "count"                                         |         4 |
26: ApplicationMgr       INFO Application Manager Stopped successfully
26: SilentEventCounter   INFO Processed 4 events
26: EventCounter         INFO Processed 4 events
26: ApplicationMgr       INFO Application Manager Finalized successfully
26: ApplicationMgr       INFO Application Manager Terminated successfully

Closes #219

@m-fila m-fila force-pushed the event_counter branch 2 times, most recently from 85452c7 to e178e1d Compare October 28, 2024 15:55
Copy link
Member

@jmcarcell jmcarcell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few more comments: the original used to have some messages at initialize() and finalize() and also the format was slightly different using EventCounter:: in the name. I think this is a matter of opinion. Maybe @BrieucF and @giovannimarchiori can comment if you like how it is right now (note the counter tables are opt-in, which I think some people will find confusing, why is there a sum, rms, etc).

@giovannimarchiori
Copy link
Contributor

Thanks a lot for this PR!
Would it be possible to add at finalize a simple printout of the form

EventCounter INFO Processed XX events

before the (optional) printout of the tables?
How can one configure the EventCounter to avoid showing the tables BTW?

Thanks again!

@m-fila
Copy link
Contributor Author

m-fila commented Oct 28, 2024

Thanks for the comments. Added finalize - the message seems to be printed after the tables (updated example in the description)

How can one configure the EventCounter to avoid showing the tables BTW?

To avoid printing tables for counters don't add MessageSvcSink to ExtSvc (or change the MessageSvcSink property to skip printing tables for all the counters)

@giovannimarchiori
Copy link
Contributor

Thanks @m-fila ,
that looks good to me!
Giovanni

@andresailer andresailer requested a review from jmcarcell October 30, 2024 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alternatives for EventCounter removed withGaudiAlg
3 participants