| The Gaudi Framework v32r1 (f65d50dc)

Functions | Variables
brunelWrapper Namespace Reference

## Functions
def | createParser ()
def | replaceValues (cfg_name, n, eif, aif, nthreads, scale, clone, dumpQueues, verbosity)

## Variables
def | options = createParser()
def | newcfg
def | logfile = newcfg.replace(".py", ".log")
string | gaudirun = "`alias gaudirun`"
string | command

## Detailed Description

    This script acts as a wrapper in order to generate Gaudi configs for running
    with different parameters in order to perform performance measurements.
    It takes command line arguments.

## Function Documentation

## ◆ createParser()

def brunelWrapper.createParser | ( |  | ) |

Definition at line 19 of file brunelWrapper.py.

19 def createParser():
20 usage = "%prog [options]"
21 parser = optparse.OptionParser(usage)
22 parser.add_option('-n', help='Number of events', dest='nevts', default=15)
23 parser.add_option('--eif', help='Events in flight', dest='eif', default=5)
24 parser.add_option('--aif', help='Algos in flight', dest='aif', default=10)
25 parser.add_option(
26 '--nthreads', help='Number of threads', dest='nthreads', default=10)
27 parser.add_option(
28 '--clone',
29 help='Clone Algos',
30 dest='clone',
31 action='store_true',
32 default=False)
33 parser.add_option(
34 '--dumpQueues',
35 help='Dump Queues',
36 dest='dumpqueues',
37 action='store_true',
38 default=False)
39 parser.add_option(
40 '-v', help='Verbosity level', dest='verbosity', default=5)
41 parser.add_option(
42 '--exec',
43 help='ExecuteWorkflow',
44 dest='execbrunel',
45 action='store_true',
46 default=False)
47 parser.add_option(
48 '--bg',
49 help='Launch in background',
50 dest='bg',
51 action='store_true',
52 default=False)
53 parser.add_option(
54 '--scale', help='Scale Algorithms time', dest='scale', default=1)
55 options, args = parser.parse_args()
56 return options
57
58
brunelWrapper.createParser
def createParser()
Definition: brunelWrapper.py:19

## ◆ replaceValues()

def brunelWrapper.replaceValues | ( |  | cfg_name,
|  |  | n,
|  |  | eif,
|  |  | aif,
|  |  | nthreads,
|  |  | scale,
|  |  | clone,
|  |  | dumpQueues,
|  |  | verbosity
| ) |  |

Definition at line 59 of file brunelWrapper.py.

59 def replaceValues(cfg_name, n, eif, aif, nthreads, scale, clone, dumpQueues,
60 verbosity):
61
62 newcfglines = open(cfg_name, "r").readlines()
63 cfg_name = cfg_name.replace(".py", "")
64 verb = ""
65 if verbosity != 6:
66 verb = "_v%s" % verbosity
67 scale_s = ""
68 if scale != 1:
69 scale_s = "_s%s" % scale
70 newcfgname = "measurement_%s_n%s_eif%s_aif%s_nthreads%s_c%s_dq%s%s%s.py" % (
71 cfg_name, n, eif, aif, nthreads, clone, dumpQueues, scale_s, verb)
72 newcfg = open(newcfgname, "w")
73 for line in newcfglines:
74 if ('NumberOfEvents' in line and 'NUMBEROFEVENTS' in line
75 and not "FLIGHT" in line):
76 line = line.replace("NUMBEROFEVENTS", str(n))
77 if ('NumberOfEventsInFlight' in line
78 and 'NUMBEROFEVENTSINFLIGHT' in line):
79 line = line.replace("NUMBEROFEVENTSINFLIGHT", str(eif))
80 if ('NumberOfAlgosInFlight' in line
81 and 'NUMBEROFALGOSINFLIGHT' in line):
82 line = line.replace("NUMBEROFALGOSINFLIGHT", str(aif))
83 if ('NumberOfThreads' in line and 'NUMBEROFTHREADS' in line):
84 line = line.replace("NUMBEROFTHREADS", str(nthreads))
85 if ('DumpQueues' in line and 'DUMPQUEUES' in line):
86 line = line.replace("DUMPQUEUES", str(dumpQueues))
87 if ('CloneAlgos' in line and 'CLONEALGOS' in line):
88 line = line.replace("CLONEALGOS", str(clone))
89 if ('Verbosity' in line and 'VERBOSITY' in line):
90 line = line.replace("VERBOSITY", str(verbosity))
91 if ('Scale' in line and 'SCALE' in line):
92 line = line.replace("SCALE", str(scale))
93 newcfg.write(line)
94 newcfg.close()
95 return newcfgname
96
97
brunelWrapper.replaceValues
def replaceValues(cfg_name, n, eif, aif, nthreads, scale, clone, dumpQueues, verbosity)
Definition: brunelWrapper.py:59

## Variable Documentation

## ◆ command

string brunelWrapper.command

Initial value:
1 = "/usr/bin/time -f %%S -o timing_%s %s %s >& %s " % (
2 logfile, gaudirun, newcfg, logfile)

Definition at line 108 of file brunelWrapper.py.

## ◆ gaudirun

string brunelWrapper.gaudirun = "`alias gaudirun`"

Definition at line 106 of file brunelWrapper.py.

## ◆ logfile

def brunelWrapper.logfile = newcfg.replace(".py", ".log")

Definition at line 105 of file brunelWrapper.py.

## ◆ newcfg

def brunelWrapper.newcfg

Initial value:
1 = replaceValues("BrunelScenario.py", options.nevts,
2 options.eif, options.aif, options.nthreads,
3 float(options.scale), options.clone,
4 options.dumpqueues, options.verbosity)
brunelWrapper.replaceValues
def replaceValues(cfg_name, n, eif, aif, nthreads, scale, clone, dumpQueues, verbosity)
Definition: brunelWrapper.py:59

Definition at line 100 of file brunelWrapper.py.

## ◆ options

def brunelWrapper.options = createParser()

Definition at line 99 of file brunelWrapper.py.