Event Based Seeding & Multi-Threading
Description
Our current (poor mans) approach to multi-thread (splitting up the different detector modules) does not make good use of the available CPU time. Running a typical simulation with eight detectors on a four-core machine has the following CPU usage patterns:
Furthermore, the current approach depends on the number of simulated detectors,m and e.g. single detectors do not profit at all from the capabilities.
Proposal
In the future we could move to processing events in parallel instead of detector module instantiations. This would allow to use the available resources better and also scales independently of the number of detectors simulated.
The tricky part here is that we still want to rely on a fixed order of events, e.g. for modules which simulate buffers in front-end electronics. This order would be defined by the seeds given out to initialize random number generators for every event, i.e. event based seeding. The one module requiring all events in order would then have to join even threads.
This feature still has to be discussed and planned in detail and will not be implemented in the foreseeable future, but is left here for documentation.