Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/ein16/synth/d2/obj_counter.py
ViewVC logotype

Diff of /branches/ein16/synth/d2/obj_counter.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4482, Thu Sep 1 20:43:01 2016 UTC revision 4483, Fri Sep 2 05:07:01 2016 UTC
# Line 2  Line 2 
2  class counter:  class counter:
3      def __init__(self):      def __init__(self):
4          self.rst_cnt = 0          self.rst_cnt = 0
5            self.rst_l = 0
6          self.rst_t = 0          self.rst_t = 0
7          self.rst_t_compile = 0          self.rst_t_compile = 0
8          self.rst_t_terrible = 0          self.rst_t_terrible = 0
# Line 38  Line 39 
39      def inc_cumulative(self):      def inc_cumulative(self):
40          self.rst_cumulative += 1          self.rst_cumulative += 1
41      def inc_total(self):      def inc_total(self):
42            self.rst_l+= 1
43          self.rst_t+= 1          self.rst_t+= 1
   
44      def inc_locals(self, rtn):      def inc_locals(self, rtn):
45          # collect results          # collect results
46          (rtn_1, rst_good_1, rst_eh_1, rst_check_1, rst_terrible_1, rst_compile_1, rst_NA_1) = rtn          (rtn_1, rst_good_1, rst_eh_1, rst_check_1, rst_terrible_1, rst_compile_1, rst_NA_1) = rtn
# Line 66  Line 67 
67          self.rst_cnt = 0          self.rst_cnt = 0
68    
69      def zero_total(self):      def zero_total(self):
70          self.rst_t = 0          self.rst_l = 0
71    
72    
73      def writeCumulativeS(self):      def writeCumulativeS(self):
# Line 92  Line 93 
93              x+=" NA:"+str(rst_t_NA)+"|"+str(rst_cumulative)              x+=" NA:"+str(rst_t_NA)+"|"+str(rst_cumulative)
94          if(rst_t_compile>0):          if(rst_t_compile>0):
95              x+=" did not run :"+str(rst_t_compile)+"|"+str(rst_cumulative)              x+=" did not run :"+str(rst_t_compile)+"|"+str(rst_cumulative)
96            x+= " iterations-l: " +str(rst_l)
97            x+= " iterations-t: " +str(rst_t)
98          x+= " cumulative: "+str(rst_cumulative)          x+= " cumulative: "+str(rst_cumulative)
99    
100          return x          return x
# Line 106  Line 108 
108          rst_terrible = self.rst_terrible          rst_terrible = self.rst_terrible
109          rst_NA = self.rst_NA          rst_NA = self.rst_NA
110          rst_cumulative = self.rst_cumulative          rst_cumulative = self.rst_cumulative
111          rst_t = self.rst_t          rst_l  = self.rst_l
112          rst_compile = self.rst_compile          rst_compile = self.rst_compile
113          x= ""          x= ""
114          if(rst_good>0):          if(rst_good>0):
# Line 122  Line 124 
124          if(rst_compile>0):          if(rst_compile>0):
125              x+=" did not run: "+str( rst_compile)              x+=" did not run: "+str( rst_compile)
126          x+= " ran: "+str(rst_cnt)          x+= " ran: "+str(rst_cnt)
127          x+= " iterations: " +str(rst_t)          x+= " iterations-l: " +str(rst_l)
128            x+= " iterations-t: " +str(rst_t)
129          x+= " cumulative: "+str(rst_cumulative)          x+= " cumulative: "+str(rst_cumulative)
130          return x          return x
131    

Legend:
Removed from v.4482  
changed lines
  Added in v.4483

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0