6 """ Flags for concurrency
10 __author__ =
'Charles Leggett'
11 __version__=
"$Revision: 1.0 $"
12 __doc__=
"concurrency flags "
20 from AthenaCommon.JobProperties
import JobProperty, JobPropertyContainer
21 from AthenaCommon.JobProperties
import jobproperties
24 """ Flag to indicate number of parallel workers"
27 allowedTypes = [
'int']
30 import multiprocessing
31 if (self.get_Value() == -1):
32 self.set_Value( multiprocessing.cpu_count() )
33 elif ( self.get_Value() < -1 ) :
34 from AthenaCommon.Logging
import log
35 log.fatal(
"nprocs cannot be < -1")
37 from AthenaCommon
import ExitCodes
38 sys.exit(ExitCodes.CONFIGURATION_ERROR)
39 elif (self.get_Value() > multiprocessing.cpu_count()):
40 from AthenaCommon.Logging
import log
41 log.warning(
"nprocs is larger than core count [%s]!",
42 multiprocessing.cpu_count())
47 """ Flag to indicate number of concurrent threads, possibly per worker"
50 allowedTypes = [
'int']
57 from AthenaCommon.Logging
import log
58 log.fatal(
"GaudiHive not in release - can't use --threads parameter")
60 from AthenaCommon
import ExitCodes
61 sys.exit(ExitCodes.IMPORT_ERROR)
63 if (self.get_Value() < 0):
64 from AthenaCommon.Logging
import log
65 log.fatal(
"Number of threads [%s] cannot be negative",self.get_Value())
67 from AthenaCommon
import ExitCodes
68 sys.exit(ExitCodes.CONFIGURATION_ERROR)
74 """ Flag to indicate number of concurrent events, possibly per worker"
77 allowedTypes = [
'int']
84 from AthenaCommon.Logging
import log
85 log.fatal(
"GaudiHive not in release - can't use --concurrent-events parameter")
87 from AthenaCommon
import ExitCodes
88 sys.exit(ExitCodes.IMPORT_ERROR)
90 if (self.get_Value() < 0):
91 from AthenaCommon.Logging
import log
92 log.fatal(
"Number of concurrent events [%s] cannot be negative",self.get_Value())
94 from AthenaCommon
import ExitCodes
95 sys.exit(ExitCodes.CONFIGURATION_ERROR)
101 """ stops the worker in bootstratp until a SIGUSR1 is recieved. Used as debug hook
104 allowedTypes = [
'bool']
109 """ The global ConcurrencyFlags job property container.
114 jobproperties.add_Container(ConcurrencyFlags)
117 list_jobproperties = [
124 for i
in list_jobproperties:
125 jobproperties.ConcurrencyFlags.add_JobProperty(i)
127 del list_jobproperties