- Timestamp:
- Jan 18, 2012, 1:32:53 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/mem_time_tests/triangles/fromregions/main.py
r8300 r8303 7 7 # Import standard shallow water domain and standard boundaries. 8 8 import anuga 9 import random10 9 import subprocess 11 10 import runcairns 12 11 import csv 13 12 import os 14 import PyVM15 13 import time 16 import liststore 14 from anuga.utilities import system_tools, log 15 from anuga.abstract_2d_finite_volumes.util import add_directories 17 16 18 17 #------------------------------------------------------------------------------ … … 20 19 #------------------------------------------------------------------------------ 21 20 a = [] 22 m = 20 23 spamWriter = csv.writer(open('ex1.csv', 'wb')) 21 22 23 home = os.getenv('INUNDATIONHOME') 24 scenariodir = add_directories(home, ["data","mem_time_test", "triangles", 25 "fromregions"]) 26 log.log_filename = os.path.join(scenariodir, 'log.txt') 27 28 file = 'ex1.csv' 29 file_path = os.path.join(scenariodir, file) 30 31 spamWriter = csv.writer(open(file_path, 'wb')) 24 32 spamWriter.writerow(['Number Of Triangles' ,'Max Triangle Area', 'Extent', 'Space Used MB' , 'Time Taken s']) 25 33 … … 27 35 28 36 def runlist(r): 29 n = 20 30 while (n > 0): 31 c = random.random() * 2000 + 1 32 PyVM.MemoryUpdate() 37 for n in range(1,2000,100): 38 system_tools.MemoryUpdate() 33 39 z = time.time() 34 h = runcairns.runex( c,r)40 h = runcairns.runex(n,r) 35 41 y = time.time() 36 n = n -1 37 x = PyVM.MemoryUpdate()[0] 38 spamWriter.writerow([h,r,(c*c),x ,(y-z)]) 42 x = system_tools.MemoryUpdate()[0] 43 spamWriter.writerow([h,r,(n*n),x ,(y-z)]) 39 44 40 while (m > 0): 41 m = m -1 42 d = random.random() * 100 +1 43 d = 1.0 44 runlist(d) 45 for m in range(1,100,10): 46 runlist(m) 45 47 46 48 print 'DONE'
Note: See TracChangeset
for help on using the changeset viewer.