-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Problems with Modifiers and multiple processes #37740
Comments
A new Issue was created by @silviodonato Silvio Donato. @Dr15Jones, @perrotta, @dpiparo, @makortel, @smuzaffar, @qliphy can you please review it and eventually sign/assign? Thanks. cms-bot commands are listed here |
cc @cms-sw/hlt-l2 @cms-sw/l1-l2 as it is related to https://github.com/cms-sw/cmssw/blob/master/HLTrigger/Configuration/python/CustomConfigs.py#L123-L159 |
assign core |
New categories assigned: core @Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks |
I think there are two problems.
|
It looks like the behaviour of While the global nature of the modifiers is causing the unexpected behaviour :-( |
This is an expected behavior with the current implementation of the Modifier. The enabled/disabled status of the Modifier is stored in the Modifier object itself (in this case (mostly for future record) The underlying issue is faced also if trying to implement MiniAOD in the same (posix) process as RECO as a SubProcess, when MiniAOD and RECO would use different Modifiers, that was discussed in https://mattermost.web.cern.ch/cms-o-and-c/pl/6u8d7kdgmjfciguki4gchmicsy. |
Why does cmssw/HLTrigger/Configuration/python/CustomConfigs.py Lines 123 to 127 in 12b3153
need to create a second Process object? Is the argument process not using Run3 modifier?
|
Not necessarily... e.g. not when running over Run-2 data to validate the GPU-vs-CPU code behaviour 😞 |
Is using |
Yes, we want to use real collisions data (hence from Run2) but rerun using the Run3 L1T re-emulation. |
Yes, because we want to emulate the latest L1 menu (ie. the Run3 menu) using Run2 data. Anyway, we can find a workaround for this specific case. The issue wanted to be more generic. |
I'm afraid we can't do much without significantly constraining or changing the configuration system, which would have lots of knock-on effects.
The behavior looks correct. Although given global nature of the selection state of the Modifers, I acknowledge its result can be confusing to interpret. |
Hi Matti,
while changing the current behaviour is likely quite cumbersome, maybe it
would be simple enough to detect this kind of unwanted situations where
different Process objects are created with a different sent of modifiers,
and give some meaningful error message ?
.A
|
Yes, a check and an error message should be possible to do. |
For this particular case, would it be feasible to figure out the set of Modifiers actually being used in |
I've tried going through the imports of the L1 configuration, and after a few levels of
Some are L1-specific, but others are tied to the detectors (likely because of the L1 trigger primitives), so I'm not sure they can be used in the top-level |
Here's just an idea, assuming the current approach picks up the correct modifiers... What if we extend def L1REPACK(process, sequence="Full"):
from Configuration.Eras.Era_Run3_cff import Run3
l1repack = cms.Process('L1REPACK', Run3)
l1repack.load('Configuration.StandardSequences.SimL1EmulatorRepack_'+sequence+'_cff')
...
return process with the possibility of setting and resetting modifiers explicitly ? Something like def L1REPACK(process, sequence="Full"):
# make a copy of the modifiers active in the current Process
activeModifiers = list(process.Process__modifiers)
# reset all active modifiers
for mod in process.Process__modifiers:
mod.Modifier__chosen = False
from Configuration.Eras.Era_Run3_cff import Run3
l1repack = cms.Process('L1REPACK', Run3)
l1repack.load('Configuration.StandardSequences.SimL1EmulatorRepack_'+sequence+'_cff')
...
# reset all active modifiers
for mod in l1repack.Process__modifiers:
mod.Modifier__chosen = False
# create a dummy Process to re-enable the modifiers that were originally active
unused = cms.Process('UNUSED', *activeModifiers)
return process It is a hack, but it should provide the intended behaviour, hopefully without breaking anything else. |
I can quickly think of one caveat with the hack, that is related to the load/import order of the python files. If all of the python files loaded during the "hacked state of Modifiers" are loaded only there (i.e. none of them are used before or after that snippet), I'd expect the hack to provide the intended behavior. But if any of the concerned python files is loaded also before the hack, the python objects defined in that file have the state they got with the original active Modifiers. Their state does not change if such file is used later with different set of Modifiers being active. Similarly, if any of the concerned python files is loaded after the hack, the python objects defined in that file have the state they got with the hacked active Modifiers. |
I see - yes, you are right, even if we don't have to worry about concurrency here, the order in which the modules are loaded still matters, since modules are global and Python should not re-load them. |
One option would be to make and use L1T-specific modifiers in the necessary files. For example, assuming the
(names are only for illustration) Modifiers to be used in these files instead of |
This check is added in #37903 |
Thank you. I tried again the original test code in
Closing this issue |
+core |
This issue is fully signed and ready to be closed. |
In the context of the studies of the difference between GPU/CPU, we've found a conflict between the L1 emulator https://github.com/cms-sw/cmssw/blob/master/HLTrigger/Configuration/python/CustomConfigs.py#L123-L159 and the customizeHLTforPatatrack function https://github.com/cms-sw/cmssw/blob/master/HLTrigger/Configuration/python/customizeHLTforPatatrack.py#L148 .
You can very easily reproduce this problem with the following code
The outuput is
I expected that
process.isUsingModifier
would remaincms.bool(True)
.The text was updated successfully, but these errors were encountered: