ATLAS Offline Software
RAthExHiveOpts.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 
6 #
7 
9 from AthenaCommon.Logging import log as msg
10 
11 from AthenaCommon.ConcurrencyFlags import jobproperties as jp
12 nThreads = jp.ConcurrencyFlags.NumThreads()
13 if (nThreads < 1) :
14  msg.fatal('numThreads must be >0. Did you set the --threads=N option?')
15  sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
16 
17 #
18 
20 
21 from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr
22 # svcMgr.AthenaHiveEventLoopMgr.OutputLevel = INFO
23 
24 from StoreGate.StoreGateConf import SG__HiveMgrSvc
25 # svcMgr.EventDataSvc.OutputLevel = INFO
26 
27 from GaudiHive.GaudiHiveConf import AlgResourcePool
28 # svcMgr += AlgResourcePool( OutputLevel = INFO );
29 
30 from GaudiHive.GaudiHiveConf import ForwardSchedulerSvc
31 svcMgr.ForwardSchedulerSvc.OutputLevel = INFO
32 svcMgr.ForwardSchedulerSvc.CheckDependencies = True
33 
34 #
35 
39 
40 # numStores = 1
41 # numAlgsInFlight = 1
42 
43 # svcMgr.EventDataSvc.NSlots = numStores
44 # svcMgr.ForwardSchedulerSvc.MaxEventsInFlight = numStores
45 # svcMgr.ForwardSchedulerSvc.MaxAlgosInFlight = numAlgsInFlight
46 
47 # ThreadPoolService thread local initialization
48 # from GaudiHive.GaudiHiveConf import ThreadPoolSvc
49 # svcMgr += ThreadPoolSvc("ThreadPoolSvc")
50 # svcMgr.ThreadPoolSvc.ThreadInitTools = ["ThreadInitTool"]
51 
52 #---------------------------------------------------------------------------------#
53 
54 #
55 
60 
61 #---------------------------------------------------------------------------------#
62 
63 
64 #
65 
67 
68 from AthenaCommon.AlgSequence import AlgSequence
69 topSequence = AlgSequence()
70 
71 from SGComps.SGCompsConf import SGInputLoader
72 topSequence+=SGInputLoader(OutputLevel=INFO, ShowEventDump=False)
73 topSequence.SGInputLoader.Load = { ('EventInfo','McEventInfo') }
74 
75 from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
76 topSequence += xAODMaker__EventInfoCnvAlg()
77 
78 from AthExHive.AthExHiveConf import *
79 topSequence+=HiveAlgR(OutputLevel=DEBUG)
80 topSequence+=HiveAlgA(OutputLevel=DEBUG,Time=20)
81 topSequence+=HiveAlgB(OutputLevel=DEBUG,Time=10)
82 topSequence+=HiveAlgC(OutputLevel=DEBUG,Time=190)
83 
84 #--------------------------------------------------------------
85 # Event related parameters
86 #--------------------------------------------------------------
87 
88 theApp.EvtMax = 20
89 
90 nProc = jp.ConcurrencyFlags.NumProcs()
91 if (nProc > 0) :
92 
93  #
94 
96  import AthenaCommon.AtlasUnixGeneratorJob
97 
98  #
99 
101 
102  from AthenaCommon.Logging import log as msg
103  if (theApp.EvtMax == -1) :
104  msg.fatal('EvtMax must be >0 for hybrid configuration')
105  sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
106 
107  if ( theApp.EvtMax % nProc != 0 ) :
108  msg.warning('EvtMax[%s] is not divisible by nProcs[%s]: MP Workers will not process all requested events',theApp.EvtMax,nProc)
109 
110  chunkSize = int (theApp.EvtMax / nProc)
111 
112  from AthenaMP.AthenaMPFlags import jobproperties as jps
113  jps.AthenaMPFlags.PreCountedEvents=theApp.EvtMax
114  jps.AthenaMPFlags.ChunkSize= chunkSize
115 
116  msg.info('AthenaMP workers will process %s events each',chunkSize)
117 
118 
119 
120 print "==========================================================================================\n"
121 
122 #
123 
125 
126 # set algCardinality = 1 to disable cloning for all Algs
127 algCardinality = jp.ConcurrencyFlags.NumThreads()
128 
129 if (algCardinality != 1):
130  for alg in topSequence:
131  name = alg.name()
132  alg.Cardinality = algCardinality
133 
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
HiveAlgR
Definition: HiveAlgR.h:23
HiveAlgB
Definition: HiveAlgB.h:23
AthExHiveConf
HiveAlgA
Definition: HiveAlgA.h:23
HiveAlgC
Definition: HiveAlgC.h:21