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