36 def replaceValues(cfg_name,n,eif,aif,nthreads,scale,clone,dumpQueues,verbosity):
38 newcfglines=open(cfg_name,
"r").readlines()
39 cfg_name=cfg_name.replace(".py",
"")
46 newcfgname=
"measurement_%s_n%s_eif%s_aif%s_nthreads%s_c%s_dq%s%s%s.py" %(cfg_name,n,eif,aif,nthreads,clone,dumpQueues,scale_s,verb)
47 newcfg=open(newcfgname,
"w")
48 for line
in newcfglines:
49 if (
'NumberOfEvents' in line
and 'NUMBEROFEVENTS' in line
and not "FLIGHT" in line):
50 line=line.replace(
"NUMBEROFEVENTS",str(n))
51 if (
'NumberOfEventsInFlight' in line
and 'NUMBEROFEVENTSINFLIGHT' in line):
52 line=line.replace(
"NUMBEROFEVENTSINFLIGHT",str(eif))
53 if (
'NumberOfAlgosInFlight' in line
and 'NUMBEROFALGOSINFLIGHT' in line):
54 line=line.replace(
"NUMBEROFALGOSINFLIGHT",str(aif))
55 if (
'NumberOfThreads' in line
and 'NUMBEROFTHREADS' in line):
56 line=line.replace(
"NUMBEROFTHREADS",str(nthreads))
57 if (
'DumpQueues'in line
and 'DUMPQUEUES' in line):
58 line=line.replace(
"DUMPQUEUES",str(dumpQueues))
59 if (
'CloneAlgos'in line
and 'CLONEALGOS' in line):
60 line=line.replace(
"CLONEALGOS",str(clone))
61 if (
'Verbosity'in line
and 'VERBOSITY' in line):
62 line=line.replace(
"VERBOSITY",str(verbosity))
63 if (
'Scale'in line
and 'SCALE' in line):
64 line=line.replace(
"SCALE",str(scale))
def replaceValues(cfg_name, n, eif, aif, nthreads, scale, clone, dumpQueues, verbosity)