6 def prepareConfig(template_filename, n_threads=10, n_parallel_events=10, n_parallel_algorithms=10):
7 template = open(template_filename)
8 new_filename =
"%s_%i_%i_%i.py" % (template_filename.rstrip(
9 ".py"), n_threads, n_parallel_events, n_parallel_algorithms)
10 new_config = open(new_filename,
"w")
11 for line
in template.readlines():
12 if line.startswith(
"n_threads"):
13 line =
"n_threads = %i\n" % n_threads
14 elif line.startswith(
"n_parallel_events"):
15 line =
"n_parallel_events = %i\n" % n_parallel_events
16 elif line.startswith(
"n_parallel_algorithms"):
17 line =
"n_parallel_algorithms = %i\n" % n_parallel_algorithms
18 new_config.write(line)
def prepareConfig(template_filename, n_threads=10, n_parallel_events=10, n_parallel_algorithms=10)