16 template_filename, n_threads=10, n_parallel_events=10, n_parallel_algorithms=10
18 template = open(template_filename)
19 new_filename =
"%s_%i_%i_%i.py" % (
20 template_filename.rstrip(
".py"),
23 n_parallel_algorithms,
25 new_config = open(new_filename,
"w")
26 for line
in template.readlines():
27 if line.startswith(
"n_threads"):
28 line =
"n_threads = %i\n" % n_threads
29 elif line.startswith(
"n_parallel_events"):
30 line =
"n_parallel_events = %i\n" % n_parallel_events
31 elif line.startswith(
"n_parallel_algorithms"):
32 line =
"n_parallel_algorithms = %i\n" % n_parallel_algorithms
33 new_config.write(line)
39 if __name__ ==
"__main__":
41 for n_algos
in range(1, 11):
42 for n_events
in range(1, n_algos + 1):
44 "../options/BrunelScenario.py",
46 n_parallel_events=n_events,
47 n_parallel_algorithms=n_algos,
51 "/usr/bin/time -f %%S -o %s.time `alias gaudirun` %s > %s"
52 % (config.replace(
".py",
""), config,
"/dev/null")