Fixed data race in EventHeaderCreator and make it ready for GaudiHive
ENDRELEASENOTES
A static local variable was not thread safe and resulting in a data race when used in parallel environment of GaudiHive (skipping or duplicating event numbers).
I considered two ways to fix it:
use EventContex to get the event number as seen by scheduler. Currently supplying the EventContex as input to k4FWCore::Transformer is not allowed so the algorithm will stay in non-functional form. If there is any filtering done by some algorithms earlier in the sequence then this will be not reflected in the event number as it's determined as the scheduler starts this event. If two events are loaded from input the ordering of event numbers given to them will be the same as ordering of loading.
use atomic member variable as counter. If there is any filtering done by some algorithms earlier in the sequence then this will be reflected in the event numbers as the event number is determined only when this algorithm is executed. If two events are loaded from input the ordering of event numbers given to them doesn't have to be the same as the order of loading - it will be the same as order of execution which might be different
In both cases the event numbers in the output will be not sorted.
The version with with EventContext is used currently but can be changed if needed
BEGINRELEASENOTES
EventHeaderCreator
and make it ready for GaudiHiveENDRELEASENOTES
A
static
local variable was not thread safe and resulting in a data race when used in parallel environment of GaudiHive (skipping or duplicating event numbers).I considered two ways to fix it:
EventContex
to get the event number as seen by scheduler. Currently supplying theEventContex
as input tok4FWCore::Transformer
is not allowed so the algorithm will stay in non-functional form. If there is any filtering done by some algorithms earlier in the sequence then this will be not reflected in the event number as it's determined as the scheduler starts this event. If two events are loaded from input the ordering of event numbers given to them will be the same as ordering of loading.In both cases the event numbers in the output will be not sorted.
The version with with
EventContext
is used currently but can be changed if needed