StressHive.py
Go to the documentation of this file.
1 #!/usr/bin/env gaudirun.py
2 
3 from Gaudi.Configuration import *
4 # ============================================================================
5 from Configurables import GaudiExamplesCommonConf, CPUCruncher,HiveEventLoopMgr_v2
6 #GaudiExamplesCommonConf()
7 # ============================================================================
8 
9 number_of_algos = 20
10 number_of_threads = 10
11 mean_time = 1
12 
13 # ============================================================================
14 # Create number_of_algos independent algos and run them
15 import random
16 auto_crunchers=[]
17 for i in xrange(number_of_algos):
18  auto_cruncher = CPUCruncher("cruncher_%s"%i,
19  avgRuntime=random.uniform(mean_time+.1,mean_time+.5),
20  DataInputs=[],
21  DataOutputs=["coll_%s"%i])
22  auto_crunchers.append(auto_cruncher)
23 
24 # ============================================================================
25 
26 # Setup the Event Loop Manager
27 evtloop = HiveEventLoopMgr_v2()
28 evtloop.MaxEventsParallel = number_of_threads
29 evtloop.NumThreads = number_of_threads
30 evtloop.CloneAlgorithms = True
31 evtloop.DumpQueues = False
32 
33 # And the Application Manager
34 
36 app.TopAlg = auto_crunchers
37 app.EvtSel = "NONE" # do not use any event input
38 app.EvtMax = 10
39 app.EventLoop = evtloop;
40 app.MessageSvcType = "TBBMessageSvc";
41 
42 
43 
44 # ============================================================================
45 # The END
46 # ============================================================================
The Application Manager class.