9 from AthenaCommon.Logging
import log
as msg
11 from AthenaCommon.ConcurrencyFlags
import jobproperties
as jp
12 nThreads = jp.ConcurrencyFlags.NumThreads()
14 msg.fatal(
'numThreads must be >0. Did you set the --threads=N option?')
15 sys.exit(AthenaCommon.ExitCodes.CONFIGURATION_ERROR)
18 import AthenaCommon.AtlasUnixGeneratorJob
24 from AthenaServices.AthenaServicesConf
import AthenaHiveEventLoopMgr
27 from StoreGate.StoreGateConf
import SG__HiveMgrSvc
30 from GaudiHive.GaudiHiveConf
import AlgResourcePool
33 from AthenaCommon.AlgScheduler
import AlgScheduler
34 AlgScheduler.OutputLevel( INFO )
35 AlgScheduler.ShowControlFlow(
True )
36 AlgScheduler.ShowDataDependencies(
True )
39 from GaudiHive.GaudiHiveConf
import ThreadPoolSvc
40 svcMgr += ThreadPoolSvc(
"ThreadPoolSvc")
41 svcMgr.ThreadPoolSvc.ThreadInitTools = [
"ThreadInitTool"]
59 from AthenaCommon.AlgSequence
import AlgSequence
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)
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" ]
81 nProc = jp.ConcurrencyFlags.NumProcs()
87 import AthenaCommon.AtlasUnixGeneratorJob
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)
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)
101 chunkSize = int (theApp.EvtMax / nProc)
103 from AthenaMP.AthenaMPFlags
import jobproperties
as jps
104 jps.AthenaMPFlags.PreCountedEvents=theApp.EvtMax
105 jps.AthenaMPFlags.ChunkSize= chunkSize
107 msg.info(
'AthenaMP workers will process %s events each',chunkSize)
111 print (
"==========================================================================================\n")
118 algCardinality = jp.ConcurrencyFlags.NumThreads()
120 if (algCardinality != 1):
121 for alg
in topSequence:
123 alg.Cardinality = algCardinality