The Gaudi Framework  v37r1 (a7f61348)
brunelWrapper Namespace Reference

Functions

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

Variables

 options
 
 newcfg
 
 logfile
 
 gaudirun
 
 command
 

Function Documentation

◆ createParser()

def brunelWrapper.createParser ( )

Definition at line 29 of file brunelWrapper.py.

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

◆ replaceValues()

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

Definition at line 68 of file brunelWrapper.py.

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", "")
71  verb = ""
72  if verbosity != 6:
73  verb = "_v%s" % verbosity
74  scale_s = ""
75  if scale != 1:
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" % (
78  cfg_name,
79  n,
80  eif,
81  aif,
82  nthreads,
83  clone,
84  dumpQueues,
85  scale_s,
86  verb,
87  )
88  newcfg = open(newcfgname, "w")
89  for line in newcfglines:
90  if (
91  "NumberOfEvents" in line
92  and "NUMBEROFEVENTS" in line
93  and "FLIGHT" not in line
94  ):
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))
110  newcfg.write(line)
111  newcfg.close()
112  return newcfgname
113 
114 

Variable Documentation

◆ command

brunelWrapper.command

Definition at line 134 of file brunelWrapper.py.

◆ gaudirun

brunelWrapper.gaudirun

Definition at line 130 of file brunelWrapper.py.

◆ logfile

brunelWrapper.logfile

Definition at line 129 of file brunelWrapper.py.

◆ newcfg

brunelWrapper.newcfg

Definition at line 117 of file brunelWrapper.py.

◆ options

brunelWrapper.options

Definition at line 116 of file brunelWrapper.py.

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