The Gaudi Framework  v36r9 (fd2bdac3)
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 31 of file brunelWrapper.py.

31 def createParser():
32  usage = "%prog [options]"
33  parser = optparse.OptionParser(usage)
34  parser.add_option("-n", help="Number of events", dest="nevts", default=15)
35  parser.add_option("--eif", help="Events in flight", dest="eif", default=5)
36  parser.add_option("--aif", help="Algos in flight", dest="aif", default=10)
37  parser.add_option(
38  "--nthreads", help="Number of threads", dest="nthreads", default=10
39  )
40  parser.add_option(
41  "--clone", help="Clone Algos", dest="clone", action="store_true", default=False
42  )
43  parser.add_option(
44  "--dumpQueues",
45  help="Dump Queues",
46  dest="dumpqueues",
47  action="store_true",
48  default=False,
49  )
50  parser.add_option("-v", help="Verbosity level", dest="verbosity", default=5)
51  parser.add_option(
52  "--exec",
53  help="ExecuteWorkflow",
54  dest="execbrunel",
55  action="store_true",
56  default=False,
57  )
58  parser.add_option(
59  "--bg",
60  help="Launch in background",
61  dest="bg",
62  action="store_true",
63  default=False,
64  )
65  parser.add_option("--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, verbosity):
71 
72  newcfglines = open(cfg_name, "r").readlines()
73  cfg_name = cfg_name.replace(".py", "")
74  verb = ""
75  if verbosity != 6:
76  verb = "_v%s" % verbosity
77  scale_s = ""
78  if scale != 1:
79  scale_s = "_s%s" % scale
80  newcfgname = "measurement_%s_n%s_eif%s_aif%s_nthreads%s_c%s_dq%s%s%s.py" % (
81  cfg_name,
82  n,
83  eif,
84  aif,
85  nthreads,
86  clone,
87  dumpQueues,
88  scale_s,
89  verb,
90  )
91  newcfg = open(newcfgname, "w")
92  for line in newcfglines:
93  if (
94  "NumberOfEvents" in line
95  and "NUMBEROFEVENTS" in line
96  and not "FLIGHT" in line
97  ):
98  line = line.replace("NUMBEROFEVENTS", str(n))
99  if "NumberOfEventsInFlight" in line and "NUMBEROFEVENTSINFLIGHT" in line:
100  line = line.replace("NUMBEROFEVENTSINFLIGHT", str(eif))
101  if "NumberOfAlgosInFlight" in line and "NUMBEROFALGOSINFLIGHT" in line:
102  line = line.replace("NUMBEROFALGOSINFLIGHT", str(aif))
103  if "NumberOfThreads" in line and "NUMBEROFTHREADS" in line:
104  line = line.replace("NUMBEROFTHREADS", str(nthreads))
105  if "DumpQueues" in line and "DUMPQUEUES" in line:
106  line = line.replace("DUMPQUEUES", str(dumpQueues))
107  if "CloneAlgos" in line and "CLONEALGOS" in line:
108  line = line.replace("CLONEALGOS", str(clone))
109  if "Verbosity" in line and "VERBOSITY" in line:
110  line = line.replace("VERBOSITY", str(verbosity))
111  if "Scale" in line and "SCALE" in line:
112  line = line.replace("SCALE", str(scale))
113  newcfg.write(line)
114  newcfg.close()
115  return newcfgname
116 
117 

Variable Documentation

◆ command

string brunelWrapper.command
Initial value:
1 = "/usr/bin/time -f %%S -o timing_%s %s %s >& %s " % (
2  logfile,
3  gaudirun,
4  newcfg,
5  logfile,
6  )

Definition at line 137 of file brunelWrapper.py.

◆ gaudirun

tuple brunelWrapper.gaudirun = "`alias gaudirun`"

Definition at line 133 of file brunelWrapper.py.

◆ logfile

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

Definition at line 132 of file brunelWrapper.py.

◆ newcfg

def brunelWrapper.newcfg
Initial value:
2  "BrunelScenario.py",
3  options.nevts,
4  options.eif,
5  options.aif,
6  options.nthreads,
7  float(options.scale),
8  options.clone,
9  options.dumpqueues,
10  options.verbosity,
11  )

Definition at line 120 of file brunelWrapper.py.

◆ options

def brunelWrapper.options = createParser()

Definition at line 119 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:31