The Gaudi Framework  v36r1 (3e2fb5a8)
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
 

Function Documentation

◆ createParser()

def brunelWrapper.createParser ( )

Definition at line 30 of file brunelWrapper.py.

30 def createParser():
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)
36  parser.add_option(
37  '--nthreads', help='Number of threads', dest='nthreads', default=10)
38  parser.add_option(
39  '--clone',
40  help='Clone Algos',
41  dest='clone',
42  action='store_true',
43  default=False)
44  parser.add_option(
45  '--dumpQueues',
46  help='Dump Queues',
47  dest='dumpqueues',
48  action='store_true',
49  default=False)
50  parser.add_option(
51  '-v', help='Verbosity level', dest='verbosity', default=5)
52  parser.add_option(
53  '--exec',
54  help='ExecuteWorkflow',
55  dest='execbrunel',
56  action='store_true',
57  default=False)
58  parser.add_option(
59  '--bg',
60  help='Launch in background',
61  dest='bg',
62  action='store_true',
63  default=False)
64  parser.add_option(
65  '--scale', help='Scale Algorithms time', dest='scale', default=1)
66  options, args = parser.parse_args()
67  return options
68 
69 

◆ replaceValues()

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

Definition at line 70 of file brunelWrapper.py.

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

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 119 of file brunelWrapper.py.

◆ gaudirun

string brunelWrapper.gaudirun = "`alias gaudirun`"

Definition at line 117 of file brunelWrapper.py.

◆ logfile

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

Definition at line 116 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)

Definition at line 111 of file brunelWrapper.py.

◆ options

def brunelWrapper.options = createParser()

Definition at line 110 of file brunelWrapper.py.

brunelWrapper.replaceValues
def replaceValues(cfg_name, n, eif, aif, nthreads, scale, clone, dumpQueues, verbosity)
Definition: brunelWrapper.py:70
brunelWrapper.createParser
def createParser()
Definition: brunelWrapper.py:30