ATLAS Offline Software
Loading...
Searching...
No Matches
plot_times.py
Go to the documentation of this file.
1# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2import pylab as pl
3import sys
4import os
5
6
7
8
9
10def times(fn):
11 result = []
12 with open(fn) as iff:
13 for l in iff:
14 if 'tav' in l and 'node: 0 parent: 0' in l:
15 result.append(float(l[:-1].split()[-1]))
16
17 return result
18
19
20if __name__ == '__main__':
21
22 if len(sys.argv) < 2:
23 print('Please supply an input file name on the command line')
24 sys.exit(0)
25
26
27 fn = sys.argv[1]
28 if not os.path.exists(fn):
29 print('unknown file. giving up: ', fn)
30 sys.exit(0)
31 x = times(fn)
32 # print x
33 pl.hist(x)
34 pl.suptitle('Execution times for %s' % fn)
35 pl.xlabel('time (ns)')
36 pl.ylabel('no of calls')
37 pl.savefig('%s_times.pdf' % fn[:-4])
38 pl.show()
void print(char *figname, TCanvas *c1)
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177