The Gaudi Framework  v36r1 (3e2fb5a8)
prepareBenchmark.py
Go to the documentation of this file.
1 
11 from __future__ import print_function
12 # File to prepare the configs and commands to be executed for the benchmark
13 
14 import commands
15 
16 
17 def prepareConfig(template_filename,
18  n_threads=10,
19  n_parallel_events=10,
20  n_parallel_algorithms=10):
21  template = open(template_filename)
22  new_filename = "%s_%i_%i_%i.py" % (template_filename.rstrip(".py"),
23  n_threads, n_parallel_events,
24  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)
34  new_config.close()
35  return new_filename
36 
37 
38 
39 if __name__ == "__main__":
40 
41  n_threads = 10
42  for n_algos in range(1, 11):
43  for n_events in range(1, n_algos + 1):
44  config = prepareConfig(
45  "../options/BrunelScenario.py",
46  n_threads=n_threads,
47  n_parallel_events=n_events,
48  n_parallel_algorithms=n_algos)
49  # config.replace(".py",".log"))
50  print("/usr/bin/time -f %%S -o %s.time `alias gaudirun` %s > %s" %
51  (config.replace(".py", ""), config, "/dev/null"))
prepareBenchmark.prepareConfig
def prepareConfig(template_filename, n_threads=10, n_parallel_events=10, n_parallel_algorithms=10)
Definition: prepareBenchmark.py:17
Gaudi::Functional::details::zip::range
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.
Definition: FunctionalDetails.h:97