The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
testMultithreadedAlg.py
Go to the documentation of this file.
1#!/usr/bin/env gaudirun.py
2
12"""
13A test for a single algorithm with internal multithreading
14"""
15
16from Configurables import (
17 AlgResourcePool,
18 AvalancheSchedulerSvc,
19 CPUCruncher,
20 CPUCrunchSvc,
21 HiveSlimEventLoopMgr,
22 HiveWhiteBoard,
23)
24from Gaudi.Configuration import *
25
26evtslots = 1
27evtMax = 1
28cardinality = 1
29threads = 5 # Threading within alg is still limited by total thread pool
30
31whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=evtslots)
32
33slimeventloopmgr = HiveSlimEventLoopMgr(
34 SchedulerName="AvalancheSchedulerSvc", OutputLevel=DEBUG
35)
36
37scheduler = AvalancheSchedulerSvc(ThreadPoolSize=threads, OutputLevel=VERBOSE)
38
39AlgResourcePool(OutputLevel=DEBUG)
40
41CPUCrunchSvc(shortCalib=True)
42
43# Set up of CPU crunchers -------------------------------------------------------
44
45a1 = CPUCruncher("A1")
46a1.Cardinality = cardinality
47a1.avgRuntime = 5.0
48a1.NParallel = 5
49a1.OutputLevel = DEBUG
50
51# Application Manager ----------------------------------------------------------
52
54 EvtMax=evtMax,
55 EvtSel="NONE",
56 ExtSvc=[whiteboard],
57 EventLoop=slimeventloopmgr,
58 TopAlg=[a1],
59 MessageSvcType="InertMessageSvc",
60 OutputLevel=INFO,
61)
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
The Application Manager class.
A class that implements a search for prime numbers.
Definition CPUCruncher.h:30
Data service base class.