38 e2 = other.ellapsed/other.events
40 e4 = (other.user+other.system)/other.events
41 s1 =
'%8.2e %8.2e'%(e1-e2,e3-e4)
48 lines=open(sys.argv[1],
"r").readlines()
56 if l.find(
'Write ')==0:
61 summary.nevt = int(itm[4])
63 summary.protocol = itm[3]
64 summary.step[step] =
'Write'
65 all_summs[summary.protocol]=summary
66 summary.stepno[summary.step[step]] = step
67 elif l.find(
'Read ')==0:
69 if not all_summs.has_key(itm[3]):
71 summary.nevt = int(itm[4])
73 summary.protocol = itm[3]
74 all_summs[summary.protocol]=summary
77 summary.step[step] =
'Read'
78 summary.stepno[summary.step[step]] = step
79 elif l.find(
'CollWrite')==0:
82 summary.step[step] =
'CollWrite'
83 summary.stepno[summary.step[step]] = step
84 elif l.find(
'CollRead 90')==0:
87 summary.step[step] =
'CollRead 90'
88 summary.stepno[summary.step[step]] = step
89 elif l.find(
'CollRead 50')==0:
92 summary.step[step] =
'CollRead 50'
93 summary.stepno[summary.step[step]] = step
94 elif l.find(
'CollRead 10')==0:
97 summary.step[step] =
'CollRead 10'
98 summary.stepno[summary.step[step]] = step
103 summary.data[step] = l[:-1]
105 summary.opt[step] = summary.nevt
107 summary.opt[step] = int(l[l.find(
' #=')+3:-1])
112 for k
in all_summs.keys():
113 summary = all_summs[k]
115 for s
in summary.data.keys():
117 if summary.opt.has_key(s): opt=summary.opt[s]
119 steps[s]=summary.step[s]
120 opts[s]=summary.opt[s]
127 for sk
in steps.keys():
129 for k
in all_summs.keys():
130 summary = all_summs[k]
132 for s
in summary.data.keys():
133 if i==summary.step[s]:
135 itms = summary.data[s].split(
'\t')[0].split(
' ')
137 user = float(itms[0][:-1])
138 system = float(itms[1][:-1])
139 cpu = float(itms[3][:-1])
140 ellapsed = (user+system)/cpu*100.0
142 s1 =
'%-8s %-8s %-12s %8.2f %8.2f %7.2f %4.1f %7d'%(summary.type,summary.protocol,summary.step[s],ellapsed,user,system,cpu,nevt,)
143 s2 =
'%8.2e %8.2e %8.2e'%(ellapsed/nevt,user/nevt,system/nevt)
147 item.name = summary.step[s]
148 item.type = summary.type
149 item.protocol = summary.protocol
150 item.data = summary.data[s]
155 item.ellapsed = ellapsed
156 item.usage = (nevt,cpu,user,system,ellapsed)
157 sum[summary.protocol].step[summary.stepno[i]] = item
161 castor = sum[
'castor']
162 for s
in file.step.keys():
163 step_f = file.step[s]
164 step_c = castor.step[s]
165 print step_f.toString()
166 print step_c.toString(),step_c.diff(step_f)