13 This script acts as a wrapper in order to generate Gaudi configs for running
14 with different parameters in order to perform performance measurements.
15 It takes command line arguments.
21 NumberOfEventsInFlight = 5
22 NumberOfAlgosInFlight = 5
30 usage =
"%prog [options]"
31 parser = optparse.OptionParser(usage)
32 parser.add_option(
"-n", help=
"Number of events", dest=
"nevts", default=15)
33 parser.add_option(
"--eif", help=
"Events in flight", dest=
"eif", default=5)
34 parser.add_option(
"--aif", help=
"Algos in flight", dest=
"aif", default=10)
36 "--nthreads", help=
"Number of threads", dest=
"nthreads", default=10
39 "--clone", help=
"Clone Algos", dest=
"clone", action=
"store_true", default=
False
48 parser.add_option(
"-v", help=
"Verbosity level", dest=
"verbosity", default=5)
51 help=
"ExecuteWorkflow",
58 help=
"Launch in background",
63 parser.add_option(
"--scale", help=
"Scale Algorithms time", dest=
"scale", default=1)
64 options, args = parser.parse_args()
68 def replaceValues(cfg_name, n, eif, aif, nthreads, scale, clone, dumpQueues, verbosity):
69 newcfglines = open(cfg_name,
"r").readlines()
70 cfg_name = cfg_name.replace(
".py",
"")
73 verb =
"_v%s" % verbosity
76 scale_s =
"_s%s" % scale
77 newcfgname =
"measurement_%s_n%s_eif%s_aif%s_nthreads%s_c%s_dq%s%s%s.py" % (
88 newcfg = open(newcfgname,
"w")
89 for line
in newcfglines:
91 "NumberOfEvents" in line
92 and "NUMBEROFEVENTS" in line
93 and "FLIGHT" not in line
95 line = line.replace(
"NUMBEROFEVENTS", str(n))
96 if "NumberOfEventsInFlight" in line
and "NUMBEROFEVENTSINFLIGHT" in line:
97 line = line.replace(
"NUMBEROFEVENTSINFLIGHT", str(eif))
98 if "NumberOfAlgosInFlight" in line
and "NUMBEROFALGOSINFLIGHT" in line:
99 line = line.replace(
"NUMBEROFALGOSINFLIGHT", str(aif))
100 if "NumberOfThreads" in line
and "NUMBEROFTHREADS" in line:
101 line = line.replace(
"NUMBEROFTHREADS", str(nthreads))
102 if "DumpQueues" in line
and "DUMPQUEUES" in line:
103 line = line.replace(
"DUMPQUEUES", str(dumpQueues))
104 if "CloneAlgos" in line
and "CLONEALGOS" in line:
105 line = line.replace(
"CLONEALGOS", str(clone))
106 if "Verbosity" in line
and "VERBOSITY" in line:
107 line = line.replace(
"VERBOSITY", str(verbosity))
108 if "Scale" in line
and "SCALE" in line:
109 line = line.replace(
"SCALE", str(scale))
115 if __name__ ==
"__main__":
123 float(options.scale),
129 logfile = newcfg.replace(
".py",
".log")
130 gaudirun =
"`alias gaudirun`"
132 "/afs/cern.ch/user/d/dpiparo/Gaudi/build.x86_64-slc5-gcc46-opt/run gaudirun.py"
134 command =
"/usr/bin/time -f %%S -o timing_%s %s %s >& %s " % (
144 if options.execbrunel: