- 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/area/runcairns.py
r8300 r8303 19 19 import time 20 20 import sys 21 import random21 import main 22 22 23 23 # Related major packages 24 24 import anuga 25 from anuga_parallel import distribute, myid 26 from anuga.abstract_2d_finite_volumes.util import add_directories 27 from anuga.utilities import system_tools, log 25 28 26 from anuga_parallel import distribute, myid, numprocs, finalize, barrier 29 spacelist = [0,0,0,0] 27 30 28 import PyVM 29 import liststore 31 #home = os.getenv('INUNDATIONHOME') 32 scenariodir2 = add_directories(main.home, ["data", "mem_time_test", "triangles", "area"]) 30 33 31 length = random.random()*2000 + 1 32 area = random.random()*100 + 1 34 h = 'CAIRNS.msh' 35 file_pathh = os.path.join(scenariodir2, h) 36 store ='store.txt' 37 file_path_store = os.path.join(scenariodir2, store) 38 storen ='storen.txt' 39 file_path_storen = os.path.join(scenariodir2, storen) 40 storel = 'storel.txt' 41 file_path_storel = os.path.join(scenariodir2, store) 42 storea = 'store.txt' 43 file_path_storea = os.path.join(scenariodir2, storea) 33 44 45 f = open(file_path_storel,'r+') # SQRT extent this is set 46 length = float(f.readline()) 47 f.close() 34 48 35 PyVM.MemoryUpdate() 49 f = open(file_path_storea,'r+') #maxarea this is set 50 area = float(f.readline()) 51 f.close() 52 53 system_tools.MemoryUpdate() 36 54 #------------------------------------------------------------------------------ 37 55 # Create the triangular mesh and domain based on … … 46 64 'left': [3]}, 47 65 maximum_triangle_area=area, 48 mesh_filename= 'cairnsmesh.msh'66 mesh_filename=file_pathh 49 67 #,interior_regions=INTERIORREGIONS#, 50 68 #use_cache=True, … … 52 70 ) 53 71 54 n umber=len(domain)72 n = len(domain) 55 73 else: 56 74 domain = None … … 61 79 # Setup parameters of computational domain 62 80 #------------------------------------------------------------------------------ 63 domain.set_name('CAIRNS ') # Name of sww file64 domain.set_datadir( '.') # Store sww output here81 domain.set_name('CAIRNS.sww') # Name of sww file 82 domain.set_datadir(scenariodir2) # Store sww output here 65 83 66 84 #------------------------------------------------------------------------------ … … 93 111 'top': Br}) 94 112 113 95 114 #------------------------------------------------------------------------------ 96 115 # Evolve system through time … … 102 121 103 122 104 liststore.spacelist[myid] = PyVM.MemoryUpdate()[0]105 a = sum( liststore.spacelist)123 spacelist[myid] = system_tools.MemoryUpdate()[0] 124 a = sum(spacelist) 106 125 107 f = open('store.txt', 'r+')108 f.write(str(a))126 v = open(file_path_store, 'r+') 127 v.write(str(a)) 109 128 110 g = open('storel.txt', 'r+') 111 g.write(str(length)) 112 h = open('storea.txt', 'r+') 113 h.write(str(area)) 114 i = open('storen.txt', 'r+') 115 i.write(str(number)) 129 i = open(file_path_storen, 'r+') 130 i.write(str(n)) 116 131 132
Note: See TracChangeset
for help on using the changeset viewer.