Implement asynchronous scheduler
this adapts the scheduler implementation to the IQueueingEventProcessor interface, which can asynchronously schedule events, a requirement stated by @frankm to be able to run it online.
For details about the interface, see gaudi/Gaudi!966 (merged).
The performance doesn't suffer, if anything it gets better (@clemenci made the tests there)
TLDR: much benefit, no cost.
Merge request reports
Activity
@clemenci Using futures and promises makes the main thread ~25% slower.. In a job where the main thread is the throttling one, i go from 250k evts/s to 200k evts/s.
Maybe we want to support two versions?
I tested that this slowdown is not caused by any other changes by just appending two dummy lines into the current version of the scheduler at the start ofexecuteEvent
std::promise<std::tuple<StatusCode, EventContext>> promise; auto future = promise.get_future();
Edited by Niklas Stefan NolteI'm not surprised there's overhead, but I'm surprised it's that big.
I'd like to have a look next week. (may be batching might help?)
For sure I do not want to support 2 versions of anything. My question is more if we want to keep a communication channel open between the main thread and the tasks, and, if yes, which is the fastest option.
- Resolved by Niklas Stefan Nolte
During the hackathon we discussed the possibility of using queues instead of promise+future pairs.
I'd like to prototype a change to the interface in that direction (probably not backward compatible).
mentioned in merge request gaudi/Gaudi!966 (merged)
I updated the changes to use
IQueuingEventProcessor
instead ofIAsyncEventProcessor
(see gaudi/Gaudi!966 (merged)).The unavoidable overhead becomes negligible with the queue approach, see LBCOMP-21.
added 326 commits
-
3db2f8c0...c7364443 - 325 commits from branch
master
- 35211eb2 - Merge branch 'master' into NN_asyncscheduler
-
3db2f8c0...c7364443 - 325 commits from branch
added 1 commit
- 9ce492dd - Merge branch 'master' into NN_asyncscheduler
- Resolved by Niklas Stefan Nolte
I also merged master to fix the conflicts. @nnolte, please check that the changes make sense to you and I didn't screw up anything.
- Resolved by Niklas Stefan Nolte
added 1 commit
- 44ddcf44 - Apply suggestion to Hlt/HLTScheduler/src/HLTControlFlowMgr.cpp
- Resolved by Niklas Stefan Nolte
shall we merge this?