Changeset 8310
- Timestamp:
- Jan 19, 2012, 1:05:43 PM (13 years ago)
- Location:
- trunk/anuga_work/development/mem_time_tests/triangles/area
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/mem_time_tests/triangles/area/main.py
r8303 r8310 11 11 import os 12 12 import time 13 import liststore 13 14 from anuga.utilities import system_tools, log 14 15 from anuga.abstract_2d_finite_volumes.util import add_directories … … 21 22 #SpaceUsed = 0.0 22 23 #number = 0 23 spacelist = [0,0,0,0]24 24 25 home = os.getenv('INUNDATIONHOME')26 scenariodir = add_directories(home , ["data","mem_time_test", "triangles","area"])27 file = 'ex1.csv'28 file_path = os.path.join(scenariodir, file )25 home1 = os.getenv('INUNDATIONHOME') 26 scenariodir = add_directories(home1, ["data","mem_time_test", "triangles","area"]) 27 file1 = 'ex1.csv' 28 file_path = os.path.join(scenariodir, file1) 29 29 storel ='storel.txt' 30 30 file_path_storel = os.path.join(scenariodir, storel) … … 36 36 file_path_storen = os.path.join(scenariodir, storen) 37 37 38 log.log_filename = os.path.join(scenariodir, 'log.txt') 39 38 40 spamWriter = csv.writer(open(file_path, 'wb')) 39 41 spamWriter.writerow(['Number Of Triangles' ,'Max Triangle Area', 'Extent', 'Space Used MB' , 'Time Taken s']) … … 42 44 def rum(d): 43 45 f = 4 44 for l in range(1 ,2000,100):46 for l in range(100,2000,100): 45 47 46 48 g = open(file_path_storel,'r+') … … 51 53 52 54 z = time.time() 53 subprocess.call(['mpirun', '-np', str(f), '-hostfile' ,'~/machinefiles/t.machines_tornado', '-x', 'PYTHONPATH','python2.5', 'runcairns.py']) 55 subprocess.call(['mpirun', '-np', str(f), '-hostfile' ,'~/machinefiles/t.machines_tornado', '-x','PYTHONPATH','-x','INUNDATIONHOME','python2.5', 'runcairns.py']) 56 #subprocess.call(['python2.5', 'runcairns.py']) 54 57 y = time.time() 55 58 56 59 f = open(file_path_store,'r+') 57 x = 3#float(f.readline())60 x = float(f.readline()) 58 61 f.close() 59 62 60 63 f = open(file_path_storen,'r+') 61 i = 3#float(f.readline())64 i = float(f.readline()) 62 65 f.close() 63 66 64 67 spamWriter.writerow([i,d,(l*l),x ,(y-z)]) 65 spacelist= [0,0,0,0]68 liststore.store = [0,0,0,0] 66 69 67 for m in range( 1,100,10):70 for m in range(90,100,10): 68 71 rum(m) 69 72 -
trunk/anuga_work/development/mem_time_tests/triangles/area/runcairns.py
r8303 r8310 19 19 import time 20 20 import sys 21 import main21 import liststore 22 22 23 23 # Related major packages … … 27 27 from anuga.utilities import system_tools, log 28 28 29 spacelist = [0,0,0,0]30 29 31 #home = os.getenv('INUNDATIONHOME') 32 scenariodir2 = add_directories(main.home, ["data", "mem_time_test", "triangles", "area"]) 30 home2 = os.getenv('INUNDATIONHOME') 31 32 scenariodir2 = add_directories(home2, ["data", "mem_time_test", "triangles", "area"]) 33 33 34 34 h = 'CAIRNS.msh' … … 39 39 file_path_storen = os.path.join(scenariodir2, storen) 40 40 storel = 'storel.txt' 41 file_path_storel = os.path.join(scenariodir2, store )42 storea = 'store .txt'41 file_path_storel = os.path.join(scenariodir2, storel) 42 storea = 'storea.txt' 43 43 file_path_storea = os.path.join(scenariodir2, storea) 44 44 … … 121 121 122 122 123 spacelist[myid] = system_tools.MemoryUpdate()[0]124 a = sum( spacelist)123 liststore.store[myid] = system_tools.MemoryUpdate()[0] 124 a = sum(liststore.store) 125 125 126 126 v = open(file_path_store, 'r+')
Note: See TracChangeset
for help on using the changeset viewer.