ATLAS Offline Software
AthExHiveOpts.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 # setup the McEventSelector
18 import AthenaCommon.AtlasUnixGeneratorJob
19 
20 #
21 
23 
24 from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr
25 # svcMgr.AthenaHiveEventLoopMgr.OutputLevel = INFO
26 
27 from StoreGate.StoreGateConf import SG__HiveMgrSvc
28 # svcMgr.EventDataSvc.OutputLevel = INFO
29 
30 from GaudiHive.GaudiHiveConf import AlgResourcePool
31 # svcMgr += AlgResourcePool( OutputLevel = INFO );
32 
33 from AthenaCommon.AlgScheduler import AlgScheduler
34 AlgScheduler.OutputLevel( INFO )
35 AlgScheduler.ShowControlFlow( True )
36 AlgScheduler.ShowDataDependencies( True )
37 
38 # ThreadPoolService thread local initialization
39 from GaudiHive.GaudiHiveConf import ThreadPoolSvc
40 svcMgr += ThreadPoolSvc("ThreadPoolSvc")
41 svcMgr.ThreadPoolSvc.ThreadInitTools = ["ThreadInitTool"]
42 
43 #---------------------------------------------------------------------------------#
44 
45 #
46 
51 
52 #---------------------------------------------------------------------------------#
53 
54 
55 #
56 
58 
59 from AthenaCommon.AlgSequence import AlgSequence
60 topSequence = AlgSequence()
61 
62 from AthExHive.AthExHiveConf import *
63 topSequence+=HiveAlgA(OutputLevel=DEBUG,Time=20)
64 topSequence+=HiveAlgB(OutputLevel=DEBUG,Time=10)
65 topSequence+=HiveAlgC(OutputLevel=DEBUG,Time=190, Key_W1="C1")
66 topSequence+=HiveAlgD(OutputLevel=DEBUG,Time=10)
67 topSequence+=HiveAlgE(OutputLevel=DEBUG,Time=30, Key_R1="C1")
68 topSequence+=HiveAlgG(OutputLevel=DEBUG,Time=10)
69 topSequence+=HiveAlgF(OutputLevel=DEBUG,Time=30)
70 
71 topSequence+=HiveAlgV(OutputLevel=DEBUG,Time=30)
72 topSequence.HiveAlgV.Key_RV = [ "a1", "a2", "d1", "e1", "C1" ]
73 topSequence.HiveAlgV.Key_WV = [ "V1", "V2", "V3" ]
74 
75 #--------------------------------------------------------------
76 # Event related parameters
77 #--------------------------------------------------------------
78 
79 theApp.EvtMax = 20
80 
81 nProc = jp.ConcurrencyFlags.NumProcs()
82 if (nProc > 0) :
83 
84  #
85 
87  import AthenaCommon.AtlasUnixGeneratorJob
88 
89  #
90 
92 
93  from AthenaCommon.Logging import log as msg
94  if (theApp.EvtMax == -1) :
95  msg.fatal('EvtMax must be >0 for hybrid configuration')
96  sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
97 
98  if ( theApp.EvtMax % nProc != 0 ) :
99  msg.warning('EvtMax[%s] is not divisible by nProcs[%s]: MP Workers will not process all requested events',theApp.EvtMax,nProc)
100 
101  chunkSize = int (theApp.EvtMax / nProc)
102 
103  from AthenaMP.AthenaMPFlags import jobproperties as jps
104  jps.AthenaMPFlags.PreCountedEvents=theApp.EvtMax
105  jps.AthenaMPFlags.ChunkSize= chunkSize
106 
107  msg.info('AthenaMP workers will process %s events each',chunkSize)
108 
109 
110 
111 print ("==========================================================================================\n")
112 
113 #
114 
116 
117 # set algCardinality = 1 to disable cloning for all Algs
118 algCardinality = jp.ConcurrencyFlags.NumThreads()
119 
120 if (algCardinality != 1):
121  for alg in topSequence:
122  name = alg.name()
123  alg.Cardinality = algCardinality
124 
HiveAlgF
Definition: HiveAlgF.h:20
python.AlgSequence.AlgSequence
AlgSequence
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/AlgSequence.py:7
HiveAlgE
Definition: HiveAlgE.h:21
HiveAlgB
Definition: HiveAlgB.h:23
AthExHiveConf
HiveAlgD
Definition: HiveAlgD.h:21
HiveAlgA
Definition: HiveAlgA.h:23
HiveAlgV
Definition: HiveAlgV.h:21
HiveAlgC
Definition: HiveAlgC.h:21
HiveAlgG
Definition: HiveAlgG.h:21