The Gaudi Framework  master (37c0b60a)
prepareBenchmark.py
Go to the documentation of this file.
1 
11 
12 # File to prepare the configs and commands to be executed for the benchmark
13 
14 
16  template_filename, n_threads=10, n_parallel_events=10, n_parallel_algorithms=10
17 ):
18  template = open(template_filename)
19  new_filename = "%s_%i_%i_%i.py" % (
20  template_filename.rstrip(".py"),
21  n_threads,
22  n_parallel_events,
23  n_parallel_algorithms,
24  )
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  n_threads = 10
41  for n_algos in range(1, 11):
42  for n_events in range(1, n_algos + 1):
43  config = prepareConfig(
44  "../options/BrunelScenario.py",
45  n_threads=n_threads,
46  n_parallel_events=n_events,
47  n_parallel_algorithms=n_algos,
48  )
49  # config.replace(".py",".log"))
50  print(
51  "/usr/bin/time -f %%S -o %s.time `alias gaudirun` %s > %s"
52  % (config.replace(".py", ""), config, "/dev/null")
53  )
prepareBenchmark.prepareConfig
def prepareConfig(template_filename, n_threads=10, n_parallel_events=10, n_parallel_algorithms=10)
(c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations # # This software i...
Definition: prepareBenchmark.py:15
Gaudi::Functional::details::zip::range
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.
Definition: details.h:97