ATLAS Offline Software
CircDataDep.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 
8 from AthenaCommon.Logging import log as msg
9 
10 from AthenaCommon.ConcurrencyFlags import jobproperties as jp
11 nThreads = jp.ConcurrencyFlags.NumThreads()
12 if (nThreads < 1) :
13  msg.fatal('numThreads must be >0. Did you set the --threads=N option?')
14  sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
15 
16 #
17 
19 
20 from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr
21 # svcMgr.AthenaHiveEventLoopMgr.OutputLevel = INFO
22 
23 from StoreGate.StoreGateConf import SG__HiveMgrSvc
24 # svcMgr.EventDataSvc.OutputLevel = INFO
25 
26 from GaudiHive.GaudiHiveConf import AlgResourcePool
27 # svcMgr += AlgResourcePool( OutputLevel = INFO );
28 
29 from AthenaCommon.AlgScheduler import AlgScheduler
30 AlgScheduler.OutputLevel( INFO )
31 AlgScheduler.ShowControlFlow( True )
32 AlgScheduler.ShowDataDependencies( True )
33 
34 #------------------------------------------------------------------------------#
35 #
36 
42 
43 #
44 
46 
47 from AthenaCommon.AlgSequence import AlgSequence
48 topSequence = AlgSequence()
49 
50 from SGComps.SGCompsConf import SGInputLoader
51 topSequence+=SGInputLoader(OutputLevel=DEBUG, ShowEventDump=False)
52 topSequence.SGInputLoader.Load = { ('EventInfo','StoreGateSvc+McEventInfo') }
53 
54 from xAODEventInfoCnv.xAODEventInfoCnvConf import xAODMaker__EventInfoCnvAlg
55 topSequence += xAODMaker__EventInfoCnvAlg()
56 
57 from AthExHive.AthExHiveConf import *
58 
59 topSequence+=AlgT(OutputLevel=DEBUG)
60 
61 AlgT = topSequence.AlgT
62 AlgT.Key_W1 = "t1"
63 #
64 
66 
67 #
68 
69 AlgT.Tool1 = HiveTool( "HiveTool1")
70 AlgT.Tool1.Key_R1 = "t1"
71 AlgT.Tool1.Key_W1 = "t2"
72 
73 #
74 
75 AlgT.Tool2 = HiveTool( "HiveTool2" )
76 AlgT.Tool2.Key_R1 = "t2"
77 AlgT.Tool2.Key_W1 = "t3"
78 
79 #
80 
81 AlgT.Tool3 = HiveTool( "HiveTool3" )
82 AlgT.Tool3.Key_R1 = "t3"
83 AlgT.Tool3.Key_W1 = "t4"
84 
85 
86 #--------------------------------------------------------------
87 # Event related parameters
88 #--------------------------------------------------------------
89 
90 theApp.EvtMax = 2
91 
92 nProc = jp.ConcurrencyFlags.NumProcs()
93 if (nProc > 0) :
94 
95  #
96 
98  import AthenaCommon.AtlasUnixGeneratorJob
99 
100  #
101 
103 
104  from AthenaCommon.Logging import log as msg
105  if (theApp.EvtMax == -1) :
106  msg.fatal('EvtMax must be >0 for hybrid configuration')
107  sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
108 
109  if ( theApp.EvtMax % nProc != 0 ) :
110  msg.warning('EvtMax[%s] is not divisible by nProcs[%s]: MP Workers will not process all requested events',theApp.EvtMax,nProc)
111 
112  chunkSize = int (theApp.EvtMax / nProc)
113 
114  from AthenaMP.AthenaMPFlags import jobproperties as jps
115  jps.AthenaMPFlags.PreCountedEvents=theApp.EvtMax
116  jps.AthenaMPFlags.ChunkSize= chunkSize
117 
118  msg.info('AthenaMP workers will process %s events each',chunkSize)
119 
120 #
121 
123 
124 # set algCardinality = 1 to disable cloning for all Algs
125 algCardinality = jp.ConcurrencyFlags.NumThreads()
126 
127 if (algCardinality != 1):
128  for alg in topSequence:
129  name = alg.name()
130  alg.Cardinality = algCardinality
131 
HiveTool
Definition: HiveTool.h:16
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
AthExHiveConf
AlgT
Definition: AlgT.h:20