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.
22 NumberOfEventsInFlight = 5
23 NumberOfAlgosInFlight = 5
31 usage =
"%prog [options]"
32 parser = optparse.OptionParser(usage)
33 parser.add_option(
"-n", help=
"Number of events", dest=
"nevts", default=15)
34 parser.add_option(
"--eif", help=
"Events in flight", dest=
"eif", default=5)
35 parser.add_option(
"--aif", help=
"Algos in flight", dest=
"aif", default=10)
37 "--nthreads", help=
"Number of threads", dest=
"nthreads", default=10
40 "--clone", help=
"Clone Algos", dest=
"clone", action=
"store_true", default=
False
49 parser.add_option(
"-v", help=
"Verbosity level", dest=
"verbosity", default=5)
52 help=
"ExecuteWorkflow",
59 help=
"Launch in background",
64 parser.add_option(
"--scale", help=
"Scale Algorithms time", dest=
"scale", default=1)
65 options, args = parser.parse_args()
69 def replaceValues(cfg_name, n, eif, aif, nthreads, scale, clone, dumpQueues, verbosity):
70 newcfglines = open(cfg_name,
"r").readlines()
71 cfg_name = cfg_name.replace(
".py",
"")
74 verb =
"_v%s" % verbosity
77 scale_s =
"_s%s" % scale
78 newcfgname =
"measurement_%s_n%s_eif%s_aif%s_nthreads%s_c%s_dq%s%s%s.py" % (
89 newcfg = open(newcfgname,
"w")
90 for line
in newcfglines:
92 "NumberOfEvents" in line
93 and "NUMBEROFEVENTS" in line
94 and "FLIGHT" not in line
96 line = line.replace(
"NUMBEROFEVENTS", str(n))
97 if "NumberOfEventsInFlight" in line
and "NUMBEROFEVENTSINFLIGHT" in line:
98 line = line.replace(
"NUMBEROFEVENTSINFLIGHT", str(eif))
99 if "NumberOfAlgosInFlight" in line
and "NUMBEROFALGOSINFLIGHT" in line:
100 line = line.replace(
"NUMBEROFALGOSINFLIGHT", str(aif))
101 if "NumberOfThreads" in line
and "NUMBEROFTHREADS" in line:
102 line = line.replace(
"NUMBEROFTHREADS", str(nthreads))
103 if "DumpQueues" in line
and "DUMPQUEUES" in line:
104 line = line.replace(
"DUMPQUEUES", str(dumpQueues))
105 if "CloneAlgos" in line
and "CLONEALGOS" in line:
106 line = line.replace(
"CLONEALGOS", str(clone))
107 if "Verbosity" in line
and "VERBOSITY" in line:
108 line = line.replace(
"VERBOSITY", str(verbosity))
109 if "Scale" in line
and "SCALE" in line:
110 line = line.replace(
"SCALE", str(scale))
116 if __name__ ==
"__main__":
124 float(options.scale),
130 logfile = newcfg.replace(
".py",
".log")
131 gaudirun =
"`alias gaudirun`"
133 "/afs/cern.ch/user/d/dpiparo/Gaudi/build.x86_64-slc5-gcc46-opt/run gaudirun.py"
135 command =
"/usr/bin/time -f %%S -o timing_%s %s %s >& %s " % (
145 if options.execbrunel: