| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

prepareBenchmark.py
Go to the documentation of this file.
1 # File to prepare the configs and commands to be executed for the benchmark
2
3 import commands
4
5
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)
19 new_config.close()
20 return new_filename
21
22
23 ##########################
24 if __name__ == "__main__":
25
26 n_threads = 10
27 for n_algos in xrange(1, 11):
28 for n_events in xrange(1, n_algos + 1):
29 config = prepareConfig("../options/BrunelScenario.py", n_threads=n_threads,
30 n_parallel_events=n_events, n_parallel_algorithms=n_algos)
31 # config.replace(".py",".log"))
32 print "/usr/bin/time -f %%S -o %s.time `alias gaudirun` %s > %s" % (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:6