diff --git a/Control/AthenaCommon/share/Execution.py b/Control/AthenaCommon/share/Execution.py index ad53016995d50f0bc0770b136b3f82a04c677334..03751374fd8fe08ffe58c14d088cf85bd80edfbc 100644 --- a/Control/AthenaCommon/share/Execution.py +++ b/Control/AthenaCommon/share/Execution.py @@ -85,6 +85,17 @@ else: import AthenaMP.PyComps as _amppy svcMgr += _amppy.MpEvtLoopMgr(NWorkers=opts.nprocs) + #if EvtMax and SkipEvents are set, use them + from AthenaCommon.AthenaCommonFlags import jobproperties as jps + if jps.AthenaCommonFlags.EvtMax.statusOn: + theApp.EvtMax = jps.AthenaCommonFlags.EvtMax() + if jps.AthenaCommonFlags.SkipEvents.statusOn: + if hasattr(svcMgr,"EventSelector"): + svcMgr.EventSelector.SkipEvents = jps.AthenaCommonFlags.SkipEvents() + else: + _msg.warning('No EventSelector in svcMgr, not skipping events') + + ## in batch, run as many events as requested, otherwise explain if opts.run_batch: ## enable or not athena-mp diff --git a/Control/AthenaCommon/share/runbatch.py b/Control/AthenaCommon/share/runbatch.py index c5e9fb0135874ef537f7886dc337df573bc8bb77..3ca06f7e0c2bd77ba79c4a54b44e1bc876f28952 100755 --- a/Control/AthenaCommon/share/runbatch.py +++ b/Control/AthenaCommon/share/runbatch.py @@ -8,14 +8,6 @@ # athena.py <myJobOptions.py> runbatch.py try: - #if EvtMax and SkipEvents are set, use them - from AthenaCommon.AthenaCommonFlags import jobproperties as jps - if jps.AthenaCommonFlags.EvtMax.statusOn: - theApp.EvtMax = jps.AthenaCommonFlags.EvtMax() - if jps.AthenaCommonFlags.SkipEvents.statusOn: - if hasattr(svcMgr,"EventSelector"): - svcMgr.EventSelector.SkipEvents = jps.AthenaCommonFlags.SkipEvents() - theApp.run() # runs until theApp.EvtMax events reached from AthenaCommon.Debugging import hookDebugger,DbgStage if DbgStage.value == "fini":