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

SCM Repository

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

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

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

revision 4494, Sat Sep 3 01:48:23 2016 UTC revision 4495, Sat Sep 3 06:29:28 2016 UTC
# Line 146  Line 146 
146    
147  # iterating over the different types  # iterating over the different types
148  def main_Standard():  def main_Standard():
149        print "standard"
150      n_frame = 0 # int(sys.argv[1])      n_frame = 0 # int(sys.argv[1])
151      args = 0 #int(sys.argv[2])      args = 0 #int(sys.argv[2])
152      shift = 0 # how many commands used so far      shift = 1 # how many commands used so far
153      # get testing framework      # get testing framework
154      testing_frame = get_testing_frame(n_frame)      testing_frame = get_testing_frame(n_frame)
155      # get counter      # get counter
# Line 158  Line 159 
159      # constants (decides layer of testing)      # constants (decides layer of testing)
160      layer = 2      layer = 2
161      # layer, and shift from constants (decides layer of testing)      # layer, and shift from constants (decides layer of testing)
162        start_standard = time.time()
163      #choose testing range based on commands      #choose testing range based on commands
164      cmd(layer, testing_frame, cnt, shift, args)      cmd(layer, testing_frame, cnt, shift, args)
165      clean()      clean()
166        end_standard = time.time()
167        tt_standard  = " time all _standard "+str(end_standard  - start_standard )
168        writeall(tt_standard )
169        print (tt_standard )
170    
171  # single(inner->outer) iter ->shape  # single(inner->outer) iter ->shape
172  def main():  def main5():
173      #n_frame = int(sys.argv[1])      #n_frame = int(sys.argv[1])
174      #args = int(sys.argv[2])      #args = int(sys.argv[2])
175      #shift = 2 # how many commands used so far      #shift = 2 # how many commands used so far
# Line 186  Line 191 
191      writeTitle_outer(opr_inner, opr_outer)      writeTitle_outer(opr_inner, opr_outer)
192    
193      #choose testing range based on commands      #choose testing range based on commands
194      pick(opr_inner, opr_outer, testing_frame, cnt)      pick_inner(opr_inner, opr_outer, testing_frame, cnt)
195      clean()      clean()
196    
197    # single(inner->outer) iter ->shape
198  # inner->outer->shape  def main_backwards():
 def main_iter2():  
199      #n_frame = int(sys.argv[1])      #n_frame = int(sys.argv[1])
200      #args = int(sys.argv[2])      #args = int(sys.argv[2])
201      #shift = 2 # how many commands used so far      #shift = 2 # how many commands used so far
202      n_frame = 0      n_frame = 0
203        shift = 1
204    
205      # get testing framework      # get testing framework
206      testing_frame = get_testing_frame(n_frame)      testing_frame = get_testing_frame(n_frame)
207      # get counter      # get counter
208      cnt = get_counter()      cnt = get_counter()
209      # writing heading based on framework      # writing heading based on framework
210      write_heading(testing_frame)      #write_heading(testing_frame)
211    
212      #choose testing range based on commands      #choose testing range based on commands
213      n = len(op_all)      t_inner = int(sys.argv[shift+1])
214      for t_inner in range(n):      t_outer = int(sys.argv[shift+2])#outer  operator
         startx = time.time()  
         opr_inner = id_toOpr(t_inner)  
         for  t_outer in range(n):  
             starty = time.time()  
215              opr_outer = id_toOpr(t_outer)              opr_outer = id_toOpr(t_outer)
216              counter.zero_locals(cnt)      opr_inner = id_toOpr(t_inner)
             counter.zero_total(cnt)  
217              writeTitle_outer(opr_inner, opr_outer)              writeTitle_outer(opr_inner, opr_outer)
218    
219              #choose testing range based on commands              #choose testing range based on commands
220              pick(opr_inner, opr_outer, testing_frame, cnt)      pick_backwards(opr_inner, opr_outer, testing_frame, cnt)
221              clean()              clean()
             endy = time.time()  
             tt = "  timey:"+str(endy - starty)  
             writeall(tt)  
             print (tt)  
222    
         endx = time.time()  
         tx = "  time-x:"+str(endx - startx)  
         writeall(tx)  
         print (tx)  
223    
224    # inner->outer->shape
225  # inner->shape->outer  def main_iter2():
 def main_iter3():  
226      #n_frame = int(sys.argv[1])      #n_frame = int(sys.argv[1])
227      #args = int(sys.argv[2])      #args = int(sys.argv[2])
228      #shift = 2 # how many commands used so far      #shift = 2 # how many commands used so far
# Line 243  Line 236 
236    
237      #choose testing range based on commands      #choose testing range based on commands
238      n = len(op_all)      n = len(op_all)
239        startall = time.time()
240      for t_inner in range(n):      for t_inner in range(n):
241          startx = time.time()          startx = time.time()
242          opr_inner = id_toOpr(t_inner)          opr_inner = id_toOpr(t_inner)
243          pick(opr_inner, None, testing_frame, cnt)          for  t_outer in range(n):
244                starty = time.time()
245                opr_outer = id_toOpr(t_outer)
246                counter.zero_locals(cnt)
247                counter.zero_total(cnt)
248                writeTitle_outer(opr_inner, opr_outer)
249                #choose testing range based on commands
250                pick_inner(opr_inner, opr_outer, testing_frame, cnt)
251                clean()
252                endy = time.time()
253                tt = "done inner: "+opr_inner.name+" outer: "+opr_outer.name+" time: "+str(endy - starty)
254                tmp = "time: all-snapshot"+str(endy - startall)
255                writeall(tt+tmp)
256                print (tt+tmp)
257    
258          endx = time.time()          endx = time.time()
259          tx = "  time-x:"+str(endx - startx)          tx = "done inner: "+opr_inner.name+" time: "+str(endx - startx)
260          writeall(tx)          writeall(tx)
261          print (tx)          print (tx)
262            tsnap = "time: all-snapshot"+str(endx - startall)
263            writeall(tsnap)
264            print (tsnap)
265    
266        endall = time.time()
267        tall = "time: all"+str(endall - startall)
268        writeall(tall)
269        print (tall)
270    
271    
272  # shape->inner->outer  # shape->inner->outer
273  def main_iter1():  def main_iter1():
# Line 264  Line 281 
281      cnt = get_counter()      cnt = get_counter()
282      # writing heading based on framework      # writing heading based on framework
283      write_heading(testing_frame)      write_heading(testing_frame)
284        startall = time.time()
285      #choose testing range based on commands      #choose testing range based on commands
286      pick(None, None, testing_frame, cnt)      pick_shape(testing_frame, cnt)
287        endall = time.time()
288        tall = "time: all"+str(endall - startall)
289        writeall(tall)
290        print (tall)
291    
292    
293    
# Line 277  Line 297 
297      main_Standard()      main_Standard()
298  elif(x==1):  elif(x==1):
299      main_iter1()      main_iter1()
300        # shape->inner->outer
301  elif(x==2):  elif(x==2):
302        # inner->outer->shape
303      main_iter2()      main_iter2()
304    elif(x==5):
305        # backwards
306        # specifiy two arguments
307        main5()
308    elif(x==6):
309        main_backwards()
310  end = time.time()  end = time.time()
311  t = "  time:"+str(end - start)  t = "  time:"+str(end - start)
312  writeall(t)  writeall(t)

Legend:
Removed from v.4494  
changed lines
  Added in v.4495

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